diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index 20cb5ad8..116ce231 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -1,5 +1,5 @@ UltraStar WorldParty -Copyright (C) 2010-2019 by the following: +Copyright (C) 2010-2020 by the following: "Zup3r_vock" "Daniel20" @@ -16,7 +16,7 @@ French: ctariel If you have contributed to this project then you deserve to be on this list. Contact us and we'll add you. - --> Follow the project at https://github.com/ultrastares/usdxworldparty + --> Follow the project at https://github.com/ultrastares/ultrastar-worldparty/ --> Support and contact: https://ultrastar-es.org diff --git a/VERSION b/VERSION index 61b2edf4..7795cadb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -19.12 +20.12 diff --git a/configure.ac b/configure.ac index 15c2870c..ee10ecbb 100644 --- a/configure.ac +++ b/configure.ac @@ -74,12 +74,6 @@ AC_DEFUN([AC_SUBST_DEFINE], AC_ARG_WITH([cfg-dummy1], [ External Libraries:]) -# add portmixer option -AC_ARG_WITH([portmixer], - [AS_HELP_STRING([--with-portmixer], - [enable portmixer audio-mixer support @<:@default=check@:>@])], - [with_portmixer=$withval], [with_portmixer="check"]) - # add projectM option AC_ARG_WITH([libprojectM], [AS_HELP_STRING([--with-libprojectM], @@ -364,15 +358,6 @@ else fi AC_SUBST(USE_PROJECTM_CWRAPPER, $libprojectM_USE_CWRAPPER) -# find portaudio -PKG_HAVE([portaudio], [portaudio-2.0], yes) -PKG_VERSION([portaudio], [portaudio-2.0]) -AC_SUBST_DEFINE(HAVE_PORTAUDIO, $portaudio_HAVE) - -# find portmixer -PKG_HAVE([portmixer], [portmixer], no) -AC_SUBST_DEFINE(HAVE_PORTMIXER, $portmixer_HAVE) - # determine linker-flags if test x$FPC_PLATFORM = xdarwin; then LDFLAGS="-macosx_version_min 10.4 -undefined dynamic_lookup -headerpad_max_install_names -L/usr/X11/lib" @@ -421,5 +406,3 @@ if test x$FPC_PLATFORM = xdarwin; then !!! Selected packaging: $USE_OSX_PACKAGING with libdir $USE_OSX_PACKAGING_LIBDIR ]) fi - - diff --git a/dists/atom/linux/compile.sh b/dists/atom/linux/compile.sh index 5740c0fc..1e873742 100755 --- a/dists/atom/linux/compile.sh +++ b/dists/atom/linux/compile.sh @@ -1,5 +1,10 @@ #!/bin/bash cd "$1/src" +if [ $2 == "compile-so" ] +then + echo "Not implemented" + exit +fi if [ $2 != "execute" ] then processor=$(uname -m) @@ -9,7 +14,7 @@ then mkdir -p $target if [ $2 == "compile-debug" ] || [ $2 == "compile-debug-execute" ] then - fpc WorldParty.dpr -FE../game -FU$target -g -gh -gl -dDEBUG_MODE -Si -Sg -Sc -v0Binwe + fpc WorldParty.dpr -FE../game -FU$target -g -gl -dDEBUG_MODE -Si -Sg -Sc -v0Binwe else fpc WorldParty.dpr -FE../game -FU$target -O4 -Xs fi @@ -18,12 +23,7 @@ then mv $target/link.res ../res/ fi fi -if [ -f ../game/WorldParty ] && [ $2 != "compile-debug" ] && [ $2 != "compile" ] +if [ -f ../game/WorldParty ] then - if [ $2 == "compile-debug-execute" ] - then - ../game/WorldParty -Benchmark -Debug - else - ../game/WorldParty -Benchmark - fi + ../game/WorldParty -Benchmark if [ $2 == "compile-debug-execute" ] then -Debug fi fi diff --git a/dists/atom/windows/compile.bat b/dists/atom/windows/compile.bat index a6a0824a..0993eb5c 100644 --- a/dists/atom/windows/compile.bat +++ b/dists/atom/windows/compile.bat @@ -13,7 +13,7 @@ if not %2==execute ( fpc WorldParty.dpr -FE..\game -FU..\build -O4 -Xs ) if not %2==compile if not %2==compile-execute ( - fpc WorldParty.dpr -FE..\game -FU..\build -g -gl -gh -dDEBUG_MODE + fpc WorldParty.dpr -FE..\game -FU..\build -g -gl -dDEBUG_MODE ) if exist ..\build\link.res ( move /Y ..\build\link.res ..\res\link.res diff --git a/dists/linux/build-deps.sh b/dists/linux/build-deps.sh index 55f55f1d..03129841 100644 --- a/dists/linux/build-deps.sh +++ b/dists/linux/build-deps.sh @@ -64,13 +64,6 @@ make $makearg make install make distclean -echo "Building PortAudio" -cd "$SRC/portaudio" -./configure --prefix="$PREFIX" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" --disable-static -make $makearg -make install -make distclean - echo "Building Yasm" cd "$SRC/yasm" ./configure --prefix="$PREFIX" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" --disable-static diff --git a/dists/linux/dl.sh b/dists/linux/dl.sh index 9ec2ccf1..104179ba 100644 --- a/dists/linux/dl.sh +++ b/dists/linux/dl.sh @@ -8,7 +8,6 @@ deps+=('SDL2_image,https://www.libsdl.org/projects/SDL_image/release/SDL2_image- deps+=('sqlite,https://sqlite.org/2017/sqlite-autoconf-3170000.tar.gz') deps+=('yasm,http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz') deps+=('ffmpeg,https://ffmpeg.org/releases/ffmpeg-3.2.2.tar.gz') -deps+=('portaudio,http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz') deps+=('freetype,http://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz') deps+=('libpng,https://sourceforge.net/projects/libpng/files/libpng16/older-releases/1.6.28/libpng-1.6.28.tar.gz/download') diff --git a/dists/vscode/tasks.json b/dists/vscode/tasks.json index e220d066..4f970cd4 100644 --- a/dists/vscode/tasks.json +++ b/dists/vscode/tasks.json @@ -2,14 +2,17 @@ "version": "2.0.0", "tasks": [ { - "label": "Compile", + "label": "Compile DLL", "type": "shell", "windows": { "command": "dists/atom/windows/compile.bat . compile-dll" }, + "linux": { + "command": "dists/atom/linux/compile.sh . compile-so" + }, "presentation": { "reveal": "always", - "panel": "new" + "panel": "shared" }, "problemMatcher": { "owner": "external", @@ -37,7 +40,7 @@ }, "presentation": { "reveal": "always", - "panel": "new" + "panel": "shared" }, "problemMatcher": { "owner": "external", @@ -65,7 +68,7 @@ }, "presentation": { "reveal": "always", - "panel": "new" + "panel": "shared" }, "problemMatcher": { "owner": "external", @@ -93,7 +96,7 @@ }, "presentation": { "reveal": "always", - "panel": "new" + "panel": "shared" }, "problemMatcher": { "owner": "external", @@ -121,7 +124,7 @@ }, "presentation": { "reveal": "always", - "panel": "new" + "panel": "shared" }, "problemMatcher": { "owner": "external", @@ -149,7 +152,7 @@ }, "presentation": { "reveal": "always", - "panel": "new" + "panel": "shared" }, "problemMatcher": { "owner": "external", @@ -167,4 +170,4 @@ } } ] -} \ No newline at end of file +} diff --git a/game/README.txt b/game/README.txt index ea3f5295..469e245d 100644 --- a/game/README.txt +++ b/game/README.txt @@ -6,11 +6,11 @@ Due to huge amount of changes, we focus all documentation at our repository. ----------------------------------------------- +--------------------------------------------------- -https://github.com/ultrastares/usdxworldparty +https://github.com/ultrastares/ultrastar-worldparty ----------------------------------------------- +--------------------------------------------------- diff --git a/game/SDL2.dll b/game/SDL2.dll index 2b7e3193..af9f0bb8 100644 Binary files a/game/SDL2.dll and b/game/SDL2.dll differ diff --git a/game/SDL2_image.dll b/game/SDL2_image.dll index cd35db04..ab6f38b3 100644 Binary files a/game/SDL2_image.dll and b/game/SDL2_image.dll differ diff --git a/game/SDL2_mixer.dll b/game/SDL2_mixer.dll deleted file mode 100644 index 47adbc3f..00000000 Binary files a/game/SDL2_mixer.dll and /dev/null differ diff --git a/game/avcodec-57.dll b/game/avcodec-58.dll similarity index 60% rename from game/avcodec-57.dll rename to game/avcodec-58.dll index f2cb274c..599662b0 100644 Binary files a/game/avcodec-57.dll and b/game/avcodec-58.dll differ diff --git a/game/avdevice-57.dll b/game/avdevice-57.dll deleted file mode 100644 index 2124a53a..00000000 Binary files a/game/avdevice-57.dll and /dev/null differ diff --git a/game/avfilter-6.dll b/game/avfilter-6.dll deleted file mode 100644 index e7646585..00000000 Binary files a/game/avfilter-6.dll and /dev/null differ diff --git a/game/avformat-57.dll b/game/avformat-57.dll deleted file mode 100644 index 39e1a567..00000000 Binary files a/game/avformat-57.dll and /dev/null differ diff --git a/game/avformat-58.dll b/game/avformat-58.dll new file mode 100644 index 00000000..dfd0edc0 Binary files /dev/null and b/game/avformat-58.dll differ diff --git a/game/avutil-55.dll b/game/avutil-55.dll deleted file mode 100644 index ba98ce29..00000000 Binary files a/game/avutil-55.dll and /dev/null differ diff --git a/game/avutil-56.dll b/game/avutil-56.dll new file mode 100644 index 00000000..cea56cb2 Binary files /dev/null and b/game/avutil-56.dll differ diff --git a/game/bassmidi.dll b/game/bassmidi.dll deleted file mode 100644 index 3a10d18f..00000000 Binary files a/game/bassmidi.dll and /dev/null differ diff --git a/game/fonts/fonts.ini b/game/fonts/fonts.ini index cdc51820..efb8b810 100644 --- a/game/fonts/fonts.ini +++ b/game/fonts/fonts.ini @@ -46,26 +46,31 @@ File=Roboto/Roboto-Regular.ttf GlyphSpacing=1.1 Stretch=0.8 +LineSpacing=0.85 [Font_Outline1] File=Roboto/Roboto-Bold.ttf Outline=0.06 Stretch=0.8 +LineSpacing=0.85 [Font_Outline2] File=Roboto/Roboto-Bold.ttf Outline=0.09 Stretch=0.8 +LineSpacing=0.85 [Font_Bold] File=Roboto/Roboto-Bold.ttf ;Embolden=0.06 +LineSpacing=0.85 [Font_BoldHighRes] File=Roboto/Roboto-Bold.ttf MaxResolution=256 PreCache=0 Outline=0.02 +LineSpacing=0.85 [Fallbacks] File=NotoSans/NotoSans-Regular.ttf @@ -85,4 +90,4 @@ File13=NotoSans/NotoSansMyanmar-Regular.ttf File14=NotoSans/NotoSansOriya-Regular.ttf File15=NotoSans/NotoSansTamil-Regular.ttf File16=NotoSans/NotoSansTelugu-Regular.ttf -File17=NotoSans/NotoSansThai-Regular.ttf \ No newline at end of file +File17=NotoSans/NotoSansThai-Regular.ttf diff --git "a/game/languages/Catal\303\240.ini" "b/game/languages/Catal\303\240.ini" index 685b3aa4..54752860 100644 --- "a/game/languages/Catal\303\240.ini" +++ "b/game/languages/Catal\303\240.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Català +LANGUAGE_ISO_CODE=ca SING_LOADING=Carregant... SING_LOADING_SONGS=Carregant cançons de la carpeta %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Difícil SING_OPTIONS=Opcions -SING_OPTIONS_GAME=Joc -SING_OPTIONS_GRAPHICS=Gràfics -SING_OPTIONS_SOUND=So -SING_OPTIONS_LYRICS=LLetres -SING_OPTIONS_THEMES=Aparença -SING_OPTIONS_MICROPHONES=Micròfons -SING_OPTIONS_ADVANCED=Avançat -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Enrere - SING_OPTIONS_GAME_LANGUAGE=Idioma SING_OPTIONS_GAME_SONGMENU=Menú de cançons ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Pestanyes SING_OPTIONS_GAME_SORTING=Ordenació -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Gamepad OPTION_VALUE_ROULETTE=Ruleta @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Curs OPTION_VALUE_DECADE=Dècada OPTION_VALUE_PLAYLIST=LLista -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Pantalla complerta SING_OPTIONS_GRAPHICS_RESOLUTION=Resolucị @@ -95,14 +85,14 @@ OPTION_VALUE_WHENNOVIDEO=Quan no hi ha vídeo OPTION_VALUE_WHENNOVIDEOANDIMAGE=Quan no hi ha vídeo i imatge ;TODO: OPTION_VALUE_HALF=Half -;TODO: OPTION_VALUE_FULL_VID=Full (Video) -;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & Video) +;TODO: OPTION_VALUE_FULL_VID=Full (video) +;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & video) SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Reproducció del micro SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Música de fons SING_OPTIONS_SOUND_CLICK_ASSIST=Assistència Click SING_OPTIONS_SOUND_BEAT_CLICK=Clic de ritme -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Volum previsualitzar SING_OPTIONS_SOUND_PREVIEWFADING=Fos previsualitzar @@ -156,9 +146,9 @@ SING_OPTIONS_NETWORK_PASSWORD=Contrasenya SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Envia el nom ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Jugador -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? SING_OPTIONS_NETWORK_LEGEND_INSERT=Insereix @@ -196,25 +186,25 @@ WEBSITE_ERROR_SONG=Cançó no trobada ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send ;TODO: SCORE_SEND_PLAYER=Player -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Cancel·lar ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_RESOLUTION=Resolucị SING_OPTIONS_WEBCAM_EFFECT=Efecte ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Llindar ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -253,40 +243,16 @@ JUKEBOX_SONGOPTIONS_LYRIC_COLOR=Color ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_RGB_GREEN=Green ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Blue +;TODO: JUKEBOX_SONGOPTIONS_LYRIC=Lyric Options +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position + OPTION_VALUE_TO_SING=Canta -OPTION_VALUE_ACTUAL=Superior -OPTION_VALUE_NEXT=Inferior +OPTION_VALUE_TOP=Superior +OPTION_VALUE_BOTTOM=Inferior ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Blau -OPTION_VALUE_GREEN=Verd -OPTION_VALUE_PINK=Rosa -OPTION_VALUE_RED=Vermell -OPTION_VALUE_VIOLET=Violeta -OPTION_VALUE_ORANGE=Taronja -OPTION_VALUE_YELLOW=Groc -OPTION_VALUE_BROWN=Marró -OPTION_VALUE_BLACK=Negre -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Gris -OPTION_VALUE_WHITE=Blanc -OPTION_VALUE_TURQUOISE=Turquesa -OPTION_VALUE_SALMON=Salmó -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Seleccionar SING_LEGEND_NAVIGATE=Navegar @@ -299,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=LLista SING_SONG_IN_CAT=Cançon SING_SONGS_IN_CAT=Cançons PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Llegenda -SING_SONG_SELECTION_LEGEND_VIDEO=Vídeo -SING_SONG_SELECTION_LEGEND_MEDLEY=Versió curta -SING_SONG_SELECTION_LEGEND_MEDLEYC=Versió curta calculada -SING_SONG_SELECTION_LEGEND_DUET=Duo SING_TOTAL=Total SING_MODE=Cantar sol @@ -345,7 +306,6 @@ IMPLODE_GLUE2= i SONG_MENU_NAME_MAIN=Menú de cançons SONG_MENU_PLAY=Cantar SONG_MENU_CHANGEPLAYERS=Canviar jugadors -SONG_MENU_CANCEL=Cancel·lar SONG_MENU_NAME_PLAYLIST=Menú de cançons SONG_MENU_PLAYLIST_ADD=Afegir Cançó @@ -375,8 +335,36 @@ SONG_MENU_JOKER=Comodí SONG_MENU_NAME_PARTY_JOKER=Utilitzar comodí -SONG_JUMPTO_DESC=Buscar cançó -SONG_JUMPTO_TYPE_DESC=Buscar: +SONG_MENU_LEGEND_TITLE=LLegenda +SONG_MENU_LEGEND_VIDEO=Vídeo +SONG_MENU_LEGEND_MEDLEY=Versió curta +SONG_MENU_LEGEND_MEDLEYC=Versió curta calculada +SONG_MENU_LEGEND_DUET=Duo +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Menú de cançons +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Afegir Song +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Esborrar Cançó +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Mode festa PARTY_DIFFICULTY=Dificultat @@ -427,7 +415,7 @@ PARTY_DISMISSED=Abandona! PARTY_SCORE_WINS=%s PARTY_SCORE_WINS2=Guanya! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=Aguantar la línia @@ -518,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx Cantades ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -534,40 +522,25 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Següent jugador al micro ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Menú de cançons -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Afegir Song -SONG_MENU_DELETE_SONG=Esborrar Cançó -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Nombre de jugadors NAME_CURRENT_PLAYER=Jugador -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Quant a... ABOUT_USDX_DEVELOPEDBY=Desenvolupat per @@ -581,7 +554,7 @@ DEVELOPERS_TITLE=Desenvolupat per DEVELOPERS_OVERVIEW=Persones que han contribuït a aquest projecte:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Visiteu-nos per obtenir més informació.\n\nhttps://ultrastar-es.org SCREENSHOT_SAVED=S'ha desat la captura de pantalla -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot MSG_ERROR_TITLE=Error ;TODO: MSG_INFO_TITLE=Information @@ -599,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=No es pot carregar: No s'han trobat línies ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=No es pot carregar: Error llegint línia %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Jugador %d s'assigna a diversos micròfons. Comproveu les opcions del micròfon. ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Jugador %d no està assignat a un micròfon. Comproveu les opcions del micròfon. + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Avançat +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Enrere +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Negre +C_COLOR_BLUE=Blau +C_COLOR_BROWN=Marró +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +C_COLOR_GRAY=Gris +C_COLOR_GREEN=Verd +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Taronja +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Rosa +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Vermell +C_COLOR_SALMON=Salmó +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +C_COLOR_TURQUOISE=Turquesa +C_COLOR_VIOLET=Violeta +C_COLOR_WHITE=Blanc +C_COLOR_YELLOW=Groc +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Joc +C_GRAPHICS=Gràfics + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=LLetres + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Micròfons +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=So +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +;TODO: C_THEMES=Themes +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Dansk.ini b/game/languages/Dansk.ini index 7f8e9184..e9b57f28 100644 --- a/game/languages/Dansk.ini +++ b/game/languages/Dansk.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Dansk +LANGUAGE_ISO_CODE=da SING_LOADING=Loader... SING_LOADING_SONGS=Indlæser sange fra mappe %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Svær SING_OPTIONS=Indstillinger -SING_OPTIONS_GAME=Spil -SING_OPTIONS_GRAPHICS=Grafik -SING_OPTIONS_SOUND=Lyd -SING_OPTIONS_LYRICS=Tekster -SING_OPTIONS_THEMES=Temaer -SING_OPTIONS_MICROPHONES=Optag -SING_OPTIONS_ADVANCED=Advanceret -;TODO: SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Tilbage - SING_OPTIONS_GAME_LANGUAGE=Sprog SING_OPTIONS_GAME_SONGMENU=Sang Menu ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Tabs SING_OPTIONS_GAME_SORTING=Sorting -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Aktiver gamepad OPTION_VALUE_ROULETTE=Roulette @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=År OPTION_VALUE_DECADE=Årti OPTION_VALUE_PLAYLIST=Afspilningsliste -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Fuldskærm SING_OPTIONS_GRAPHICS_RESOLUTION=Opløsning @@ -92,17 +82,17 @@ SING_OPTIONS_GRAPHICS_MOVIE_SIZE=Film Størrelse ;TODO: OPTION_VALUE_BORDERLESS=Borderless ;TODO: OPTION_VALUE_WHENNOVIDEO=When No Video -;TODO: OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No Video and Image +;TODO: OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No video and image ;TODO: OPTION_VALUE_HALF=Half -;TODO: OPTION_VALUE_FULL_VID=Full (Video) -;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & Video) +;TODO: OPTION_VALUE_FULL_VID=Full (video) +;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & video) SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Mikrofon afspilning SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Baggrunds musik SING_OPTIONS_SOUND_CLICK_ASSIST=Click assist SING_OPTIONS_SOUND_BEAT_CLICK=Beat click -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Frosmag Volume SING_OPTIONS_SOUND_PREVIEWFADING=Forsmag Fader @@ -118,9 +108,9 @@ SING_OPTIONS_LYRICS_FONT=Tekst Type SING_OPTIONS_LYRICS_EFFECT=Effekt ;TODO: SING_OPTIONS_LYRICS_NOTELINES=Staves -;TODO: OPTION_VALUE_PLAIN=stylized -;TODO: OPTION_VALUE_OLINE1=with thin edge -;TODO: OPTION_VALUE_OLINE2=with thick edge +;TODO: OPTION_VALUE_PLAIN=Stylized +;TODO: OPTION_VALUE_OLINE1=With thin edge +;TODO: OPTION_VALUE_OLINE2=With thick edge ;TODO: OPTION_VALUE_SIMPLE=Simple ;TODO: OPTION_VALUE_ZOOM=Zoom @@ -143,8 +133,8 @@ SING_OPTIONS_ADVANCED_OSCILLOSCOPE=Oscilloskop SING_OPTIONS_ADVANCED_ONSONGCLICK=Efter sang valg SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Savety Questions SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto Festmodus -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Alle ;TODO: OPTION_VALUE_PLAYER=Player @@ -153,12 +143,12 @@ OPTION_VALUE_ALL=Alle ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website ;TODO: SING_OPTIONS_NETWORK_USERNAME=Username ;TODO: SING_OPTIONS_NETWORK_PASSWORD=Password -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Spiller -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Annuller ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Annuller ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! SONG_SCORE_MAX=Bedst: SONG_SCORE_MEDIA=Gennemsnit: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send ;TODO: SCORE_SEND_PLAYER=Player -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Annuller ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_RESOLUTION=Opløsning SING_OPTIONS_WEBCAM_EFFECT=Effekt ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview SING_OPTIONS_WEBCAM_NO_WEBCAM=Ingen Webcam fundet! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Tærskel ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Blå ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Syng -OPTION_VALUE_ACTUAL=Øverst -OPTION_VALUE_NEXT=Bund +OPTION_VALUE_TOP=Øverst +OPTION_VALUE_BOTTOM=Bund OPTION_VALUE_OTHER=Andet ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Blå -OPTION_VALUE_GREEN=Grøn -OPTION_VALUE_PINK=Lyserød -OPTION_VALUE_RED=Rød -;TODO: OPTION_VALUE_VIOLET=Violet -;TODO: OPTION_VALUE_ORANGE=Orange -OPTION_VALUE_YELLOW=Gul -OPTION_VALUE_BROWN=Brun -OPTION_VALUE_BLACK=Sort -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Grå -OPTION_VALUE_WHITE=Hvid -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Vælg SING_LEGEND_NAVIGATE=Naviger @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Afspilningsliste SING_SONG_IN_CAT=Song SING_SONGS_IN_CAT=Songs PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legende -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Total SING_MODE=Syng Solo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= og SONG_MENU_NAME_MAIN=Sang Menu SONG_MENU_PLAY=Syng SONG_MENU_CHANGEPLAYERS=Skift Spillere -SONG_MENU_CANCEL=Annuller SONG_MENU_NAME_PLAYLIST=Sang Menu SONG_MENU_PLAYLIST_ADD=Tilføj Sang @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Brug Jokeren -SONG_JUMPTO_DESC=Søg Sang -SONG_JUMPTO_TYPE_DESC=Søg Efter: +SONG_MENU_LEGEND_TITLE=Legende +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Sang +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Sang Menu +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Tilføj Song +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Slet Sang +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Fest modus PARTY_DIFFICULTY=Sværhedsgrad @@ -410,7 +395,7 @@ PARTY_SONG_LEGEND_CONTINUE=Syng PARTY_SONG_MENU=Fest menu OPTION_VALUE_SING=Syng -;TODO: OPTION_VALUE_SELECT_PLAYERS=Select Players +;TODO: OPTION_VALUE_SELECT_PLAYERS=Select players ;TODO: OPTION_VALUE_OPEN_MENU=Open Menu PARTY_SCORE_DESC=Sidste Rundes Score @@ -430,7 +415,7 @@ PARTY_DISMISSED=Afsluttet! PARTY_SCORE_WINS=%s PARTY_SCORE_WINS2=Vinder! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=Hold Linien @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx Sung ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,54 +522,39 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Næste spillere til mikrofonerne ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -SONG_MENU_SONG=Sang -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Sang Menu -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Tilføj Song -SONG_MENU_DELETE_SONG=Slet Sang -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! -;TODO: NAME_PLAYERS_COUNT=Number of Players +;TODO: SING_SONGS_MYSCORES=My scores + +;TODO: NAME_PLAYERS_COUNT=Number of players ;TODO: NAME_CURRENT_PLAYER=Player -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Om... ABOUT_USDX_DEVELOPEDBY=Udviklet af ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ABOUT_OVERVIEW=Opdag en ny måde at synge, alene, par eller venner med. \n Sjov er garanteret.\n\nWorldParty er en gaffel af den oprindelige version Ultrastar Deluxe 1.1 designet og udviklet af UltraStar España Team, tæller det med det største karaoke-fællesskab.\n\n\nDette program er gratis og libre under GPL-licensen. \n\n Besøg os for mere information.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Udviklet af DEVELOPERS_OVERVIEW=Folk der har bidraget til dette projekt:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Besøg os for mere information.\n\nhttps://ultrastar-es.org ;TODO: SCREENSHOT_SAVED=Screenshot saved -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot MSG_ERROR_TITLE=Fejl ;TODO: MSG_INFO_TITLE=Information @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG=Sangen kunne ikke hentes. ;TODO: ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Song could not be loaded: Error parsing line %0:d ;TODO: ERROR_PLAYER_DEVICE_ASSIGNMENT=Player %d is assigned to multiple microphones. Please check your microphone options ;TODO: ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Player %d is not assigned to a microphone. Please check your microphone options + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Advanceret +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Tilbage +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Sort +C_COLOR_BLUE=Blå +C_COLOR_BROWN=Brun +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +C_COLOR_GRAY=Grå +C_COLOR_GREEN=Grøn +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +C_COLOR_MAGENTA=Magenta +;TODO: C_COLOR_ORANGE=Orange +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Lyserød +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Rød +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +;TODO: C_COLOR_VIOLET=Violet +C_COLOR_WHITE=Hvid +C_COLOR_YELLOW=Gul +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Spil +C_GRAPHICS=Grafik + +;TODO: C_INFORMATION=Information +;TODO: C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Tekster + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Optag +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Lyd +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Temaer +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Deutsch.ini b/game/languages/Deutsch.ini index 1d7ac1f7..e57265a7 100644 --- a/game/languages/Deutsch.ini +++ b/game/languages/Deutsch.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Deutsch +LANGUAGE_ISO_CODE=de SING_LOADING=Lädt... SING_LOADING_SONGS=Lade Titel aus Verz. %s @@ -40,17 +41,6 @@ OPTION_VALUE_HARD=Schwierig SING_OPTIONS=Optionen -SING_OPTIONS_GAME=Spiel -SING_OPTIONS_GRAPHICS=Grafik -SING_OPTIONS_SOUND=Sound -SING_OPTIONS_LYRICS=Lyrics -SING_OPTIONS_THEMES=Design -SING_OPTIONS_MICROPHONES=Mikrofone -SING_OPTIONS_ADVANCED=Erweitert -SING_OPTIONS_NETWORK=Internet -SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Zurück - SING_OPTIONS_GAME_LANGUAGE=Sprache SING_OPTIONS_GAME_SONGMENU=Menü SING_OPTIONS_GAME_DUETS=DuettScores @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC=Lyricsoptionen JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Singen -OPTION_VALUE_ACTUAL=Aktuelle -OPTION_VALUE_NEXT=Nächste +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom OPTION_VALUE_OTHER=Other OPTION_VALUE_FILL=Füllung OPTION_VALUE_OUTLINE=Umriss -OPTION_VALUE_BLUE=Blau -OPTION_VALUE_GREEN=Grün -OPTION_VALUE_PINK=Rosa -OPTION_VALUE_RED=Rot -OPTION_VALUE_VIOLET=Violett -OPTION_VALUE_ORANGE=Orange -OPTION_VALUE_YELLOW=Gelb -OPTION_VALUE_BROWN=Braun -OPTION_VALUE_BLACK=Schwarz -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Grau -OPTION_VALUE_WHITE=Weiß -OPTION_VALUE_TURQUOISE=Türkis -OPTION_VALUE_SALMON=Lachsfarben -OPTION_VALUE_GREENYELLOW=Grüngelb -OPTION_VALUE_LAVENDER=Lavendel -OPTION_VALUE_BEIGE=Beige -OPTION_VALUE_TEAL=Blaugrün -OPTION_VALUE_ORCHID=Orchidee -OPTION_VALUE_STEELBLUE=Stahlblau -OPTION_VALUE_PLUM=Pflaume -OPTION_VALUE_CHOCOLATE=Schokolade -OPTION_VALUE_GOLD=Gold -OPTION_VALUE_DARKBLUE=Dunkelblau -OPTION_VALUE_SKY=Himmelblau -OPTION_VALUE_HARLEQUIN=Harlekin -OPTION_VALUE_CYAN=Cyan -OPTION_VALUE_FLAME=Flamme + SING_LEGEND_SELECT=Auswählen SING_LEGEND_NAVIGATE=Navigieren @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Playlist SING_SONG_IN_CAT=Song SING_SONGS_IN_CAT=Songs PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legende -SING_SONG_SELECTION_LEGEND_VIDEO=Video -SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley berechnet -SING_SONG_SELECTION_LEGEND_DUET=Duett SING_TOTAL=Gesamt SING_MODE=Singmodus @@ -348,7 +306,6 @@ IMPLODE_GLUE2= und SONG_MENU_NAME_MAIN=Menü SONG_MENU_PLAY=Singen SONG_MENU_CHANGEPLAYERS=Spieler wechseln -SONG_MENU_CANCEL=Abbrechen SONG_MENU_NAME_PLAYLIST=Menü SONG_MENU_PLAYLIST_ADD=Song hinzufügen @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Joker einsetzen -SONG_JUMPTO_DESC=Song suchen -SONG_JUMPTO_TYPE_DESC=Suchen in: +SONG_MENU_LEGEND_TITLE=Legende +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duett +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Song +SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Song Menü +SONG_MENU_NAME_MEDLEY=Medley Menü +SONG_MENU_ADD_SONG=Song hinzufügen +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Song löschen +SONG_MENU_START_MEDLEY=Singen! +SONG_MENU_START_5_MEDLEY=%0:d Songs singen! + +SONG_MENU_NAME_SORTING=Sortierungsmenü +SONG_MENU_SORTING_APPLY=Anwenden + +SONG_MENU_OPEN_CATEGORY=Kategorie öffnen +SONG_MENU_CLOSE_CATEGORY=Kategorie schließen +SONG_MENU_START_JUKEBOX=Jukebox starten! +SONG_MENU_NAME_JUKEBOX=Jukebox Menü + +SONG_SEARCH_DESC=Was wollen Sie jetzt singen? PARTY_MODE=Party-Modus PARTY_DIFFICULTY=Schwierigkeit @@ -469,20 +454,20 @@ MODE_BLIND_DESC=Eins-gegen-Eins mit versteckten Noten MODE_BLINDTOTAL_NAME=Totale Blindheit MODE_BLINDTOTAL_DESC=Kannst du's schaffen? Ohne Noten, ohne Text? Los geht's! -MODE_1000BLIND_NAME =+1000 blind -MODE_1000BLIND_DESC =Erreiche einen Vorsprung von über 1000 Punkten, ohne dabei die Noten zu sehen! +MODE_1000BLIND_NAME=+1000 blind +MODE_1000BLIND_DESC=Erreiche einen Vorsprung von über 1000 Punkten, ohne dabei die Noten zu sehen! -MODE_DEAF_NAME =Taub -MODE_DEAF_DESC =Denkst, du kannst singen? Versuch's ohne Begleitung der Noten! +MODE_DEAF_NAME=Taub +MODE_DEAF_DESC=Denkst, du kannst singen? Versuch's ohne Begleitung der Noten! -MODE_BLINDLYRICS_NAME =Ohne Text -MODE_BLINDLYRICS_DESC =Denkst, kennst jeden Song? Versuch's mal ohne Text! +MODE_BLINDLYRICS_NAME=Ohne Text +MODE_BLINDLYRICS_DESC=Denkst, kennst jeden Song? Versuch's mal ohne Text! -MODE_500BLIND_NAME =+500 Blind -MODE_500BLIND_DESC =Erreiche einen Vorsprung von über 500 Punkten, ohne dabei die Noten zu sehen! +MODE_500BLIND_NAME=+500 Blind +MODE_500BLIND_DESC=Erreiche einen Vorsprung von über 500 Punkten, ohne dabei die Noten zu sehen! -MODE_SHORTSONG_NAME =Kurzes Lied -MODE_SHORTSONG_DESC =Schnelles kurzes Duell 1-gegen-1! +MODE_SHORTSONG_NAME=Kurzes Lied +MODE_SHORTSONG_DESC=Schnelles kurzes Duell 1-gegen-1! MODE_HARDCORE_NAME=Hardcore MODE_HARDCORE_DESC=Umkämpfe eine Führung über 3 Phrasen hinweg und siege! @@ -544,29 +529,14 @@ JUKEBOX_FIND=Finde: JUKEBOX_SORT=Sortieren: JUKEBOX_SONGLIST=Songliste: -SONG_MENU_SONG=Song -SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Song Menü -SONG_MENU_NAME_MEDLEY=Medley Menü -SONG_MENU_ADD_SONG=Song hinzufügen -SONG_MENU_DELETE_SONG=Song löschen -SONG_MENU_START_MEDLEY=Singen! -SONG_MENU_START_5_MEDLEY=%0:d Songs singen! - -SONG_MENU_NAME_SORTING=Sortierungsmenü -SONG_MENU_SORTING_APPLY=Anwenden - PARTY_PLAYLIST_MANUAL=Manuelle Auswahl PARTY_MODE_JUKEBOX_NO_SONGS=Playlist ist leer! -SONG_MENU_OPEN_CATEGORY=Kategorie öffnen -SONG_MENU_CLOSE_CATEGORY=Kategorie schließen -SONG_MENU_START_JUKEBOX=Jukebox starten! -SONG_MENU_NAME_JUKEBOX=Jukebox Menü WEBSITE_EXIST_SONG=Dieser Song ist der folgenden Webseite zugeordnet: %0:s WEBSITE_NOT_EXIST_SONG=Dieser Song ist keiner Webseite zugeordnet! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Anzahl der Spieler NAME_CURRENT_PLAYER=Spieler @@ -574,11 +544,11 @@ JUKEBOX_MODE=Jukebox Modus ABOUT_MAIN=Über... ABOUT_USDX_DEVELOPEDBY=Entwickelt von -ABOUT_CHECK_CHECKING=Suche nach Aktualisierungen... -ABOUT_CHECK_AVAILABLE=Eine neue Version ist verfügbar -ABOUT_CHECK_UPTODATE=WorldParty ist aktuell -ABOUT_CHECK_CONNECTION=Keine Internetverbindung -ABOUT_OVERVIEW=Entdecke eine neue Art alleine oder mit Freunden zu singen. \n Spaß ist garantiert. \n\nWorldParty ist ein Zweig der orginal Version Ultrastar Deluxe 1.1 gestaltet und entwickelt vom UltraStar España Team, die größe Karaoke Community.\n\n\nDies Programm ist frei und unter der GPL lizenziert. \n\n Für weitere Informationen besucht uns auf: \n\nhttps://ultrastar-es.org +;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... +;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available +;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection +;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Entwickelt von DEVELOPERS_OVERVIEW=Menschen, die zu diesem Projekt beigetragen haben:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Besuchen Sie uns für weitere Informationen.\n\nhttps://ultrastar-es.org @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Song konnte nicht geladen werden: Es wurden keine S ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Song konnte nicht geladen werden: Fehler beim Einlesen der Zeile %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Mehrere Mikrofone für Spieler %d gewählt.\nÜberprüfen Sie Ihre Mikrofonoptionen. ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Kein Mikrofon für Spieler %d gewählt.\nÜberprüfen Sie Ihre Mikrofonoptionen. + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Erweitert +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Zurück +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +;TODO: C_COLOR_BLACK=Black +C_COLOR_BLUE=Blau +C_COLOR_BROWN=Braun +C_COLOR_CYAN=Cyan +C_COLOR_CHOCOLATE=Schokolade +C_COLOR_DARKBLUE=Dunkelblau +C_COLOR_FLAME=Flamme +C_COLOR_GOLD=Gold +C_COLOR_GRAY=Grau +C_COLOR_GREEN=Grün +C_COLOR_GREENYELLOW=Grüngelb +C_COLOR_HARLEQUIN=Harlekin +C_COLOR_LAVENDER=Lavendel +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Orange +C_COLOR_ORCHID=Orchidee +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Rosa +C_COLOR_PLUM=Pflaume +C_COLOR_RED=Rot +C_COLOR_SALMON=Lachsfarben +C_COLOR_SKY=Himmelblau +C_COLOR_STEELBLUE=Stahlblau +C_COLOR_TEAL=Blaugrün +C_COLOR_TURQUOISE=Türkis +C_COLOR_VIOLET=Violett +C_COLOR_WHITE=Weiß +C_COLOR_YELLOW=Gelb +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Spiel +C_GRAPHICS=Grafik + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Lyrics + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Mikrofone +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Sound +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Design +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +C_WEBCAM=Webcam + +;TODO: C_YES=Yes diff --git a/game/languages/English.ini b/game/languages/English.ini index 4cc6b06a..684281a8 100644 --- a/game/languages/English.ini +++ b/game/languages/English.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=English +LANGUAGE_ISO_CODE=en SING_LOADING=Loading... SING_LOADING_SONGS=Loading songs from folder %s @@ -40,29 +41,18 @@ OPTION_VALUE_HARD=Hard SING_OPTIONS=Options -SING_OPTIONS_GAME=Game -SING_OPTIONS_GRAPHICS=Graphics -SING_OPTIONS_SOUND=Sound -SING_OPTIONS_LYRICS=Lyrics -SING_OPTIONS_THEMES=Themes -SING_OPTIONS_MICROPHONES=Microphones -SING_OPTIONS_ADVANCED=Advanced -SING_OPTIONS_NETWORK=Internet -SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Back - SING_OPTIONS_GAME_LANGUAGE=Language -SING_OPTIONS_GAME_SONGMENU=Song Menu +SING_OPTIONS_GAME_SONGMENU=Song menu SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Tabs SING_OPTIONS_GAME_SORTING=Sorting -SING_OPTIONS_GAME_SHOWSCORES=Show Scores +SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Activate gamepad OPTION_VALUE_ROULETTE=Roulette OPTION_VALUE_CHESSBOARD=Chessboard OPTION_VALUE_CAROUSEL=Carousel -OPTION_VALUE_SLOT_MACHINE=Slot Machine +OPTION_VALUE_SLOT_MACHINE=Slot machine OPTION_VALUE_LIST=List OPTION_VALUE_MOSAIC=Tile @@ -80,31 +70,31 @@ OPTION_VALUE_YEAR=Year OPTION_VALUE_DECADE=Decade OPTION_VALUE_PLAYLIST=Playlist -OPTION_VALUE_WHEN_EXISTS=When Exists +OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Fullscreen SING_OPTIONS_GRAPHICS_RESOLUTION=Resolution -SING_OPTIONS_GRAPHICS_SCREENFADE=Screen Fading -SING_OPTIONS_GRAPHICS_EFFECTSING=Sing Effects +SING_OPTIONS_GRAPHICS_SCREENFADE=Screen fading +SING_OPTIONS_GRAPHICS_EFFECTSING=Sing effects SING_OPTIONS_GRAPHICS_VISUALIZER=Visualization SING_OPTIONS_GRAPHICS_MOVIE_SIZE=Movie size OPTION_VALUE_BORDERLESS=Borderless OPTION_VALUE_WHENNOVIDEO=When No Video -OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No Video and Image +OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No video and image OPTION_VALUE_HALF=Half -OPTION_VALUE_FULL_VID=Full (Video) -OPTION_VALUE_FULL_VID_BG=Full (BG & Video) +OPTION_VALUE_FULL_VID=Full (video) +OPTION_VALUE_FULL_VID_BG=Full (BG & video) -SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Microphone Playback +SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Microphone playback SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Background music SING_OPTIONS_SOUND_CLICK_ASSIST=Click assist SING_OPTIONS_SOUND_BEAT_CLICK=Beat click -SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain -SING_OPTIONS_SOUND_PREVIEWVOLUME=Preview Volume -SING_OPTIONS_SOUND_PREVIEWFADING=Preview Fading +SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain +SING_OPTIONS_SOUND_PREVIEWVOLUME=Preview volume +SING_OPTIONS_SOUND_PREVIEWFADING=Preview fading OPTION_VALUE_GAIN_SOFT=Soft OPTION_VALUE_GAIN_MEDIUM=Medium @@ -140,11 +130,11 @@ SING_OPTIONS_MICROPHONES_MIC_BOOST=Mic boost SING_OPTIONS_ADVANCED_DEBUG=Debug SING_OPTIONS_ADVANCED_OSCILLOSCOPE=Oscilloscope -SING_OPTIONS_ADVANCED_ONSONGCLICK=After Song Select -SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Safety Questions +SING_OPTIONS_ADVANCED_ONSONGCLICK=After song select +SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Safety questions SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto PartyMenu SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=All OPTION_VALUE_PLAYER=Player @@ -153,12 +143,12 @@ SING_OPTIONS_NETWORK_INSERT_USER_INFO=Press key "Insert" to add user to this web SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Username SING_OPTIONS_NETWORK_PASSWORD=Password -SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Player -SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ WEBSITE_NO_CONNECTION=No website connection! WEBSITE_LOGIN_ERROR=Login Incorrect! WEBSITE_BLANK_LOGIN=There are blank fields! WEBSITE_EXIST_USER=Existing user! -WEBSITE_ERROR_SCORE=Scoring Error! +WEBSITE_ERROR_SCORE=Scoring error! WEBSITE_OK_SEND=Score sent successfully! -WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -WEBSITE_ERROR_SONG=Song Not Found! +WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +WEBSITE_ERROR_SONG=Song not found! WEBSITE_SAVE_SCORE=Score save successfully! WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ SONG_MENU_REFRESH_SCORES_TITLE=Update SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! SONG_MENU_REFRESH_SCORES_ONLINE=Online SONG_MENU_REFRESH_SCORES_FILE=File -SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song SONG_MENU_REFRESH_SCORES_REFRESH=Update SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! SONG_SCORE_MAX=Best: SONG_SCORE_MEDIA=Average: -SCORE_SEND_DESC=Send Score +SCORE_SEND_DESC=Send score SCORE_SEND=Send SCORE_SEND_PLAYER=Player -SCORE_SEND_OTHER_USER= Other Username +SCORE_SEND_OTHER_USER= Other username SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Download SCORE_DOWNLOAD_SONG=Song: -SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +SCORE_DOWNLOAD_CREATE_LIST=Preparing list... SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Cancel SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_HUE=Hue SING_OPTIONS_WEBCAM_EFFECT=Effect SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Threshold SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC=Lyric Options JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Sing -OPTION_VALUE_ACTUAL=Actual -OPTION_VALUE_NEXT=Next +OPTION_VALUE_TOP=Top +OPTION_VALUE_BOTTOM=Bottom OPTION_VALUE_OTHER=Other OPTION_VALUE_FILL=Fill OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Blue -OPTION_VALUE_GREEN=Green -OPTION_VALUE_PINK=Pink -OPTION_VALUE_RED=Red -OPTION_VALUE_VIOLET=Violet -OPTION_VALUE_ORANGE=Orange -OPTION_VALUE_YELLOW=Yellow -OPTION_VALUE_BROWN=Brown -OPTION_VALUE_BLACK=Black -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Gray -OPTION_VALUE_WHITE=White -OPTION_VALUE_TURQUOISE=Turquoise -OPTION_VALUE_SALMON=Salmon -OPTION_VALUE_GREENYELLOW=GreenYellow -OPTION_VALUE_LAVENDER=Lavender -OPTION_VALUE_BEIGE=Beige -OPTION_VALUE_TEAL=Teal -OPTION_VALUE_ORCHID=Orchid -OPTION_VALUE_STEELBLUE=Steel Blue -OPTION_VALUE_PLUM=Plum -OPTION_VALUE_CHOCOLATE=Chocolate -OPTION_VALUE_GOLD=Gold -OPTION_VALUE_DARKBLUE=Dark Blue -OPTION_VALUE_SKY=Sky -OPTION_VALUE_HARLEQUIN=Harlequin -OPTION_VALUE_CYAN=Cyan -OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Select SING_LEGEND_NAVIGATE=Navigate @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Playlist SING_SONG_IN_CAT=Song SING_SONGS_IN_CAT=Songs PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legend -SING_SONG_SELECTION_LEGEND_VIDEO=Video -SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Total SING_MODE=Sing solo @@ -319,16 +277,16 @@ SING_MENU=Main Menu SONG_SCORE=Song score SONG_SCORE_WHEREAMI=Score -SING_SCORE_TONE_DEAF=Tone Deaf +SING_SCORE_TONE_DEAF=Tone deaf SING_SCORE_AMATEUR=Amateur SING_SCORE_WANNABE=Wannabe SING_SCORE_HOPEFUL=Hopeful -SING_SCORE_RISING_STAR=Rising Star -SING_SCORE_LEAD_SINGER=Lead Singer +SING_SCORE_RISING_STAR=Rising star +SING_SCORE_LEAD_SINGER=Lead singer SING_SCORE_SUPERSTAR=Superstar SING_SCORE_ULTRASTAR=Ultrastar -SING_TOP_5_CHARTS=Top 5 Players +SING_TOP_5_CHARTS=Top 5 players SING_TOP_5_CHARTS_WHEREAMI=Top 5 SING_TOP_5_CHARTS_CONTINUE=To song selection SING_TOP_5_CHARTS_SWITCH_DIFFICULTY=Switch difficulty @@ -347,14 +305,13 @@ IMPLODE_GLUE2= and SONG_MENU_NAME_MAIN=Song menu SONG_MENU_PLAY=Sing -SONG_MENU_CHANGEPLAYERS=Change Players -SONG_MENU_CANCEL=Cancel +SONG_MENU_CHANGEPLAYERS=Choose who sing it SONG_MENU_NAME_PLAYLIST=Song Menu SONG_MENU_PLAYLIST_ADD=Add Song SONG_MENU_PLAYLIST_DEL=Delete Song -SONG_MENU_NAME_PLAYLIST_ADD=Add Song +SONG_MENU_NAME_PLAYLIST_ADD=Add song SONG_MENU_PLAYLIST_ADD_NEW=To new playlist SONG_MENU_PLAYLIST_ADD_EXISTING=To existing playlist SONG_MENU_PLAYLIST_NOEXISTING=No playlist available @@ -363,23 +320,51 @@ SONG_MENU_NAME_PLAYLIST_NEW=New Playlist SONG_MENU_PLAYLIST_NEW_CREATE=Create SONG_MENU_PLAYLIST_NEW_UNNAMED=Unnamed -SONG_MENU_NAME_PLAYLIST_DELITEM=Really Delete? +SONG_MENU_NAME_PLAYLIST_DELITEM=Really delete? SONG_MENU_YES=Yes SONG_MENU_NO=No -SONG_MENU_NAME_PLAYLIST_LOAD=Open Playlist +SONG_MENU_NAME_PLAYLIST_LOAD=Open playlist SONG_MENU_PLAYLIST_LOAD=Open -SONG_MENU_PLAYLIST_DELCURRENT=Delete current Playlist +SONG_MENU_PLAYLIST_DELCURRENT=Delete current playlist -SONG_MENU_NAME_PLAYLIST_DEL=Delete Playlist? +SONG_MENU_NAME_PLAYLIST_DEL=Delete playlist? -SONG_MENU_NAME_PARTY_MAIN=Party Menu +SONG_MENU_NAME_PARTY_MAIN=Party menu SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Take joker -SONG_JUMPTO_DESC=Search song -SONG_JUMPTO_TYPE_DESC=Search for: +SONG_MENU_LEGEND_TITLE=Legend +SONG_MENU_LEGEND_VIDEO=Video +SONG_MENU_LEGEND_MEDLEY=Medley +SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duet +SONG_MENU_LEGEND_RAP=Rap +SONG_MENU_LEGEND_CREATEDBY=Created by +SONG_MENU_LEGEND_FIXEDBY=Fixed by +SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Song +SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Song Menu +SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Add Song +SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Delete song +SONG_MENU_START_MEDLEY=Sing! +SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +SONG_MENU_NAME_SORTING=Sort menu +SONG_MENU_SORTING_APPLY=Apply + +SONG_MENU_OPEN_CATEGORY=Open category +SONG_MENU_CLOSE_CATEGORY=Close category +SONG_MENU_START_JUKEBOX=Start jukebox! +SONG_MENU_NAME_JUKEBOX=Menu jukebox + +SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Party mode PARTY_DIFFICULTY=Difficulty @@ -405,19 +390,19 @@ PARTY_SELECTMODE=Round %d PARTY_ROUND_LEGEND_CONTINUE=Start round -PARTY_SONG_WHEREAMI=Party Song-Selection +PARTY_SONG_WHEREAMI=Party song-selection PARTY_SONG_LEGEND_CONTINUE=Sing PARTY_SONG_MENU=Party menu OPTION_VALUE_SING=Sing -OPTION_VALUE_SELECT_PLAYERS=Select Players +OPTION_VALUE_SELECT_PLAYERS=Select players OPTION_VALUE_OPEN_MENU=Open Menu PARTY_SCORE_DESC=Score of the last round -PARTY_SCORE_WHEREAMI=Party Points +PARTY_SCORE_WHEREAMI=Party points PARTY_WIN_DESC=Winner of the party-game -PARTY_WIN_WHEREAMI=Party Winner +PARTY_WIN_WHEREAMI=Party winner PARTY_WIN_LEGEND_CONTINUE=Back to main-menu PARTY_ROUND=Round @@ -430,7 +415,7 @@ PARTY_DISMISSED=Dismissed! PARTY_SCORE_WINS=%s PARTY_SCORE_WINS2=Wins! -MODE_RANDOM_NAME=Random Mode +MODE_RANDOM_NAME=Random mode MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=Hold the Line @@ -496,38 +481,38 @@ STAT_OVERVIEW_PLAYER=Since the last Reset there were/was %0:d different Player(s STAT_FORMAT_DATE=%1:.2d.%0:.2d.%2:d STAT_DETAIL=Statistics -STAT_DETAIL_WHEREAMI=Detail Statistics +STAT_DETAIL_WHEREAMI=Detail statistics -STAT_NEXT=Next Page -STAT_PREV=Previous Page -STAT_REVERSE=Reverse Order +STAT_NEXT=Next page +STAT_PREV=Previous page +STAT_REVERSE=Reverse order STAT_PAGE=Page %0:d of %1:d \n Entries %2:d of %3:d STAT_DESC_SCORES=HighScores STAT_DESC_SCORES_REVERSED=LowScores STAT_FORMAT_SCORES=%0:s - %1:d [%2:s] %5:s \n (%3:s - %4:s) -STAT_DESC_SINGERS=Best Singers -STAT_DESC_SINGERS_REVERSED=Worst Singers -STAT_FORMAT_SINGERS=%0:s \n Average Score: %1:d +STAT_DESC_SINGERS=Best singers +STAT_DESC_SINGERS_REVERSED=Worst singers +STAT_FORMAT_SINGERS=%0:s \n Average score: %1:d -STAT_DESC_SONGS=Most popular Songs -STAT_DESC_SONGS_REVERSED=Least popular Songs +STAT_DESC_SONGS=Most popular songs +STAT_DESC_SONGS_REVERSED=Least popular songs STAT_FORMAT_SONGS=%0:s - %1:s \n %2:dx sung -STAT_DESC_BANDS=Most popular Bands -STAT_DESC_BANDS_REVERSED=Least popular Bands +STAT_DESC_BANDS=Most popular bands +STAT_DESC_BANDS_REVERSED=Least popular bands STAT_FORMAT_BANDS=%0:s \n %1:dx Sung PARTY_SELECT_MODE=Mode PARTY_MODE_CLASSIC=Classic -PARTY_MODE_CLASSIC_FREE=Classic Free +PARTY_MODE_CLASSIC_FREE=Classic free PARTY_MODE_CHALLENGE=Challenge PARTY_MODE_TOURNAMENT=Tournament PARTY_MODE_JUKEBOX=Jukebox PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,47 +522,32 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Next players to the mics PARTY_MODE_TOURNAMENT_WIN_DESC=Round result PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +MSG_END_JUKEBOX=Do you want leave jukebox mode? JUKEBOX_RANDOM=Random JUKEBOX_REPEAT=Repeat JUKEBOX_FIND=Find: JUKEBOX_SORT=Sort: -JUKEBOX_SONGLIST=List of Songs - -SONG_MENU_SONG=Song -SONG_MENU_MEDLEY=Medley +JUKEBOX_SONGLIST=List of songs -SONG_MENU_NAME_SONG=Song Menu -SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Add Song -SONG_MENU_DELETE_SONG=Delete Song -SONG_MENU_START_MEDLEY=Sing! -SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -SONG_MENU_NAME_SORTING=Sort Menu -SONG_MENU_SORTING_APPLY=Apply - -PARTY_PLAYLIST_MANUAL=Manual Selection +PARTY_PLAYLIST_MANUAL=Manual selection PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -SONG_MENU_OPEN_CATEGORY=Open category -SONG_MENU_CLOSE_CATEGORY=Close category -SONG_MENU_START_JUKEBOX=Start Jukebox! -SONG_MENU_NAME_JUKEBOX=Menu Jukebox WEBSITE_EXIST_SONG=The song belongs to the website: %0:s WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! -NAME_PLAYERS_COUNT=Number of Players +SING_SONGS_MYSCORES=My scores + +NAME_PLAYERS_COUNT=Number of players NAME_CURRENT_PLAYER=Player -JUKEBOX_MODE=Jukebox Mode +JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=About... ABOUT_USDX_DEVELOPEDBY=Developed by ABOUT_CHECK_CHECKING=Checking for new updates... ABOUT_CHECK_AVAILABLE=There is a new version available ABOUT_CHECK_UPTODATE=WorldParty is up to date -ABOUT_CHECK_CONNECTION=There is no Internet connection +ABOUT_CHECK_CONNECTION=There is no internet connection ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Developed by @@ -590,10 +560,10 @@ MSG_ERROR_TITLE=Error MSG_INFO_TITLE=Information MSG_QUESTION_TITLE=Question MSG_QUIT_USDX=Really leave UltraStar? -MSG_END_PARTY=Really leave Party Mode? +MSG_END_PARTY=Really leave party mode? -ERROR_NO_SONGS=No Songs loaded -ERROR_NO_PLUGINS=No Plugins loaded +ERROR_NO_SONGS=No songs loaded +ERROR_NO_PLUGINS=No plugins loaded ERROR_LOADING_SONGS=Wait for loading all the songs ERROR_CORRUPT_SONG=Song could not be loaded. ERROR_CORRUPT_SONG_FILE_NOT_FOUND=Song could not be loaded: File not found @@ -602,3 +572,120 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Song could not be loaded: Can''t find any linebreak ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Song could not be loaded: Error parsing line %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Player %d is assigned to multiple microphones. Please check your microphone options ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Player %d is not assigned to a microphone. Please check your microphone options + +;# --------------------------- +;# -- COMMON TRANSLATIONS -- +;# --------------------------- + +C_ABOUT=About... +C_ADVANCED=Advanced +C_ALL=All +C_APPLY_CHANGES=Apply changes + +C_BACK=Back +C_BOTTOM=Bottom + +C_CLASSIC=Classic +C_CHALLENGE=Challenge +C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Black +C_COLOR_BLUE=Blue +C_COLOR_BROWN=Brown +C_COLOR_CYAN=Cyan +C_COLOR_CHOCOLATE=Chocolate +C_COLOR_DARKBLUE=Dark blue +C_COLOR_FLAME=Flame +C_COLOR_GOLD=Gold +C_COLOR_GRAY=Gray +C_COLOR_GREEN=Green +C_COLOR_GREENYELLOW=Greenyellow +C_COLOR_HARLEQUIN=Harlequin +C_COLOR_LAVENDER=Lavender +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Orange +C_COLOR_ORCHID=Orchid +C_COLOR_OTHER=Other +C_COLOR_PINK=Pink +C_COLOR_PLUM=Plum +C_COLOR_RED=Red +C_COLOR_SALMON=Salmon +C_COLOR_SKY=Sky +C_COLOR_STEELBLUE=Steel blue +C_COLOR_TEAL=Teal +C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=Violet +C_COLOR_WHITE=White +C_COLOR_YELLOW=Yellow +C_CONTINUE=Continue +C_CREATEDBY=Created by + +C_DUET=Duet +C_DUETS=Duets + +C_ERROR=Error + +C_FIND=Find +C_FIXEDBY=Fixed by +C_FOLDERS=Folders + +C_GAME=Game +C_GRAPHICS=Graphics + +C_INFORMATION=Information +C_INTERNET=Internet + +C_JOKER=Joker +C_JUKEBOX=Jukebox + +C_LEGEND=Legend +C_LINE=Line +C_LYRICS=Lyrics + +C_MEDLEY=Medley +C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Microphones +C_MODE=Mode + +C_NEXT=Next +C_NO=No +C_NO_INTERNET_CONNECTION=No internet connection + +C_OPEN_PLAYLIST=Open playlist +C_OPTIONS=Options + +C_PLAYERS=Players +C_PLAYLIST=Playlist +C_PROFILES=Profiles + +C_QUIT=Quit + +C_RANDOM=Random +C_RAP=Rap +C_REFRESH_SCORES=Refresh scores +C_REPEAT=Repeat + +C_SAVE=Save +C_SEARCH_NEW_SONGS=Search for new songs +C_SELECT_THIS_SONG=Select this song +C_SEND=Send +C_SING=Sing +C_SING_MEDLEY=Sing medley +C_SONG=Song +C_SONGS=Songs +C_SORT=Sort +C_SORT_SONGS=Sort songs +C_SOUND=Sound +C_STATISTICS=Statistics +C_STATS=Stats + +C_THEME=Theme +C_THEMES=Themes +C_TOP=Top + +C_UNVALIDATED=Unvalidated + +C_VIDEO=Video + +C_WEBCAM=Webcam + +C_YES=Yes \ No newline at end of file diff --git "a/game/languages/Espa\303\261ol.ini" "b/game/languages/Espa\303\261ol.ini" index 2a432ea9..dd647d6a 100644 --- "a/game/languages/Espa\303\261ol.ini" +++ "b/game/languages/Espa\303\261ol.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Español +LANGUAGE_ISO_CODE=es SING_LOADING=Cargando... SING_LOADING_SONGS=Cargando canciones de la carpeta %s @@ -40,17 +41,6 @@ OPTION_VALUE_HARD=Difícil SING_OPTIONS=Opciones -SING_OPTIONS_GAME=Juego -SING_OPTIONS_GRAPHICS=Gráficos -SING_OPTIONS_SOUND=Sonido -SING_OPTIONS_LYRICS=Letras -SING_OPTIONS_THEMES=Apariencia -SING_OPTIONS_MICROPHONES=Micrófonos -SING_OPTIONS_ADVANCED=Avanzado -SING_OPTIONS_NETWORK=Internet -SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Atrás - SING_OPTIONS_GAME_LANGUAGE=Idioma SING_OPTIONS_GAME_SONGMENU=Menú SING_OPTIONS_GAME_DUETS=Duetos @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC=Opciones de letra JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Posición OPTION_VALUE_TO_SING=Canta -OPTION_VALUE_ACTUAL=Superior -OPTION_VALUE_NEXT=Inferior +OPTION_VALUE_TOP=Superior +OPTION_VALUE_BOTTOM=Inferior OPTION_VALUE_OTHER=Otro OPTION_VALUE_FILL=Relleno OPTION_VALUE_OUTLINE=Borde -OPTION_VALUE_BLUE=Azul -OPTION_VALUE_GREEN=Verde -OPTION_VALUE_PINK=Rosa -OPTION_VALUE_RED=Rojo -OPTION_VALUE_VIOLET=Violeta -OPTION_VALUE_ORANGE=Naranja -OPTION_VALUE_YELLOW=Amarillo -OPTION_VALUE_BROWN=Marrón -OPTION_VALUE_BLACK=Negro -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Gris -OPTION_VALUE_WHITE=Blanco -OPTION_VALUE_TURQUOISE=Turquesa -OPTION_VALUE_SALMON=Salmón -OPTION_VALUE_GREENYELLOW=Lima -OPTION_VALUE_LAVENDER=Lavanda -OPTION_VALUE_BEIGE=Beis -OPTION_VALUE_TEAL=Verde azulado -OPTION_VALUE_ORCHID=Orquídea -OPTION_VALUE_STEELBLUE=Azul Metálico -OPTION_VALUE_PLUM=Ciruela -OPTION_VALUE_CHOCOLATE=Chocolate -OPTION_VALUE_GOLD=Oro -OPTION_VALUE_DARKBLUE=Azul Marino -OPTION_VALUE_SKY=Cielo -OPTION_VALUE_HARLEQUIN=Arlequín -OPTION_VALUE_CYAN=Cian -OPTION_VALUE_FLAME=LLama + SING_LEGEND_SELECT=Seleccionar SING_LEGEND_NAVIGATE=Navegar @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Lista SING_SONG_IN_CAT=canción SING_SONGS_IN_CAT=canciones PLAYLIST_CATTEXT=Lista: %s -SING_SONG_SELECTION_LEGEND_TITLE=Leyenda -SING_SONG_SELECTION_LEGEND_VIDEO=Video -SING_SONG_SELECTION_LEGEND_MEDLEY=Versión corta -SING_SONG_SELECTION_LEGEND_MEDLEYC=Versión corta calculada -SING_SONG_SELECTION_LEGEND_DUET=Dueto SING_TOTAL=Total SING_MODE=Canta solo o acompañado @@ -319,11 +277,11 @@ SING_MENU=Menú principal SONG_SCORE=Puntuaciones SONG_SCORE_WHEREAMI=Puntuaciones -SING_SCORE_TONE_DEAF=¿Cantaste algo? -SING_SCORE_AMATEUR=Cantas fatal -SING_SCORE_WANNABE=Desafinas -SING_SCORE_HOPEFUL=Necesitas mejorar -SING_SCORE_RISING_STAR=No está mal +SING_SCORE_TONE_DEAF=Principiante +SING_SCORE_AMATEUR=Aprendiz +SING_SCORE_WANNABE=Aspirante +SING_SCORE_HOPEFUL=Corista +SING_SCORE_RISING_STAR=Solista SING_SCORE_LEAD_SINGER=Cantante SING_SCORE_SUPERSTAR=Super cantante SING_SCORE_ULTRASTAR=Toda una estrella @@ -348,7 +306,6 @@ IMPLODE_GLUE2= y SONG_MENU_NAME_MAIN=Menú canciones SONG_MENU_PLAY=Cantar esta canción SONG_MENU_CHANGEPLAYERS=Elegir jugadores -SONG_MENU_CANCEL=Cancelar SONG_MENU_NAME_PLAYLIST=Menú canciones SONG_MENU_PLAYLIST_ADD=Agregar canción @@ -357,7 +314,7 @@ SONG_MENU_PLAYLIST_DEL=Borrar canción SONG_MENU_NAME_PLAYLIST_ADD=Agregar canción SONG_MENU_PLAYLIST_ADD_NEW=A una lista nueva SONG_MENU_PLAYLIST_ADD_EXISTING=A una lista existente -SONG_MENU_PLAYLIST_NOEXISTING=No hay listas +SONG_MENU_PLAYLIST_NOEXISTING=No hay listas creadas SONG_MENU_NAME_PLAYLIST_NEW=Nueva lista de canciones SONG_MENU_PLAYLIST_NEW_CREATE=Crear @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Gastar comodín SONG_MENU_NAME_PARTY_JOKER=Gastar comodín -SONG_JUMPTO_DESC=Buscar canción -SONG_JUMPTO_TYPE_DESC=Buscar por: +SONG_MENU_LEGEND_TITLE=Leyenda +SONG_MENU_LEGEND_VIDEO=Video +SONG_MENU_LEGEND_MEDLEY=Versión corta +SONG_MENU_LEGEND_MEDLEYC=Versión corta calculada +SONG_MENU_LEGEND_DUET=Dueto +SONG_MENU_LEGEND_RAP=Rap +SONG_MENU_LEGEND_CREATEDBY=Creada por +SONG_MENU_LEGEND_FIXEDBY=Reparada por +SONG_MENU_LEGEND_UNVALIDATED=No validada + +SONG_MENU_SONG=Canción +SONG_MENU_MEDLEY=Versión corta + +SONG_MENU_NAME_SONG=Menu Canción +SONG_MENU_NAME_MEDLEY=Versión corta +SONG_MENU_ADD_SONG=Añadir canción +SONG_MENU_ADD_SONG_TO_LIST=Añadir canción a la lista +SONG_MENU_DELETE_SONG=Eliminar canción +SONG_MENU_START_MEDLEY=Cantar +SONG_MENU_START_5_MEDLEY=Cantar %0:d canciones al azar + +SONG_MENU_NAME_SORTING=Menu ordenar +SONG_MENU_SORTING_APPLY=Aplicar + +SONG_MENU_OPEN_CATEGORY=Abrir categoria +SONG_MENU_CLOSE_CATEGORY=Cerrar categoria +SONG_MENU_START_JUKEBOX=¡Iniciar Jukebox! +SONG_MENU_NAME_JUKEBOX=Menú Jukebox + +SONG_SEARCH_DESC=¿Qué quieres cantar ahora? PARTY_MODE=Modo fiesta PARTY_DIFFICULTY=Dificultad @@ -469,20 +454,20 @@ MODE_BLIND_DESC=Duelo sin ver las notas. MODE_BLINDTOTAL_NAME=Todo a ciegas MODE_BLINDTOTAL_DESC=Duelo con notas y letras ocultas -MODE_1000BLIND_NAME = +1000 Ciego -MODE_1000BLIND_DESC = Si vas ganando por más de 1000 puntos, no verás las notas +MODE_1000BLIND_NAME= +1000 Ciego +MODE_1000BLIND_DESC= Si vas ganando por más de 1000 puntos, no verás las notas -MODE_DEAF_NAME = Sordo -MODE_DEAF_DESC = Atrévete a cantar sin música +MODE_DEAF_NAME= Sordo +MODE_DEAF_DESC= Atrévete a cantar sin música -MODE_BLINDLYRICS_NAME = Sin letra -MODE_BLINDLYRICS_DESC = Para aquellos que se saben la letra de memoria. +MODE_BLINDLYRICS_NAME= Sin letra +MODE_BLINDLYRICS_DESC= Para aquellos que se saben la letra de memoria. -MODE_500BLIND_NAME = +500 Ciego -MODE_500BLIND_DESC = Si vas ganando por más de 500 puntos, no verás las notas +MODE_500BLIND_NAME= +500 Ciego +MODE_500BLIND_DESC= Si vas ganando por más de 500 puntos, no verás las notas -MODE_SHORTSONG_NAME = Canción corta -MODE_SHORTSONG_DESC = Duelo hasta la mitad de la canción +MODE_SHORTSONG_NAME= Canción corta +MODE_SHORTSONG_DESC= Duelo hasta la mitad de la canción MODE_HARDCORE_NAME=Extremo MODE_HARDCORE_DESC=Gana quien consiga 3 líneas de ventaja @@ -544,29 +529,14 @@ JUKEBOX_FIND=Buscar: JUKEBOX_SORT=Ordenar: JUKEBOX_SONGLIST=Lista de canciones -SONG_MENU_SONG=Canción -SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Menu Canción -SONG_MENU_NAME_MEDLEY=Menu Medley -SONG_MENU_ADD_SONG=Añadir canción -SONG_MENU_DELETE_SONG=Eliminar canción -SONG_MENU_START_MEDLEY=Cantar -SONG_MENU_START_5_MEDLEY=Cantar %0:d canciones - -SONG_MENU_NAME_SORTING=Menu ordenar -SONG_MENU_SORTING_APPLY=Aplicar - PARTY_PLAYLIST_MANUAL=Seleción manual PARTY_MODE_JUKEBOX_NO_SONGS=La lista de canciones está vacía -SONG_MENU_OPEN_CATEGORY=Abrir categoria -SONG_MENU_CLOSE_CATEGORY=Cerrar categoria -SONG_MENU_START_JUKEBOX=¡Iniciar Jukebox! -SONG_MENU_NAME_JUKEBOX=Menú Jukebox -WEBSITE_EXIST_SONG=La cancion pertenece al sitio: %0:s +WEBSITE_EXIST_SONG=La canción pertenece al sitio: %0:s WEBSITE_NOT_EXIST_SONG=La canción no pertenece a ningún sitio +SING_SONGS_MYSCORES=Mis puntuaciones + NAME_PLAYERS_COUNT=Número de jugadores NAME_CURRENT_PLAYER=Jugador @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Imposible cargar la canción: No se encuentran inte ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Imposible cargar la canción: Error durante el parsing de la línea %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Se han asignado más de 1 micrófono al jugador %d. Comprueba las opciones de micrófonos. ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Al jugador %d no se le ha asignado ningún micrófono. Comprueba las opciones de micrófonos + +;COMMON TRANSLATIONS: + +C_ABOUT=Acerca de... +C_ADVANCED=Avanzado +C_ALL=Todo +C_APPLY_CHANGES=Aplicar cambios + +C_BACK=Atrás +C_BOTTOM=Inferior + +C_CLASSIC=Clásico +C_CHALLENGE=Reto +C_COLOR_BEIGE=Beis +C_COLOR_BLACK=Negro +C_COLOR_BLUE=Azul +C_COLOR_BROWN=Marrón +C_COLOR_CYAN=Cian +C_COLOR_CHOCOLATE=Chocolate +C_COLOR_DARKBLUE=Azul +C_COLOR_FLAME=LLama +C_COLOR_GOLD=Oro +C_COLOR_GRAY=Gris +C_COLOR_GREEN=Verde +C_COLOR_GREENYELLOW=Lima +C_COLOR_HARLEQUIN=Arlequín +C_COLOR_LAVENDER=Lavanda +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Naranja +C_COLOR_ORCHID=Orquídea +C_COLOR_OTHER=Otro +C_COLOR_PINK=Rosa +C_COLOR_PLUM=Ciruela +C_COLOR_RED=Rojo +C_COLOR_SALMON=Salmón +C_COLOR_SKY=Cielo +C_COLOR_STEELBLUE=Azul metálico +C_COLOR_TEAL=Verde Azulado +C_COLOR_TURQUOISE=Turquesa +C_COLOR_VIOLET=Violeta +C_COLOR_WHITE=Blanco +C_COLOR_YELLOW=Amarillo +C_CONTINUE=Continuar +C_CREATEDBY=Creado por + +C_DUET=Dueto +C_DUETS=Duetos + +C_ERROR=Error + +C_FIND=Buscar +C_FIXEDBY=Reparado por +C_FOLDERS=Carpetas + +C_GAME=Juego +C_GRAPHICS=Gráficos + +C_INFORMATION=Información +C_INTERNET=Internet + +C_JOKER=Comodín +C_JUKEBOX=Reproductor de canciones + +C_LEGEND=Leyenda +C_LINE=Línea +C_LYRICS=Letras + +C_MEDLEY=Versión corta +C_MEDLEYC=Versión corta calculada +C_MICROPHONES=Micrófonos +C_MODE=Modo + +C_NEXT=Siguiente +C_NO=No +C_NO_INTERNET_CONNECTION=Sin conexión a internet + +C_OPEN_PLAYLIST=Abrir lista de reproducción +C_OPTIONS=Opciones + +C_PLAYERS=Jugadores +C_PLAYLIST=Lista de reproducción +C_PROFILES=Perfiles + +C_QUIT=Salir + +C_RANDOM=Aleatorio +C_RAP=Rap +C_REFRESH_SCORES=Actualizar puntuaciones +C_REPEAT=Repetir + +C_SAVE=Guardar +C_SEARCH_NEW_SONGS=Buscar canciones nuevas +C_SELECT_THIS_SONG=Seleccionar esta canción +C_SEND=Enviar +C_SING=Cantar +C_SING_MEDLEY=Cantar versión corta +C_SONG=Canción +C_SONGS=Canciones +C_SORT=Ordenar +C_SORT_SONGS=Ordenar canciones +C_SOUND=Sonido +C_STATISTICS=Estadísticas +C_STATS=Estadísticas + +C_THEME=Tema +C_THEMES=Apariencia +C_TOP=Superior + +C_UNVALIDATED=No validada + +C_VIDEO=Video + +C_WEBCAM=Webcam + +C_YES=Sí \ No newline at end of file diff --git a/game/languages/Euskara.ini b/game/languages/Euskara.ini index 36c22ed3..cf3607a0 100644 --- a/game/languages/Euskara.ini +++ b/game/languages/Euskara.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Euskara +LANGUAGE_ISO_CODE=eu SING_LOADING=Kargatzen... ;TODO: SING_LOADING_SONGS=Loading songs from folder %s @@ -40,29 +41,18 @@ OPTION_VALUE_HARD=Zaila SING_OPTIONS=Hobespenak -SING_OPTIONS_GAME=Jokoa -SING_OPTIONS_GRAPHICS=Grafikoak -SING_OPTIONS_SOUND=Soinua -SING_OPTIONS_LYRICS=Letrak -SING_OPTIONS_THEMES=Gaiak -SING_OPTIONS_MICROPHONES=Grabazioa -SING_OPTIONS_ADVANCED=Aurreratuak -;TODO: SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Itzuli - SING_OPTIONS_GAME_LANGUAGE=Hizkuntza SING_OPTIONS_GAME_SONGMENU=Menua ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Etiketak SING_OPTIONS_GAME_SORTING=Sailkapena -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores -;TODO: SING_OPTIONS_GAME_JOYPAD_SUPPORT=Controller support +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores +;TODO: SING_OPTIONS_GAME_JOYPAD_SUPPORT=Activate gamepad ;TODO: OPTION_VALUE_ROULETTE=Roulette ;TODO: OPTION_VALUE_CHESSBOARD=Chessboard ;TODO: OPTION_VALUE_CAROUSEL=Carousel -;TODO: OPTION_VALUE_SLOT_MACHINE=Slot Machine +;TODO: OPTION_VALUE_SLOT_MACHINE=Slot machine ;TODO: OPTION_VALUE_LIST=List ;TODO: OPTION_VALUE_MOSAIC=Tile @@ -80,19 +70,19 @@ OPTION_VALUE_ARTIST2=2.artista ;TODO: OPTION_VALUE_DECADE=Decade OPTION_VALUE_PLAYLIST=Zerrenda -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Pantaila osoa SING_OPTIONS_GRAPHICS_RESOLUTION=Erresoluzioa -;TODO: SING_OPTIONS_GRAPHICS_SCREENFADE=Screen Fading -;TODO: SING_OPTIONS_GRAPHICS_EFFECTSING=Sing Effects +;TODO: SING_OPTIONS_GRAPHICS_SCREENFADE=Screen fading +;TODO: SING_OPTIONS_GRAPHICS_EFFECTSING=Sing effects SING_OPTIONS_GRAPHICS_VISUALIZER=Bistaratzeak SING_OPTIONS_GRAPHICS_MOVIE_SIZE=Bideo tamaina ;TODO: OPTION_VALUE_BORDERLESS=Borderless OPTION_VALUE_WHENNOVIDEO=Bideorik ez badago -;TODO: OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No Video and Image +;TODO: OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No video and image OPTION_VALUE_HALF=Erdia OPTION_VALUE_FULL_VID=Osoa (Bideoa) @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Mikrofono playback-a SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Atzeko soinua SING_OPTIONS_SOUND_CLICK_ASSIST=Noten laguntza SING_OPTIONS_SOUND_BEAT_CLICK=Kolpeen laguntza -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Bolumena aurreikusi SING_OPTIONS_SOUND_PREVIEWFADING=Desagerpena aurreikusi @@ -118,9 +108,9 @@ SING_OPTIONS_LYRICS_FONT=Letra-mota SING_OPTIONS_LYRICS_EFFECT=Efektua SING_OPTIONS_LYRICS_NOTELINES=Pentagramak -;TODO: OPTION_VALUE_PLAIN=stylized -;TODO: OPTION_VALUE_OLINE1=with thin edge -;TODO: OPTION_VALUE_OLINE2=with thick edge +;TODO: OPTION_VALUE_PLAIN=Stylized +;TODO: OPTION_VALUE_OLINE1=With thin edge +;TODO: OPTION_VALUE_OLINE2=With thick edge OPTION_VALUE_SIMPLE=Arrunta OPTION_VALUE_ZOOM=Zoom-a @@ -140,11 +130,11 @@ SING_OPTIONS_MICROPHONES_MIC_BOOST=Mikrofonoa indartu ;TODO: SING_OPTIONS_ADVANCED_DEBUG=Debug ;TODO: SING_OPTIONS_ADVANCED_OSCILLOSCOPE=Oscilloscope -SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Ziurtasun galderak SING_OPTIONS_ADVANCED_ONSONGCLICK=Aukeratu ondoren +SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Ziurtasun galderak SING_OPTIONS_ADVANCED_PARTYPOPUP=Talde menu auto ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Guztia ;TODO: OPTION_VALUE_PLAYER=Player @@ -153,12 +143,12 @@ OPTION_VALUE_ALL=Guztia ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website ;TODO: SING_OPTIONS_NETWORK_USERNAME=Username ;TODO: SING_OPTIONS_NETWORK_PASSWORD=Password -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name SING_OPTIONS_NETWORK_AUTO_MODE=Automatikoa ;TODO: SING_OPTIONS_NETWORK_AUTO_PLAYER=Player -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Itzuli ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Itzuli ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send ;TODO: SCORE_SEND_PLAYER=Player -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Itzuli ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_RESOLUTION=Erresoluzioa SING_OPTIONS_WEBCAM_EFFECT=Efektua ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Arintzea ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Urdina ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Abestu -;TODO: OPTION_VALUE_ACTUAL=Actual -;TODO: OPTION_VALUE_NEXT=Next +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Urdina -OPTION_VALUE_GREEN=Berdea -OPTION_VALUE_PINK=Arrosa -OPTION_VALUE_RED=Gorria -OPTION_VALUE_VIOLET=Morea -OPTION_VALUE_ORANGE=Laranja -OPTION_VALUE_YELLOW=Horia -OPTION_VALUE_BROWN=Marroia -OPTION_VALUE_BLACK=Beltza -OPTION_VALUE_MAGENTA=Magenta -;TODO: OPTION_VALUE_GRAY=Gray -;TODO: OPTION_VALUE_WHITE=White -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Hautatu SING_LEGEND_NAVIGATE=Nabigatu @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Zerrenda ;TODO: SING_SONG_IN_CAT=Song SING_SONGS_IN_CAT=Abestiak PLAYLIST_CATTEXT=Zerrenda: %s -;TODO: SING_SONG_SELECTION_LEGEND_TITLE=Legend -;TODO: SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -;TODO: SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Guztira SING_MODE=Bakarka abestu @@ -348,7 +306,6 @@ IMPLODE_GLUE2= eta SONG_MENU_NAME_MAIN=Menua SONG_MENU_PLAY=Abestu SONG_MENU_CHANGEPLAYERS=Jokalariak aukeratu -SONG_MENU_CANCEL=Itzuli SONG_MENU_NAME_PLAYLIST=Menua SONG_MENU_PLAYLIST_ADD=Zerrendara gehitu @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Komodina SONG_MENU_NAME_PARTY_JOKER=Komodina erabili -SONG_JUMPTO_DESC=Bilatu -SONG_JUMPTO_TYPE_DESC=Bilatu: +;TODO: SONG_MENU_LEGEND_TITLE=Legend +;TODO: SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +;TODO: SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Menua +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Abestia gehitu +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Zerrendatik ezabatu +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Taldean Abestu PARTY_DIFFICULTY=Zailtasuna @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx aldiz abestuta ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Erronda kopurua ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,47 +522,32 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Hurrengoa mikrofonora ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley +;TODO: JUKEBOX_SONGLIST=List of songs -SONG_MENU_NAME_SONG=Menua -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Abestia gehitu -SONG_MENU_DELETE_SONG=Zerrendatik ezabatu -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! -;TODO: NAME_PLAYERS_COUNT=Number of Players +;TODO: SING_SONGS_MYSCORES=My scores + +;TODO: NAME_PLAYERS_COUNT=Number of players ;TODO: NAME_CURRENT_PLAYER=Player -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ;TODO: ABOUT_MAIN=About... ;TODO: ABOUT_USDX_DEVELOPEDBY=Developed by ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org ;TODO: DEVELOPERS_TITLE=Developed by @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Ezin da abestia kargatu: Ez daude lerro jauziak ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Ezin da abestia kargatu: Okerra %0:d lerroan ERROR_PLAYER_DEVICE_ASSIGNMENT= %d.jokalariak mikrofono bat baino gehiago aukeratuta ditu . Egiaztatu mikrofonoaren aukerak ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Player %d is not assigned to a microphones. Egiaztatu mikrofonoaren aukerak + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Aurreratuak +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Itzuli +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Beltza +C_COLOR_BLUE=Urdina +C_COLOR_BROWN=Marroia +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +;TODO: C_COLOR_GRAY=Gray +C_COLOR_GREEN=Berdea +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Laranja +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Arrosa +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Gorria +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=Morea +;TODO: C_COLOR_WHITE=White +C_COLOR_YELLOW=Horia +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Jokoa +C_GRAPHICS=Grafikoak + +;TODO: C_INFORMATION=Information +;TODO: C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Letrak + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Grabazioa +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Soinua +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Gaiak +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/Fran\303\247ais.ini" "b/game/languages/Fran\303\247ais.ini" index 3854815d..89daa07f 100644 --- "a/game/languages/Fran\303\247ais.ini" +++ "b/game/languages/Fran\303\247ais.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Français +LANGUAGE_ISO_CODE=fr SING_LOADING=Chargement... SING_LOADING_SONGS=Chargement des chansons à partir du dossier %s @@ -40,17 +41,6 @@ OPTION_VALUE_HARD=Difficile SING_OPTIONS=Options -SING_OPTIONS_GAME=Jeu -SING_OPTIONS_GRAPHICS=Graphismes -SING_OPTIONS_SOUND=Audio -SING_OPTIONS_LYRICS=Paroles -SING_OPTIONS_THEMES=Thèmes -SING_OPTIONS_MICROPHONES=Micros -SING_OPTIONS_ADVANCED=Avancé -SING_OPTIONS_NETWORK=Internet -SING_OPTIONS_WEBCAM=Caméra -SING_OPTIONS_EXIT=Retour - SING_OPTIONS_GAME_LANGUAGE=Langue SING_OPTIONS_GAME_SONGMENU=Menu SING_OPTIONS_GAME_DUETS=Duos @@ -143,8 +133,8 @@ SING_OPTIONS_ADVANCED_OSCILLOSCOPE=Oscilloscope SING_OPTIONS_ADVANCED_ONSONGCLICK=Choix ap. chanson SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Demander avant de quitter SING_OPTIONS_ADVANCED_PARTYPOPUP=Menu fête auto -SING_OPTIONS_ADVANCED_SINGSCORES=Scores sur le chant SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores +SING_OPTIONS_ADVANCED_SINGSCORES=Scores sur le chant OPTION_VALUE_ALL=Tout OPTION_VALUE_PLAYER=Joueur @@ -203,7 +193,6 @@ SONG_MENU_REFRESH_SCORES_REFRESH=Mettre à jour SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Erreur de connexion au site : %0:s! SONG_MENU_REFRESH_SCORES_ERROR_FILE=Fichier absent : '%0:s [Téléchargement des scores]'! - SONG_SCORE_MAX=Meilleur : SONG_SCORE_MEDIA=Moyenne : @@ -258,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC=Options des paroles JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Chantée -OPTION_VALUE_ACTUAL=Supérieure -OPTION_VALUE_NEXT=Inférieure +OPTION_VALUE_TOP=Supérieure +OPTION_VALUE_BOTTOM=Inférieure OPTION_VALUE_OTHER=Autre OPTION_VALUE_FILL=Rempli OPTION_VALUE_OUTLINE=Bord -OPTION_VALUE_BLUE=Bleu -OPTION_VALUE_GREEN=Vert -OPTION_VALUE_PINK=Rose -OPTION_VALUE_RED=Rouge -OPTION_VALUE_VIOLET=Violet -OPTION_VALUE_ORANGE=Orange -OPTION_VALUE_YELLOW=Jaune -OPTION_VALUE_BROWN=Marron -OPTION_VALUE_BLACK=Noir -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Gris -OPTION_VALUE_WHITE=Blanc -OPTION_VALUE_TURQUOISE=Turquoise -OPTION_VALUE_SALMON=Saumon -OPTION_VALUE_GREENYELLOW=Vert pomme -OPTION_VALUE_LAVENDER=Lavande -OPTION_VALUE_BEIGE=Beige -OPTION_VALUE_TEAL=Vert canard -OPTION_VALUE_ORCHID=Rose orchidée -OPTION_VALUE_STEELBLUE=Bleu acier -OPTION_VALUE_PLUM=Prune -OPTION_VALUE_CHOCOLATE=Chocolat -OPTION_VALUE_GOLD=Doré -OPTION_VALUE_DARKBLUE=Bleu foncé -OPTION_VALUE_SKY=Bleu ciel -OPTION_VALUE_HARLEQUIN=Vert fluo -OPTION_VALUE_CYAN=Cyan -OPTION_VALUE_FLAME=Flamme + SING_LEGEND_SELECT=Valider SING_LEGEND_NAVIGATE=Naviguer @@ -303,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Playlist SING_SONG_IN_CAT=Chanson SING_SONGS_IN_CAT=Chansons PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Légende -SING_SONG_SELECTION_LEGEND_VIDEO=Vidéo -SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculé -SING_SONG_SELECTION_LEGEND_DUET=Duo SING_TOTAL=Total SING_MODE=Mode chanter @@ -349,7 +306,6 @@ IMPLODE_GLUE2= et SONG_MENU_NAME_MAIN=Menu SONG_MENU_PLAY=Chanter SONG_MENU_CHANGEPLAYERS=Changer de joueurs -SONG_MENU_CANCEL=Annuler SONG_MENU_NAME_PLAYLIST=Menu SONG_MENU_PLAYLIST_ADD=Ajouter la chanson @@ -379,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Utiliser Joker -SONG_JUMPTO_DESC=Rechercher -SONG_JUMPTO_TYPE_DESC=Recherche : +SONG_MENU_LEGEND_TITLE=Légende +SONG_MENU_LEGEND_VIDEO=Vidéo +SONG_MENU_LEGEND_MEDLEY=Medley +SONG_MENU_LEGEND_MEDLEYC=Medley calculé +SONG_MENU_LEGEND_DUET=Duo +SONG_MENU_LEGEND_RAP=Rap +SONG_MENU_LEGEND_CREATEDBY=Créée par +SONG_MENU_LEGEND_FIXEDBY=Réparée par +SONG_MENU_LEGEND_UNVALIDATED=Non validé + +SONG_MENU_SONG=Chanson +SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Menu +SONG_MENU_NAME_MEDLEY=Menu des Medley +SONG_MENU_ADD_SONG=Ajouter la chanson +SONG_MENU_ADD_SONG_TO_LIST=Ajouter chanson à la liste +SONG_MENU_DELETE_SONG=Supprimer la chanson +SONG_MENU_START_MEDLEY=Chantez ! +SONG_MENU_START_5_MEDLEY=Chantez %0:d chansons ! + +SONG_MENU_NAME_SORTING=Trier... +SONG_MENU_SORTING_APPLY=Appliquer + +SONG_MENU_OPEN_CATEGORY=Ouvrir la catégorie +SONG_MENU_CLOSE_CATEGORY=Fermer la catégorie +SONG_MENU_START_JUKEBOX=Démarrez le Jukebox ! +SONG_MENU_NAME_JUKEBOX=Menu Jukebox + +SONG_SEARCH_DESC=Que voulez-vous chanter maintenant? PARTY_MODE=Mode fête PARTY_DIFFICULTY=Difficulté @@ -470,20 +454,20 @@ MODE_BLIND_DESC=un duel à un contre un, mais sans les notes ! MODE_BLINDTOTAL_NAME=Noir total ! MODE_BLINDTOTAL_DESC=Un duel sans notes ni paroles. Seulement pour les courageux ! -MODE_1000BLIND_NAME = +1000 à l'aveugle -MODE_1000BLIND_DESC = Gagnez 1000 points de plus, mais sans voir les notes ! +MODE_1000BLIND_NAME= +1000 à l'aveugle +MODE_1000BLIND_DESC= Gagnez 1000 points de plus, mais sans voir les notes ! -MODE_DEAF_NAME = Silencieux -MODE_DEAF_DESC = Vou pensez connaitre la mélodie ? Pouvez vous chantez sans l'accompagnement ? +MODE_DEAF_NAME= Silencieux +MODE_DEAF_DESC= Vou pensez connaitre la mélodie ? Pouvez vous chantez sans l'accompagnement ? -MODE_BLINDLYRICS_NAME = Sans paroles -MODE_BLINDLYRICS_DESC = Vous connaissez les paroles ? Chantez sans les voir ! +MODE_BLINDLYRICS_NAME= Sans paroles +MODE_BLINDLYRICS_DESC= Vous connaissez les paroles ? Chantez sans les voir ! -MODE_500BLIND_NAME = +500 à l'aveugle -MODE_500BLIND_DESC = Gagnez 500 points de plus, mais sans voir les notes ! +MODE_500BLIND_NAME= +500 à l'aveugle +MODE_500BLIND_DESC= Gagnez 500 points de plus, mais sans voir les notes ! -MODE_SHORTSONG_NAME = Chanson raccourcie -MODE_SHORTSONG_DESC = Un duel rapide sur la moitié d'une chanson ! +MODE_SHORTSONG_NAME= Chanson raccourcie +MODE_SHORTSONG_DESC= Un duel rapide sur la moitié d'une chanson ! MODE_HARDCORE_NAME=Hardcore MODE_HARDCORE_DESC=Gagnez trois lignes d'avance sur votre adversaire ! @@ -545,29 +529,14 @@ JUKEBOX_FIND=Rechercher: JUKEBOX_SORT=Trier: JUKEBOX_SONGLIST=Liste de chansons -SONG_MENU_SONG=Chanson -SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Menu -SONG_MENU_NAME_MEDLEY=Menu des Medley -SONG_MENU_ADD_SONG=Ajouter la chanson -SONG_MENU_DELETE_SONG=Supprimer la chanson -SONG_MENU_START_MEDLEY=Chantez ! -SONG_MENU_START_5_MEDLEY=Chantez %0:d chansons ! - -SONG_MENU_NAME_SORTING=Trier... -SONG_MENU_SORTING_APPLY=Appliquer - PARTY_PLAYLIST_MANUAL=Sélection manuelle PARTY_MODE_JUKEBOX_NO_SONGS=La playlist est vide ! -SONG_MENU_OPEN_CATEGORY=Ouvrir la catégorie -SONG_MENU_CLOSE_CATEGORY=Fermer la catégorie -SONG_MENU_START_JUKEBOX=Démarrez le Jukebox ! -SONG_MENU_NAME_JUKEBOX=Menu Jukebox WEBSITE_EXIST_SONG=La chanson appartient au site : %0:s WEBSITE_NOT_EXIST_SONG=La chanson n'appartient à aucun site ! +SING_SONGS_MYSCORES=Mes scores + NAME_PLAYERS_COUNT=Nombre de joueurs NAME_CURRENT_PLAYER=Joueur @@ -603,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Chargement impossible : Saut de ligne introuvable ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Chargement impossible : Erreur analyseur à la ligne %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Plusieurs micros sont attribués au joueur %d. Merci de vérifier vos options de microphone ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Aucun micro n'est attribué au joueur %d. Merci de vérifier vos options de microphone + +;COMMON TRANSLATIONS: + +C_ABOUT=À propos de... +C_ADVANCED=Avancé +C_ALL=Tout +C_APPLY_CHANGES=Appliquer les modifications + +C_BACK=Retour +C_BOTTOM=Inferiéur + +C_CLASSIC=Classique +C_CHALLENGE=Challenge +C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Noir +C_COLOR_BLUE=Bleu acier +C_COLOR_BROWN=Marron +C_COLOR_CYAN=Cyan +C_COLOR_CHOCOLATE=Chocolat +C_COLOR_DARKBLUE=Bleu foncé +C_COLOR_FLAME=Flamme +C_COLOR_GOLD=Doré +C_COLOR_GRAY=Gris +C_COLOR_GREEN=Vert +C_COLOR_GREENYELLOW=Vert pomme +C_COLOR_HARLEQUIN=Vert fluo +C_COLOR_LAVENDER=Lavande +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Orange +C_COLOR_ORCHID=Rose orchidée +C_COLOR_OTHER=Autre +C_COLOR_PINK=Rose +C_COLOR_PLUM=Prune +C_COLOR_RED=Rouge +C_COLOR_SALMON=Saumon +C_COLOR_SKY=Bleu ciel +C_COLOR_STEELBLUE=Steel blue +C_COLOR_TEAL=Vert canard +C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=Violet +C_COLOR_WHITE=Blanc +C_COLOR_YELLOW=Jaune +C_CONTINUE=Continuer +C_CREATEDBY=Créée par + +C_DUET=Duo +C_DUETS=Duos + +C_ERROR=Erreur + +C_FIND=Rechercher +C_FIXEDBY=Réparée par +C_FOLDERS=Dossiers + +C_GAME=Jeu +C_GRAPHICS=Graphismes + +C_INFORMATION=Information +C_INTERNET=Internet + +C_JOKER=Joker +C_JUKEBOX=Jukebox + +C_LEGEND=Légende +C_LINE=Ligne +C_LYRICS=Paroles + +C_MEDLEY=Version courte +C_MEDLEYC=Version courte calculé +C_MICROPHONES=Micros +C_MODE=Mode + +C_NEXT=Suivant +C_NO=No +C_NO_INTERNET_CONNECTION=Pas de connexion Internet + +C_OPEN_PLAYLIST=Ouvrir playlist +C_OPTIONS=Options + +C_PLAYERS=Joueurs +C_PLAYLIST=Playlist +C_PROFILES=Profils + +C_QUIT=Sortir + +C_RANDOM=Aléatoire +C_RAP=Rap +C_REFRESH_SCORES=Mettre à jour les scores +C_REPEAT=Répéter + +C_SAVE=Enregistrer +C_SEARCH_NEW_SONGS=Rechercher de nouvelles chansons +C_SELECT_THIS_SONG=Sélectionnez cette chanson +C_SEND=Envoyer +C_SING=Chanter +C_SING_MEDLEY=Chanter version courte +C_SONG=Chanson +C_SONGS=Chansons +C_SORT=Trier +C_SORT_SONGS=Trier les chansons +C_SOUND=Audio +;TODO: C_STATISTICS=Statistics +C_STATS=Statistiques + +C_THEME=Thème +C_THEMES=Thèmes +C_TOP=Supérieurer + +C_UNVALIDATED=Non validé + +C_VIDEO=Vidéo + +C_WEBCAM=Caméra + +C_YES=Oui \ No newline at end of file diff --git a/game/languages/Galego.ini b/game/languages/Galego.ini index 8db34a1f..8b31a8ce 100644 --- a/game/languages/Galego.ini +++ b/game/languages/Galego.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Galego +LANGUAGE_ISO_CODE=gl SING_LOADING=Cargando... SING_LOADING_SONGS=Cargando cancións do cartafol %s @@ -40,17 +41,6 @@ OPTION_VALUE_HARD=Difícil SING_OPTIONS=Opcións -SING_OPTIONS_GAME=Xogo -SING_OPTIONS_GRAPHICS=Gráficos -SING_OPTIONS_SOUND=Son -SING_OPTIONS_LYRICS=Letras -SING_OPTIONS_THEMES=Aparencia -SING_OPTIONS_MICROPHONES=Micrófonos -SING_OPTIONS_ADVANCED=Avanzado -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Volta - SING_OPTIONS_GAME_LANGUAGE=Idioma SING_OPTIONS_GAME_SONGMENU=Menú cancións SING_OPTIONS_GAME_DUETS=Duetos @@ -63,7 +53,7 @@ OPTION_VALUE_ROULETTE=Roleta OPTION_VALUE_CHESSBOARD=Tabuleiro de xadrez OPTION_VALUE_CAROUSEL=Carrusel OPTION_VALUE_SLOT_MACHINE=Máquina tragamonedas - OPTION_VALUE_LIST=Lista +OPTION_VALUE_LIST=Lista ;TODO: OPTION_VALUE_MOSAIC=Tile OPTION_VALUE_ON=Si @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Escoitar o micrófono SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Música de fondo SING_OPTIONS_SOUND_CLICK_ASSIST=Axuda de notas SING_OPTIONS_SOUND_BEAT_CLICK=Clic en compases -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Volume do adianto SING_OPTIONS_SOUND_PREVIEWFADING=Desvanecemento @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Ó seleccionar canción SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Preguntar ó borrar SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto menú de festa ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Todo OPTION_VALUE_PLAYER=Xogador @@ -159,7 +149,7 @@ SING_OPTIONS_NETWORK_AUTO_PLAYER=Xogador SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Puntuación (Fácil) SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Puntuación (Medio) SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Puntuación (Difícil) -SING_OPTIONS_NETWORK_NO_DLL=Non hai DLL's Web compatibles con Ultrastar Deluxe... +SING_OPTIONS_NETWORK_NO_DLL=Non hai DLL's Web compatibles con UltraStar WorldParty... SING_OPTIONS_NETWORK_DELETE_PLAYER=De verdad queres suprimir o usuario %0:s da web de %1:s? SING_OPTIONS_NETWORK_LEGEND_INSERT=Engadir SING_OPTIONS_NETWORK_LEGEND_DELETE=Suprimir @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_RESOLUTION=Resolución SING_OPTIONS_WEBCAM_EFFECT=Efecto ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Umbral do micro. ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Azul ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Cantar -OPTION_VALUE_ACTUAL=Superior -OPTION_VALUE_NEXT=Inferior +OPTION_VALUE_TOP=Superior +OPTION_VALUE_BOTTOM=Inferior OPTION_VALUE_OTHER=Outro ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Azul -OPTION_VALUE_GREEN=Verde -OPTION_VALUE_PINK=Rosado -OPTION_VALUE_RED=Vermello -OPTION_VALUE_VIOLET=Violeta -OPTION_VALUE_ORANGE=Laranxa -OPTION_VALUE_YELLOW=Amarelo -OPTION_VALUE_BROWN=Marrón -OPTION_VALUE_BLACK=Negro -;TODO: OPTION_VALUE_MAGENTA=Magenta -;TODO: OPTION_VALUE_GRAY=Gray -;TODO: OPTION_VALUE_WHITE=White -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Seleccionar SING_LEGEND_NAVIGATE=Navegar @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Listaxe SING_SONG_IN_CAT=Canción SING_SONGS_IN_CAT=Cancións PLAYLIST_CATTEXT=Listaxe: %s -SING_SONG_SELECTION_LEGEND_TITLE=Lenda -SING_SONG_SELECTION_LEGEND_VIDEO=Vídeo -SING_SONG_SELECTION_LEGEND_MEDLEY=Versión curta -SING_SONG_SELECTION_LEGEND_MEDLEYC=Versión curta calculada -SING_SONG_SELECTION_LEGEND_DUET=Dueto SING_TOTAL=Total SING_MODE=Só @@ -348,7 +306,6 @@ IMPLODE_GLUE2= e SONG_MENU_NAME_MAIN=Menú cancións SONG_MENU_PLAY=Cantar SONG_MENU_CHANGEPLAYERS=Elixir xogadores -SONG_MENU_CANCEL=Anular SONG_MENU_NAME_PLAYLIST=Menú cancións SONG_MENU_PLAYLIST_ADD=Engadir canción @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Aleatorio SONG_MENU_NAME_PARTY_JOKER=Aleatorio -SONG_JUMPTO_DESC=Procurar canción -SONG_JUMPTO_TYPE_DESC=Procurar por: +SONG_MENU_LEGEND_TITLE=Lenda +SONG_MENU_LEGEND_VIDEO=Vídeo +SONG_MENU_LEGEND_MEDLEY=Versión curta +SONG_MENU_LEGEND_MEDLEYC=Versión curta calculada +SONG_MENU_LEGEND_DUET=Dueto +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Canción +SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Menu Canción +SONG_MENU_NAME_MEDLEY=Menu Medley +SONG_MENU_ADD_SONG=Engadir canción +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Eliminar canción +SONG_MENU_START_MEDLEY=Cantar! +SONG_MENU_START_5_MEDLEY=Cantar %0:d cancións! + +SONG_MENU_NAME_SORTING=Menu ordear +SONG_MENU_SORTING_APPLY=Aplicar + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Modo festa PARTY_DIFFICULTY=Dificultade @@ -469,7 +454,7 @@ MODE_BLIND_NAME=Modo a cegas ;TODO: MODE_BLINDTOTAL_NAME=Total Darkness! ;TODO: MODE_BLINDTOTAL_DESC=A duel, but with the notes and the lyrics hidden. Only for the brave! -MODE_1000BLIND_NAME = +1000 Cego +MODE_1000BLIND_NAME= +1000 Cego ;TODO: MODE_1000BLIND_DESC = Gain a lead of more than 1000 points, but without seeing the notes! ;TODO: MODE_DEAF_NAME = Deaf @@ -478,10 +463,10 @@ MODE_1000BLIND_NAME = +1000 Cego ;TODO: MODE_BLINDLYRICS_NAME = No Lyrics ;TODO: MODE_BLINDLYRICS_DESC = Think you know all the lyrics? Sing with the lyrics hidden! -MODE_500BLIND_NAME = +500 Cego +MODE_500BLIND_NAME= +500 Cego ;TODO: MODE_500BLIND_DESC = Gain a lead of more than 500 points, but without seeing the notes! -MODE_SHORTSONG_NAME = Canción curta +MODE_SHORTSONG_NAME= Canción curta ;TODO: MODE_SHORTSONG_DESC = A fast-paced 1v1 duel over half the song! MODE_HARDCORE_NAME=Hardcore @@ -544,42 +529,25 @@ JUKEBOX_FIND=Procurar: JUKEBOX_SORT=Ordear: JUKEBOX_SONGLIST=Listaxe de cancións -SONG_MENU_SONG=Canción -SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Menu Canción -SONG_MENU_NAME_MEDLEY=Menu Medley -SONG_MENU_ADD_SONG=Engadir canción -SONG_MENU_DELETE_SONG=Eliminar canción -SONG_MENU_START_MEDLEY=Cantar! -SONG_MENU_START_5_MEDLEY=Cantar %0:d cancións! - -SONG_MENU_NAME_SORTING=Menu ordear -SONG_MENU_SORTING_APPLY=Aplicar - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Nº de xogadores NAME_CURRENT_PLAYER=Xogador -;TODO: JUKEBOX_MODE=Jukebox Mode -;TODO: JUKEBOX_OPTIONS_DESC=Playlist Options -;TODO: JUKEBOX_OPTIONS_WHEREAMI=Jukebox Options +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Acerca de... ABOUT_USDX_DEVELOPEDBY=Desenvolvido por ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ABOUT_OVERVIEW=Descubre unha nova forma de cantar, só, en parella ou cos amigos. \n A diversión está garantida.\n\nWorldParty é un fork da versión orixinal Ultrastar Deluxe 1.1 deseñado e desenvolvido polo equipo UltraStar España, conta coa maior comunidade de karaoke.\n\n\nEste programa é gratuíto e libre baixo a licenza GPL. \n\n Visita connosco para obter máis información.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Desenvolvido por @@ -603,4 +571,119 @@ ERROR_CORRUPT_SONG_NO_NOTES=Imposible cargar a canción: Non se atopan as notas ERROR_CORRUPT_SONG_NO_BREAKS=Imposible cargar a canción: Non se atopan interrupcións de liña ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Imposible cargar a canción: Erro durante o parsing da liña %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Asignaronse máis dun micrófono ó xogador %d. Comproba as opcións de micrófonos. -ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Ó xogador %d non se lle asignou ningún micrófono. Comproba as opcións de micrófonos. +ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Ó xogador %d non se lle asignou ningún micrófono. Comproba as opcións de micrófonos.ç + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Avanzado +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Volta +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Negro +C_COLOR_BLUE=Azul +C_COLOR_BROWN=Marrón +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +;TODO: C_COLOR_GRAY=Gray +C_COLOR_GREEN=Verde +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Laranxa +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Rosado +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Vermello +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=Violeta +;TODO: C_COLOR_WHITE=White +C_COLOR_YELLOW=Amarelo +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Xogo +C_GRAPHICS=Gráficos + +;TODO: C_INFORMATION=Information +;TODO: C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Letras + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Micrófonos +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Son +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Aparencia +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/G\303\240idhlig.ini" "b/game/languages/G\303\240idhlig.ini" index 8d4ad92f..5dd5f7ae 100644 --- "a/game/languages/G\303\240idhlig.ini" +++ "b/game/languages/G\303\240idhlig.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Gàidhlig +LANGUAGE_ISO_CODE=dg SING_LOADING=’Ga luchdadh… ;TODO: SING_LOADING_SONGS=Loading songs from folder %s @@ -40,17 +41,6 @@ OPTION_VALUE_HARD=Doirbh SING_OPTIONS=Roghainnean -SING_OPTIONS_GAME=Geama -SING_OPTIONS_GRAPHICS=Grafaigeachd -SING_OPTIONS_SOUND=Fuaim -SING_OPTIONS_LYRICS=Faclan -SING_OPTIONS_THEMES=Ùrlaran -SING_OPTIONS_MICROPHONES=Clàradh -SING_OPTIONS_ADVANCED=Adhartach -SING_OPTIONS_NETWORK=Eadar-lìon -SING_OPTIONS_WEBCAM=Camara-lìn -SING_OPTIONS_EXIT=Air ais - SING_OPTIONS_GAME_LANGUAGE=Cànan SING_OPTIONS_GAME_SONGMENU=Clàr-taice nan òran SING_OPTIONS_GAME_DUETS=Òrain-chàraid @@ -118,9 +108,9 @@ SING_OPTIONS_LYRICS_FONT=Cruth-clò SING_OPTIONS_LYRICS_EFFECT=Èifeachd SING_OPTIONS_LYRICS_NOTELINES=Clàran -;TODO: OPTION_VALUE_PLAIN=stylized -;TODO: OPTION_VALUE_OLINE1=with thin edge -;TODO: OPTION_VALUE_OLINE2=with thick edge +;TODO: OPTION_VALUE_PLAIN=Stylized +;TODO: OPTION_VALUE_OLINE1=With thin edge +;TODO: OPTION_VALUE_OLINE2=With thick edge OPTION_VALUE_SIMPLE=Simplidh OPTION_VALUE_ZOOM=Sùm @@ -140,8 +130,8 @@ SING_OPTIONS_MICROPHONES_MIC_BOOST=Meudachadh a’ mhic SING_OPTIONS_ADVANCED_DEBUG=Dì-bhugachadh SING_OPTIONS_ADVANCED_OSCILLOSCOPE=Oscilloscope -SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Ceistean dìonaidh SING_OPTIONS_ADVANCED_ONSONGCLICK=Às dèidh òrain tagh +SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Ceistean dìonaidh SING_OPTIONS_ADVANCED_PARTYPOPUP=Fèin-chlàr-cèilidh SING_OPTIONS_ADVANCED_TOPSCORES=Na sgòran as àirde SING_OPTIONS_ADVANCED_SINGSCORES=Sgòran seinn @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC=Roghainnean nam faclan JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Suidheachadh OPTION_VALUE_TO_SING=Seinn -OPTION_VALUE_ACTUAL=Ann an da-rìribh -OPTION_VALUE_NEXT=Air adhart +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom OPTION_VALUE_OTHER=Eile OPTION_VALUE_FILL=Lìon OPTION_VALUE_OUTLINE=Oir-loidhne -OPTION_VALUE_BLUE=Gorm -OPTION_VALUE_GREEN=Uaine -OPTION_VALUE_PINK=Pinc -OPTION_VALUE_RED=Dearg -OPTION_VALUE_VIOLET=Purpaidh -OPTION_VALUE_ORANGE=Orainds -OPTION_VALUE_YELLOW=Buidhe -OPTION_VALUE_BROWN=Donn -OPTION_VALUE_BLACK=Dubh -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Liath -OPTION_VALUE_WHITE=Geal -OPTION_VALUE_TURQUOISE=Tuirc-ghorm -OPTION_VALUE_SALMON=Dath a’ bhradain -OPTION_VALUE_GREENYELLOW=Uaine-buidhe -OPTION_VALUE_LAVENDER=Dath an lus-liath -OPTION_VALUE_BEIGE=Bèis -OPTION_VALUE_TEAL=Dath a’ chrann-lacha -OPTION_VALUE_ORCHID=Dath na mogairle -OPTION_VALUE_STEELBLUE=Gorm na stàilinne -OPTION_VALUE_PLUM=Dath a’ phlumais -OPTION_VALUE_CHOCOLATE=Donn an teòclaid -OPTION_VALUE_GOLD=Dath an òir -OPTION_VALUE_DARKBLUE=Dorch-ghorm -OPTION_VALUE_SKY=Gorm an speura -OPTION_VALUE_HARLEQUIN=Cleasaiche-fanaid -OPTION_VALUE_CYAN=Saidhean -OPTION_VALUE_FLAME=Lasair + SING_LEGEND_SELECT=Tagh SING_LEGEND_NAVIGATE=Seòl @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Liosta-chluich SING_SONG_IN_CAT=Òran SING_SONGS_IN_CAT=Òrain PLAYLIST_CATTEXT=Liosta-chluich: %s -SING_SONG_SELECTION_LEGEND_TITLE=Sgeulachd -SING_SONG_SELECTION_LEGEND_VIDEO=Bhidio -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Iomlan SING_MODE=Seinn ’nad aonar @@ -348,7 +306,6 @@ IMPLODE_GLUE2=’s SONG_MENU_NAME_MAIN=Clàr-taice an òrain SONG_MENU_PLAY=Seinn SONG_MENU_CHANGEPLAYERS=Cluicheadairean eile -SONG_MENU_CANCEL=Sguir dheth SONG_MENU_NAME_PLAYLIST=Clàr-taice SONG_MENU_PLAYLIST_ADD=Cuir òran ris @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Amadan SONG_MENU_NAME_PARTY_JOKER=Cleachd amadan -SONG_JUMPTO_DESC=Lorg òran -SONG_JUMPTO_TYPE_DESC=Lorg: +SONG_MENU_LEGEND_TITLE=Sgeulachd +SONG_MENU_LEGEND_VIDEO=Bhidio +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Òran +SONG_MENU_MEDLEY=Measgachadh + +SONG_MENU_NAME_SONG=Clàr-taice nan òran +SONG_MENU_NAME_MEDLEY=Clàr-taice a' mheasgachaidh +SONG_MENU_ADD_SONG=Cuir òran ris +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Sguab às an òran +SONG_MENU_START_MEDLEY=Seinn! +SONG_MENU_START_5_MEDLEY=Seinn %0:d òra(i)n! + +SONG_MENU_NAME_SORTING=Clàr-taice seòrsachaidh +SONG_MENU_SORTING_APPLY=Cuir an sàs + +SONG_MENU_OPEN_CATEGORY=Fosgail roinn-seòrsa +SONG_MENU_CLOSE_CATEGORY=Dùin an roinn-seòrsa +SONG_MENU_START_JUKEBOX=Tòisich an t-inneal-chlàr! +SONG_MENU_NAME_JUKEBOX=Clàr-taice inneil-chlàr + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Modh cèilidh PARTY_DIFFICULTY=Duilgheadas @@ -469,20 +454,20 @@ MODE_BLIND_DESC=Còmhrag-dhithis leis na pongan ’gam falach! MODE_BLINDTOTAL_NAME=Dubh-dorchadas! MODE_BLINDTOTAL_DESC=Còmhrag-dhithis le pongan is faclan falaichte. Dha ghaisgich a-mhàin! -MODE_1000BLIND_NAME = +1,000 gu dall -MODE_1000BLIND_DESC =Bidh air thoiseach air càch le corr is 1,000 puing ach gun a bhith a’ faicinn nam pong! +MODE_1000BLIND_NAME= +1,000 gu dall +MODE_1000BLIND_DESC=Bidh air thoiseach air càch le corr is 1,000 puing ach gun a bhith a’ faicinn nam pong! -MODE_DEAF_NAME =Bodhar -MODE_DEAF_DESC =Saoil a bheil thu eòlach air na pongan? An seinn thu às aonais taic-ciùil? +MODE_DEAF_NAME=Bodhar +MODE_DEAF_DESC=Saoil a bheil thu eòlach air na pongan? An seinn thu às aonais taic-ciùil? -MODE_BLINDLYRICS_NAME =Gun fhaclan -MODE_BLINDLYRICS_DESC =Saoil a bheil thu eòlach air na faclan? Seinn às aonais nam faclan sgrìobhte! +MODE_BLINDLYRICS_NAME=Gun fhaclan +MODE_BLINDLYRICS_DESC=Saoil a bheil thu eòlach air na faclan? Seinn às aonais nam faclan sgrìobhte! -MODE_500BLIND_NAME = +500 gu dall -MODE_500BLIND_DESC =Bidh air thoiseach air càch le corr is 500 puing ach gun a bhith a’ faicinn nam pong! +MODE_500BLIND_NAME= +500 gu dall +MODE_500BLIND_DESC=Bidh air thoiseach air càch le corr is 500 puing ach gun a bhith a’ faicinn nam pong! -MODE_SHORTSONG_NAME =Òran goirid -MODE_SHORTSONG_DESC =Còmhrag-dhithis luath thar leth-òran! +MODE_SHORTSONG_NAME=Òran goirid +MODE_SHORTSONG_DESC=Còmhrag-dhithis luath thar leth-òran! MODE_HARDCORE_NAME=Gaisgich MODE_HARDCORE_DESC=Strì airsona bhith trì loidhnichean air thoiseach a’ cho-fharpaisich! @@ -544,29 +529,14 @@ JUKEBOX_FIND=Lorg: JUKEBOX_SORT=Seòrsaich: JUKEBOX_SONGLIST=Liosta nan òran -SONG_MENU_SONG=Òran -SONG_MENU_MEDLEY=Measgachadh - -SONG_MENU_NAME_SONG=Clàr-taice nan òran -SONG_MENU_NAME_MEDLEY=Clàr-taice a' mheasgachaidh -SONG_MENU_ADD_SONG=Cuir òran ris -SONG_MENU_DELETE_SONG=Sguab às an òran -SONG_MENU_START_MEDLEY=Seinn! -SONG_MENU_START_5_MEDLEY=Seinn %0:d òra(i)n! - -SONG_MENU_NAME_SORTING=Clàr-taice seòrsachaidh -SONG_MENU_SORTING_APPLY=Cuir an sàs - PARTY_PLAYLIST_MANUAL=Taghadh a làimh PARTY_MODE_JUKEBOX_NO_SONGS=Tha an liosta-chluich falamh! -SONG_MENU_OPEN_CATEGORY=Fosgail roinn-seòrsa -SONG_MENU_CLOSE_CATEGORY=Dùin an roinn-seòrsa -SONG_MENU_START_JUKEBOX=Tòisich an t-inneal-chlàr! -SONG_MENU_NAME_JUKEBOX=Clàr-taice inneil-chlàr WEBSITE_EXIST_SONG=Tha an t-òran a’ buntainn ris an làrach-lìn: %0:s WEBSITE_NOT_EXIST_SONG=Chan eil an t-òran a’ buntainn ri làrach-lìn sam bith! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Co mheud cluicheadair NAME_CURRENT_PLAYER=Cluicheadair @@ -577,7 +547,7 @@ ABOUT_USDX_DEVELOPEDBY=Leasaichte le ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Leasaichte le @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Cha b’ urrainn dhuinn an t-òran a luchdadh: Cha ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Cha b’ urrainn dhuinn an t-òran a luchdadh: Mearachd e parsadh na loidhne %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Chaidh iomadh micreofon a shònrachadh dha chluicheadair %d. Thoir sùil air na roghainnean microfòn agad ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Cha deach micreofon a shònrachadh dha chluicheadair %d. Thoir sùil air na roghainnean microfòn agad + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Adhartach +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Air ais +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Bèis +C_COLOR_BLACK=Dubh +C_COLOR_BLUE=Gorm +C_COLOR_BROWN=Donn +C_COLOR_CYAN=Saidhean +C_COLOR_CHOCOLATE=Donn an teòclaid +C_COLOR_DARKBLUE=Dorch-ghorm +C_COLOR_FLAME=Lasair +C_COLOR_GOLD=Dath an òir +C_COLOR_GRAY=Liath +C_COLOR_GREEN=Uaine +C_COLOR_GREENYELLOW=Uaine-buidhe +C_COLOR_HARLEQUIN=Cleasaiche-fanaid +C_COLOR_LAVENDER=Dath an lus-liath +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Orainds +C_COLOR_ORCHID=Dath na mogairle +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Pinc +C_COLOR_PLUM=Dath a’ phlumais +C_COLOR_RED=Dearg +C_COLOR_SALMON=Dath a’ bhradain +C_COLOR_SKY=Gorm an speura +C_COLOR_STEELBLUE=Gorm na stàilinne +C_COLOR_TEAL=Dath a’ chrann-lacha +C_COLOR_TURQUOISE=Tuirc-ghorm +C_COLOR_VIOLET=Purpaidh +C_COLOR_WHITE=Geal +C_COLOR_YELLOW=Buidhe +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Geama +C_GRAPHICS=Grafaigeachd + +;TODO: C_INFORMATION=Information +C_INTERNET=Eadar-lìon + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Faclan + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Clàradh +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Fuaim +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Ùrlaran +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +C_WEBCAM=Camara-lìn + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Hrvatski.ini b/game/languages/Hrvatski.ini index 91868b1f..b9b3ffed 100644 --- a/game/languages/Hrvatski.ini +++ b/game/languages/Hrvatski.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Hrvatski +LANGUAGE_ISO_CODE=hr SING_LOADING=Učitavanje... SING_LOADING_SONGS=Učitavanje pjesama u mapi %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Teško SING_OPTIONS=Opcije -SING_OPTIONS_GAME=Igra -SING_OPTIONS_GRAPHICS=Video -SING_OPTIONS_SOUND=Audio -SING_OPTIONS_LYRICS=Tekstovi -SING_OPTIONS_THEMES=Teme -SING_OPTIONS_MICROPHONES=Snimanje -SING_OPTIONS_ADVANCED=Ostalo -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Natrag - -SING_OPTIONS_GAME_SONGMENU=Playliste SING_OPTIONS_GAME_LANGUAGE=Jezik +SING_OPTIONS_GAME_SONGMENU=Playliste ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Tabovi SING_OPTIONS_GAME_SORTING=Sortiranje -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Aktivirajte gamepad OPTION_VALUE_ROULETTE=Roulet @@ -80,14 +70,14 @@ OPTION_VALUE_YEAR=Godina OPTION_VALUE_DECADE=Desetljeće OPTION_VALUE_PLAYLIST=Playliste -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Cijeli ekran SING_OPTIONS_GRAPHICS_RESOLUTION=Rezolucija SING_OPTIONS_GRAPHICS_SCREENFADE=Fade-out ekrana +SING_OPTIONS_GRAPHICS_EFFECTSING=Efekti kod pjevanja SING_OPTIONS_GRAPHICS_VISUALIZER=Vizualizacije SING_OPTIONS_GRAPHICS_MOVIE_SIZE=Veličina videa -SING_OPTIONS_GRAPHICS_EFFECTSING=Efekti kod pjevanja OPTION_VALUE_BORDERLESS=Maksimizirati @@ -95,14 +85,14 @@ OPTION_VALUE_WHENNOVIDEO=Kada nema videozapisa OPTION_VALUE_WHENNOVIDEOANDIMAGE=Kada nema videozapisa i slika ;TODO: OPTION_VALUE_HALF=Half -;TODO: OPTION_VALUE_FULL_VID=Full (Video) -;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & Video) +;TODO: OPTION_VALUE_FULL_VID=Full (video) +;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & video) SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Microphone Playback SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Pozadinska glazba SING_OPTIONS_SOUND_CLICK_ASSIST=Pomoć klikovima SING_OPTIONS_SOUND_BEAT_CLICK=Klik na udarce -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Glasnoća prikaza SING_OPTIONS_SOUND_PREVIEWFADING=Fade-in vrijeme @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Nakon pjesme SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Sigurn. pitanja SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto party meni ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Sve OPTION_VALUE_PLAYER=Igrač @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Igrač ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Korisničko ime SING_OPTIONS_NETWORK_PASSWORD=Lozinka -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Igrač -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Poništi ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Poništi ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! SONG_SCORE_MAX=Najbolje: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send SCORE_SEND_PLAYER=Igrač -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Poništi ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_RESOLUTION=Rezolucija SING_OPTIONS_WEBCAM_EFFECT=Efekt ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Threshold ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Plava ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Pjevaj -OPTION_VALUE_ACTUAL=Gornji -;TODO: OPTION_VALUE_NEXT=Dno +OPTION_VALUE_TOP=Gornji +OPTION_VALUE_BOTTOM=Dno ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Plava -OPTION_VALUE_GREEN=Zelena -OPTION_VALUE_PINK=Ružičasta -OPTION_VALUE_RED=Crvena -OPTION_VALUE_VIOLET=Ljubičasta -;TODO: OPTION_VALUE_ORANGE=Orange -OPTION_VALUE_YELLOW=Žuta boja -OPTION_VALUE_BROWN=Smeđ -OPTION_VALUE_BLACK=Crno -;TODO: OPTION_VALUE_MAGENTA=Magenta -;TODO: OPTION_VALUE_GRAY=Gray -;TODO: OPTION_VALUE_WHITE=White -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Odaberi SING_LEGEND_NAVIGATE=Navigacija @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Playlista SING_SONG_IN_CAT=Pjesma SING_SONGS_IN_CAT=Pjesme PLAYLIST_CATTEXT=Playlista: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legenda -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Ukupno SING_MODE=Pjevaj solo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= i SONG_MENU_NAME_MAIN=Kolekcija pjesama SONG_MENU_PLAY=Pjevaj SONG_MENU_CHANGEPLAYERS=Promijeni igrače -SONG_MENU_CANCEL=Poništi SONG_MENU_NAME_PLAYLIST=Playliste SONG_MENU_PLAYLIST_ADD=Dodaj Pjesmu @@ -363,7 +320,7 @@ SONG_MENU_NAME_PLAYLIST_NEW=Nova Playlista SONG_MENU_PLAYLIST_NEW_CREATE=Napravi SONG_MENU_PLAYLIST_NEW_UNNAMED=Bez imena -;TODO: SONG_MENU_NAME_PLAYLIST_DELITEM=Really Delete? +;TODO: SONG_MENU_NAME_PLAYLIST_DELITEM=Really delete? SONG_MENU_YES=Da SONG_MENU_NO=Ne @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Iskoristi joker -SONG_JUMPTO_DESC=Pretraži pjesme -SONG_JUMPTO_TYPE_DESC=Traži : +SONG_MENU_LEGEND_TITLE=Legenda +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Playliste +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Dodaj Pjesmu +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Izbriši Pjesmu +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Party mod PARTY_DIFFICULTY=Težina @@ -430,7 +415,7 @@ PARTY_DISMISSED=Izbacen! PARTY_SCORE_WINS=%s je PARTY_SCORE_WINS2=Pobijedio! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=Zadrži liniju @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx otpjevano ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,54 +522,39 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Sljed. igrači za mikr. ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Playliste -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Dodaj Pjesmu -SONG_MENU_DELETE_SONG=Izbriši Pjesmu -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Broj igrača NAME_CURRENT_PLAYER=Igrač -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Oko... ABOUT_USDX_DEVELOPEDBY=Razvijen od ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ABOUT_OVERVIEW=Otkrijte novi način pjevanja, sam, u paru ili s prijateljima. \n Zabava je zajamčena.\n\nWorldParty je fork izvorne verzije Ultrastar Deluxe 1.1 dizajniran i razvijen od strane UltraStar España tima, to broji s najvećom karaoke zajednice.\n\n\nOvaj je program besplatan i libre pod GPL licencom. \n\n Posjetite nas za više informacija.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Razvijen od DEVELOPERS_OVERVIEW=Ljudi koji su pridonijeli ovom projektu:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Posjetite nas za više informacija.\n\nhttps://ultrastar-es.org ;TODO: SCREENSHOT_SAVED=Screenshot saved -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot MSG_ERROR_TITLE=Greška ;TODO: MSG_INFO_TITLE=Information @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Pjesma se ne može učitati: Nije nađen niti jedan ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Pjesma se ne može učitati: Greška u obradi linije %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Igrač %d je dodijeljen više mikrofona. Provjerite opcije mikrofona ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Igrač %d nije dodijeljen mikrofonu. Provjerite opcije mikrofona + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Ostalo +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Natrag +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Crno +C_COLOR_BLUE=Plava +C_COLOR_BROWN=Smeđ +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +;TODO: C_COLOR_GRAY=Gray +C_COLOR_GREEN=Zelena +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +;TODO: C_COLOR_MAGENTA=Magenta +;TODO: C_COLOR_ORANGE=Orange +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Ružičasta +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Crvena +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=Ljubičasta +;TODO: C_COLOR_WHITE=White +C_COLOR_YELLOW=Žuta boja +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Igra +C_GRAPHICS=Video + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Tekstovi + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Snimanje +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Audio +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Teme +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Italiano.ini b/game/languages/Italiano.ini index 32b10833..11ba3602 100644 --- a/game/languages/Italiano.ini +++ b/game/languages/Italiano.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Italiano +LANGUAGE_ISO_CODE=it SING_LOADING=Caricamento... SING_LOADING_SONGS=Caricamento di canzoni dalla cartella %s @@ -40,17 +41,6 @@ OPTION_VALUE_HARD=Difficile SING_OPTIONS=Impostazioni -SING_OPTIONS_GAME=Generali -SING_OPTIONS_GRAPHICS=Grafica -SING_OPTIONS_SOUND=Audio -SING_OPTIONS_LYRICS=Testi -SING_OPTIONS_THEMES=Temi -SING_OPTIONS_MICROPHONES=Microfono -SING_OPTIONS_ADVANCED=Avanzate -SING_OPTIONS_NETWORK=Internet -SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Indietro - SING_OPTIONS_GAME_LANGUAGE=Lingua SING_OPTIONS_GAME_SONGMENU=Menu Canzone SING_OPTIONS_GAME_DUETS=Duetti @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC=Opzioni testo JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Posizione OPTION_VALUE_TO_SING=Inizia la sfida! -OPTION_VALUE_ACTUAL=Attuale -OPTION_VALUE_NEXT=Seguente +OPTION_VALUE_TOP=Superiore +OPTION_VALUE_BOTTOM=Inferiore OPTION_VALUE_OTHER=Altro OPTION_VALUE_FILL=Riempire OPTION_VALUE_OUTLINE=Contorno -OPTION_VALUE_BLUE=Blu -OPTION_VALUE_GREEN=Verde -OPTION_VALUE_PINK=Rosa -OPTION_VALUE_RED=Rosso -OPTION_VALUE_VIOLET=Viola -OPTION_VALUE_ORANGE=Arancione -OPTION_VALUE_YELLOW=Giallo -OPTION_VALUE_BROWN=Marrone -OPTION_VALUE_BLACK=Nero -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Grigio -OPTION_VALUE_WHITE=Bianco -OPTION_VALUE_TURQUOISE=Turchese -OPTION_VALUE_SALMON=Salmone -OPTION_VALUE_GREENYELLOW=Verde giallo -OPTION_VALUE_LAVENDER=Lavanda -OPTION_VALUE_BEIGE=Beige -OPTION_VALUE_TEAL=Verde acqua -OPTION_VALUE_ORCHID=Orchidea -OPTION_VALUE_STEELBLUE=Blu acciaio -OPTION_VALUE_PLUM=Prugna -OPTION_VALUE_CHOCOLATE=Cioccolato -OPTION_VALUE_GOLD=Oro -OPTION_VALUE_DARKBLUE=Blu scuro -OPTION_VALUE_SKY=Celeste -OPTION_VALUE_HARLEQUIN=Arlecchino -OPTION_VALUE_CYAN=Ciano -OPTION_VALUE_FLAME=Fiamma + SING_LEGEND_SELECT=Seleziona SING_LEGEND_NAVIGATE=Naviga @@ -299,14 +262,9 @@ SING_LEGEND_ESC=Indietro SING_SONG_SELECTION=Brano SING_SONG_SELECTION_MENU=Menu SING_SONG_SELECTION_PLAYLIST=Playlist +;TODO: SING_SONG_IN_CAT=Song SING_SONGS_IN_CAT=Canzone -SING_SONGS_IN_CAT=Canzoni PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Leggenda -SING_SONG_SELECTION_LEGEND_VIDEO=Video -SING_SONG_SELECTION_LEGEND_MEDLEY=Versione breve -SING_SONG_SELECTION_LEGEND_MEDLEYC=Versione breve calcolata -SING_SONG_SELECTION_LEGEND_DUET=Duetto SING_TOTAL=Punteggio SING_MODE=Canta @@ -348,7 +306,6 @@ IMPLODE_GLUE2= e SONG_MENU_NAME_MAIN=Menu canzone SONG_MENU_PLAY=Canta SONG_MENU_CHANGEPLAYERS=Cambia giocatori -SONG_MENU_CANCEL=Annulla SONG_MENU_NAME_PLAYLIST=Menu Canzone SONG_MENU_PLAYLIST_ADD=Aggiungi Canzone @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Jolly SONG_MENU_NAME_PARTY_JOKER=Gioca il jolly -SONG_JUMPTO_DESC=Cerca Canzone -SONG_JUMPTO_TYPE_DESC=Cerca per: +SONG_MENU_LEGEND_TITLE=Leggenda +SONG_MENU_LEGEND_VIDEO=Video +SONG_MENU_LEGEND_MEDLEY=Versione breve +SONG_MENU_LEGEND_MEDLEYC=Versione breve calcolata +SONG_MENU_LEGEND_DUET=Duetto +SONG_MENU_LEGEND_RAP=Rap +SONG_MENU_LEGEND_CREATEDBY=Creata da +SONG_MENU_LEGEND_FIXEDBY=Riparata da +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Brano +SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Menu canzoni +SONG_MENU_NAME_MEDLEY=Menu Medley +SONG_MENU_ADD_SONG=Aggiungi canzone +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Cancella canzone +SONG_MENU_START_MEDLEY=Canta! +SONG_MENU_START_5_MEDLEY=Canta %0:d Canzoni! + +SONG_MENU_NAME_SORTING=Menu genere +SONG_MENU_SORTING_APPLY=Applica + +SONG_MENU_OPEN_CATEGORY=Categoria aperta +SONG_MENU_CLOSE_CATEGORY=Chiudi categoria +SONG_MENU_START_JUKEBOX=Inizia Jukebox! +SONG_MENU_NAME_JUKEBOX=Menu Jukebox + +SONG_SEARCH_DESC=Cosa vuoi cantare adesso? PARTY_MODE=Modalità party PARTY_DIFFICULTY=Difficoltà @@ -469,20 +454,20 @@ MODE_BLIND_DESC=Duello 1vs1 con le note nascoste! MODE_BLINDTOTAL_NAME=Oscurità totale! MODE_BLINDTOTAL_DESC=Duello con le note e testo nascosto. Solo per i più coraggiosi. -MODE_1000BLIND_NAME =+1000 cieco -MODE_1000BLIND_DESC =Ottieni un vantaggio di più di 1000 punti, ma senza vedere le note! +MODE_1000BLIND_NAME=+1000 cieco +MODE_1000BLIND_DESC=Ottieni un vantaggio di più di 1000 punti, ma senza vedere le note! -MODE_DEAF_NAME =Sordo -MODE_DEAF_DESC = Credi di conoscere le note? Puoi cantare senza accompagnamenti? +MODE_DEAF_NAME=Sordo +MODE_DEAF_DESC= Credi di conoscere le note? Puoi cantare senza accompagnamenti? -MODE_BLINDLYRICS_NAME =Senza testo -MODE_BLINDLYRICS_DESC =Credi di conoscere il testo? Canta con il testo nascosto! +MODE_BLINDLYRICS_NAME=Senza testo +MODE_BLINDLYRICS_DESC=Credi di conoscere il testo? Canta con il testo nascosto! -MODE_500BLIND_NAME =+500 cieco -MODE_500BLIND_DESC =Ottieni un vantaggio di più di 500 punti senza vedere le note! +MODE_500BLIND_NAME=+500 cieco +MODE_500BLIND_DESC=Ottieni un vantaggio di più di 500 punti senza vedere le note! -MODE_SHORTSONG_NAME =Canzone corta -MODE_SHORTSONG_DESC =Duello 1vs1 fino metà canzone! +MODE_SHORTSONG_NAME=Canzone corta +MODE_SHORTSONG_DESC=Duello 1vs1 fino metà canzone! MODE_HARDCORE_NAME=Hardcore MODE_HARDCORE_DESC=Vince chi ottenga 3 linee di vantaggio! @@ -544,29 +529,14 @@ JUKEBOX_FIND=Trova: JUKEBOX_SORT=Genere: JUKEBOX_SONGLIST=Lista delle canzoni -SONG_MENU_SONG=Brano -SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Menu canzoni -SONG_MENU_NAME_MEDLEY=Menu Medley -SONG_MENU_ADD_SONG=Aggiungi canzone -SONG_MENU_DELETE_SONG=Cancella canzone -SONG_MENU_START_MEDLEY=Canta! -SONG_MENU_START_5_MEDLEY=Canta %0:d Canzoni! - -SONG_MENU_NAME_SORTING=Menu genere -SONG_MENU_SORTING_APPLY=Applica - PARTY_PLAYLIST_MANUAL=Selezione manuale PARTY_MODE_JUKEBOX_NO_SONGS=Playlist vuota! -SONG_MENU_OPEN_CATEGORY=Categoria aperta -SONG_MENU_CLOSE_CATEGORY=Chiudi categoria -SONG_MENU_START_JUKEBOX=Inizia Jukebox! -SONG_MENU_NAME_JUKEBOX=Menu Jukebox WEBSITE_EXIST_SONG=La canzone appartiene al sito web: %0:s WEBSITE_NOT_EXIST_SONG=La canzone non appartiene a nessun sito web! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Numero di giocatori NAME_CURRENT_PLAYER=Giocatore @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Impossibile aprire la canzone: nessuna pausa trovat ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Impossibile aprire la canzone: errore durante l'interpretazione della linea %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Il giocatore %d è assegnato a più microfoni. Per favore, selezionare un canale libero! ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Il giocatore %d non è assegnato ad un microfono. Per favore, selezionare un canale nelle opzioni del microfono. + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Avanzate +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Indietro +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Black +C_COLOR_BLUE=Blu +C_COLOR_BROWN=Marrone +C_COLOR_CYAN=Ciano +C_COLOR_CHOCOLATE=Cioccolato +C_COLOR_DARKBLUE=Blu scuro +C_COLOR_FLAME=Fiamma +C_COLOR_GOLD=Oro +C_COLOR_GRAY=Grigio +C_COLOR_GREEN=Verde +C_COLOR_GREENYELLOW=Verde giallo +C_COLOR_HARLEQUIN=Arlecchino +C_COLOR_LAVENDER=Lavanda +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Arancione +C_COLOR_ORCHID=Orchidea +C_COLOR_OTHER=Altro +C_COLOR_PINK=Rosa +C_COLOR_PLUM=Prugna +C_COLOR_RED=Rosso +C_COLOR_SALMON=Salmone +C_COLOR_SKY=Celeste +C_COLOR_STEELBLUE=Blu acciaio +C_COLOR_TEAL=Verde acqua +C_COLOR_TURQUOISE=Turchese +C_COLOR_VIOLET=Viola +C_COLOR_WHITE=Bianco +C_COLOR_YELLOW=Giallo +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Generali +C_GRAPHICS=Grafica + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Testi + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Microfono +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +C_SEARCH_NEW_SONGS=Cerca nuove canzoni +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Audio +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Temi +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Language.new b/game/languages/Language.new index 5c7e76c2..c60048d7 100644 --- a/game/languages/Language.new +++ b/game/languages/Language.new @@ -1,10 +1,61 @@ [Text] -TODO: LANGUAGE=Language +;TODO: LANGUAGE=English +;TODO: LANGUAGE_ISO_CODE=en + +;TODO: SING_LOADING=Loading... +;TODO: SING_LOADING_SONGS=Loading songs from folder %s + +;TODO: SING_SING=Sing +;TODO: SING_SING_DESC=Sing solo or duet + +;TODO: SING_MULTI=Party +;TODO: SING_MULTI_DESC=Sing in party-mode + +;TODO: SING_JUKEBOX=Jukebox +;TODO: SING_JUKEBOX_DESC=Listen to my collection + +;TODO: SING_STATS=Stats +;TODO: SING_STATS_DESC=View the statistics + +;TODO: SING_GAME_OPTIONS=Game options +;TODO: SING_GAME_OPTIONS_DESC=Change game settings + +;TODO: SING_EXIT=Quit +;TODO: SING_EXIT_DESC=Quit game + +;TODO: SING_ABOUT=About +;TODO: SING_ABOUT_DESC=About UltraStar WorldParty + +;TODO: SING_PLAYER_TITLE=Profiles +;TODO: SING_PLAYER_READY=Players ready to sing +;TODO: SING_PLAYER_COUNT=Number of players +;TODO: SING_PLAYER_EDIT=Customize a player +;TODO: SING_PLAYER_NAME=Write your name +;TODO: SING_PLAYER_COLOR=Pick a color +;TODO: SING_PLAYER_LEVEL=Choose a level +;TODO: SING_PLAYER_AVATAR=Select your avatar ;TODO: OPTION_VALUE_EASY=Easy ;TODO: OPTION_VALUE_MEDIUM=Medium ;TODO: OPTION_VALUE_HARD=Hard +;TODO: SING_OPTIONS=Options + +;TODO: SING_OPTIONS_GAME_LANGUAGE=Language +;TODO: SING_OPTIONS_GAME_SONGMENU=Song menu +;TODO: SING_OPTIONS_GAME_DUETS=Duets +;TODO: SING_OPTIONS_GAME_TABS=Tabs +;TODO: SING_OPTIONS_GAME_SORTING=Sorting +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores +;TODO: SING_OPTIONS_GAME_JOYPAD_SUPPORT=Activate gamepad + +;TODO: OPTION_VALUE_ROULETTE=Roulette +;TODO: OPTION_VALUE_CHESSBOARD=Chessboard +;TODO: OPTION_VALUE_CAROUSEL=Carousel +;TODO: OPTION_VALUE_SLOT_MACHINE=Slot machine +;TODO: OPTION_VALUE_LIST=List +;TODO: OPTION_VALUE_MOSAIC=Tile + ;TODO: OPTION_VALUE_ON=On ;TODO: OPTION_VALUE_OFF=Off @@ -14,25 +65,52 @@ TODO: LANGUAGE=Language ;TODO: OPTION_VALUE_FOLDER=Folder ;TODO: OPTION_VALUE_TITLE=Title ;TODO: OPTION_VALUE_ARTIST=Artist -;TODO: OPTION_VALUE_TITLE2=Title2 ;TODO: OPTION_VALUE_ARTIST2=Artist2 +;TODO: OPTION_VALUE_YEAR=Year +;TODO: OPTION_VALUE_DECADE=Decade +;TODO: OPTION_VALUE_PLAYLIST=Playlist -;TODO: OPTION_VALUE_WHENNOVIDEO=When No Video +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists + +;TODO: SING_OPTIONS_GRAPHICS_FULLSCREEN=Fullscreen +;TODO: SING_OPTIONS_GRAPHICS_RESOLUTION=Resolution +;TODO: SING_OPTIONS_GRAPHICS_SCREENFADE=Screen fading +;TODO: SING_OPTIONS_GRAPHICS_EFFECTSING=Sing effects +;TODO: SING_OPTIONS_GRAPHICS_VISUALIZER=Visualization +;TODO: SING_OPTIONS_GRAPHICS_MOVIE_SIZE=Movie size + +;TODO: OPTION_VALUE_BORDERLESS=Borderless -;TODO: OPTION_VALUE_SMALL=Small -;TODO: OPTION_VALUE_BIG=Big +;TODO: OPTION_VALUE_WHENNOVIDEO=When No Video +;TODO: OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No video and image ;TODO: OPTION_VALUE_HALF=Half -;TODO: OPTION_VALUE_FULL_VID=Full (Video) -;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & Video) +;TODO: OPTION_VALUE_FULL_VID=Full (video) +;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & video) + +;TODO: SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Microphone playback +;TODO: SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Background music +;TODO: SING_OPTIONS_SOUND_CLICK_ASSIST=Click assist +;TODO: SING_OPTIONS_SOUND_BEAT_CLICK=Beat click +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain +;TODO: SING_OPTIONS_SOUND_PREVIEWVOLUME=Preview volume +;TODO: SING_OPTIONS_SOUND_PREVIEWFADING=Preview fading + +;TODO: OPTION_VALUE_GAIN_SOFT=Soft +;TODO: OPTION_VALUE_GAIN_MEDIUM=Medium +;TODO: OPTION_VALUE_GAIN_HARD=Hard ;TODO: OPTION_VALUE_AUTO=Auto ;TODO: OPTION_VALUE_SEC=Second ;TODO: OPTION_VALUE_SECS=Seconds -;TODO: OPTION_VALUE_PLAIN=Plain -;TODO: OPTION_VALUE_OLINE1=OLine1 -;TODO: OPTION_VALUE_OLINE2=OLine2 +;TODO: SING_OPTIONS_LYRICS_FONT=Font +;TODO: SING_OPTIONS_LYRICS_EFFECT=Effect +;TODO: SING_OPTIONS_LYRICS_NOTELINES=Staves + +;TODO: OPTION_VALUE_PLAIN=Stylized +;TODO: OPTION_VALUE_OLINE1=With thin edge +;TODO: OPTION_VALUE_OLINE2=With thick edge ;TODO: OPTION_VALUE_SIMPLE=Simple ;TODO: OPTION_VALUE_ZOOM=Zoom @@ -40,304 +118,361 @@ TODO: LANGUAGE=Language ;TODO: OPTION_VALUE_BALL=Ball ;TODO: OPTION_VALUE_SHIFT=Shift -;TODO: OPTION_VALUE_EURO=Euro -;TODO: OPTION_VALUE_JAPAN=Japan -;TODO: OPTION_VALUE_AMERICAN=American - -;TODO: OPTION_VALUE_BLUE=Blue -;TODO: OPTION_VALUE_GREEN=Green -;TODO: OPTION_VALUE_PINK=Pink -;TODO: OPTION_VALUE_RED=Red -;TODO: OPTION_VALUE_VIOLET=Violet -;TODO: OPTION_VALUE_ORANGE=Orange -;TODO: OPTION_VALUE_YELLOW=Yellow -;TODO: OPTION_VALUE_BROWN=Brown -;TODO: OPTION_VALUE_BLACK=Black - -;TODO: OPTION_VALUE_SING=Sing -;TODO: OPTION_VALUE_SELECT_PLAYERS=Select Players -;TODO: OPTION_VALUE_OPEN_MENU=Open Menu - -;TODO: OPTION_VALUE_HARDWARE_CURSOR=Hardware Cursor -;TODO: OPTION_VALUE_SOFTWARE_CURSOR=Software Cursor - -;TODO: SING_LOADING=Loading... - -;TODO: SING_CHOOSE_MODE=choose mode -;TODO: SING_SING=sing -;TODO: SING_SING_DESC=quick game: sing solo or duet - -;TODO: SING_MULTI=party -;TODO: SING_MULTI_DESC=sing in party-mode - -;TODO: SING_TOOLS=tools - -;TODO: SING_STATS=stats -;TODO: SING_STATS_DESC=view the statistics - -;TODO: SING_GAME_OPTIONS=game options -;TODO: SING_GAME_OPTIONS_DESC=change game settings - -;TODO: SING_EXIT=quit -;TODO: SING_EXIT_DESC=quit game - -;TODO: SING_OPTIONS=options -;TODO: SING_OPTIONS_DESC=change settings -;TODO: SING_OPTIONS_WHEREAMI=Options - -;TODO: SING_OPTIONS_GAME=game -;TODO: SING_OPTIONS_GRAPHICS=graphics -;TODO: SING_OPTIONS_SOUND=sound -;TODO: SING_OPTIONS_LYRICS=lyrics -;TODO: SING_OPTIONS_THEMES=themes -;TODO: SING_OPTIONS_RECORD=record -;TODO: SING_OPTIONS_ADVANCED=advanced -;TODO: SING_OPTIONS_EXIT=back - -;TODO: SING_OPTIONS_GAME_WHEREAMI=Options Game -;TODO: SING_OPTIONS_GAME_DESC=general game settings -;TODO: SING_OPTIONS_GAME_PLAYERS=Players -;TODO: SING_OPTIONS_GAME_DIFFICULTY=Difficulty -;TODO: SING_OPTIONS_GAME_LANGUAGE=Language -;TODO: SING_OPTIONS_GAME_TABS=Tabs -;TODO: SING_OPTIONS_GAME_SORTING=Sorting -;TODO: SING_OPTIONS_GAME_DEBUG=Debug - -;TODO: SING_OPTIONS_GRAPHICS_WHEREAMI=Options Graphics -;TODO: SING_OPTIONS_GRAPHICS_DESC=graphic settings -;TODO: SING_OPTIONS_GRAPHICS_RESOLUTION=Resolution -;TODO: SING_OPTIONS_GRAPHICS_FULLSCREEN=Fullscreen -;TODO: SING_OPTIONS_GRAPHICS_DEPTH=Depth -;TODO: SING_OPTIONS_GRAPHICS_VISUALIZER=Visualization -;TODO: SING_OPTIONS_GRAPHICS_OSCILLOSCOPE=Oscilloscope -;TODO: SING_OPTIONS_GRAPHICS_LINEBONUS=Line Bonus -;TODO: SING_OPTIONS_GRAPHICS_MOVIE_SIZE=Movie size - -;TODO: SING_OPTIONS_SOUND_WHEREAMI=Options Sound -;TODO: SING_OPTIONS_SOUND_DESC=sound settings -;TODO: SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Microphone Playback -;TODO: SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Background music -;TODO: SING_OPTIONS_SOUND_MIC_BOOST=Mic boost -;TODO: SING_OPTIONS_SOUND_CLICK_ASSIST=Click assist -;TODO: SING_OPTIONS_SOUND_BEAT_CLICK=Beat click -;TODO: SING_OPTIONS_SOUND_THRESHOLD=Threshold -;TODO: SING_OPTIONS_SOUND_TWO_PLAYERS_MODE=Two players mode -;TODO: SING_OPTIONS_SOUND_PREVIEWVOLUME=Preview Volume -;TODO: SING_OPTIONS_SOUND_PREVIEWFADING=Preview Fading - -;TODO: SING_OPTIONS_LYRICS_WHEREAMI=Options Lyrics -;TODO: SING_OPTIONS_LYRICS_DESC=lyrics settings -;TODO: SING_OPTIONS_LYRICS_FONT=Font -;TODO: SING_OPTIONS_LYRICS_EFFECT=Effect -;TODO: SING_OPTIONS_LYRICS_SOLMIZATION=Solmization -;TODO: SING_OPTIONS_LYRICS_NOTELINES=Staves - -;TODO: SING_OPTIONS_THEMES_WHEREAMI=Options Themes -;TODO: SING_OPTIONS_THEMES_DESC=theme and skin settings ;TODO: SING_OPTIONS_THEMES_THEME=Theme ;TODO: SING_OPTIONS_THEMES_SKIN=Skin ;TODO: SING_OPTIONS_THEMES_COLOR=Color -;TODO: SING_OPTIONS_RECORD_WHEREAMI=Options Record -;TODO: SING_OPTIONS_RECORD_DESC=microphone settings -;TODO: SING_OPTIONS_RECORD_CARD=Soundcard -;TODO: SING_OPTIONS_RECORD_INPUT=Input -;TODO: SING_OPTIONS_RECORD_CHANNEL=Channel - -;TODO: SING_OPTIONS_ADVANCED_WHEREAMI=Options Advanced -;TODO: SING_OPTIONS_ADVANCED_DESC=advanced settings -;TODO: SING_OPTIONS_ADVANCED_EFFECTSING=Sing Effects -;TODO: SING_OPTIONS_ADVANCED_SCREENFADE=Screen Fading -;TODO: SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Safety Questions -;TODO: SING_OPTIONS_ADVANCED_ONSONGCLICK=after Song Select -;TODO: SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto PartyMenu +;TODO: SING_OPTIONS_MICROPHONES_CARD=Soundcard +;TODO: SING_OPTIONS_MICROPHONES_INPUT=Input +;TODO: SING_OPTIONS_MICROPHONES_CHANNEL=Channel +;TODO: SING_OPTIONS_MICROPHONES_THRESHOLD=Threshold +;TODO: SING_OPTIONS_MICROPHONES_MIC_BOOST=Mic boost -;TODO: SING_LEGEND_SELECT=select -;TODO: SING_LEGEND_NAVIGATE=navigate -;TODO: SING_LEGEND_CONTINUE=continue -;TODO: SING_LEGEND_ESC=back - -;TODO: SING_PLAYER_DESC=enter player name/s -;TODO: SING_PLAYER_WHEREAMI=Playernames -;TODO: SING_PLAYER_ENTER_NAME=enter name - -;TODO: SING_DIFFICULTY_DESC=select difficulty -;TODO: SING_DIFFICULTY_WHEREAMI=Difficulty -;TODO: SING_DIFFICULTY_CONTINUE=to song selection -;TODO: SING_EASY=Easy -;TODO: SING_MEDIUM=Medium -;TODO: SING_HARD=Hard - -;TODO: SING_SONG_SELECTION_DESC=choose your song -;TODO: SING_SONG_SELECTION_WHEREAMI=Song Selection -;TODO: SING_SONG_SELECTION_GOTO=go to .. -;TODO: SING_SONG_SELECTION=song selection -;TODO: SING_SONG_SELECTION_MENU=menu -;TODO: SING_SONG_SELECTION_PLAYLIST=playlist +;TODO: SING_OPTIONS_ADVANCED_DEBUG=Debug +;TODO: SING_OPTIONS_ADVANCED_OSCILLOSCOPE=Oscilloscope +;TODO: SING_OPTIONS_ADVANCED_ONSONGCLICK=After song select +;TODO: SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Safety questions +;TODO: SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto PartyMenu +;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing + +;TODO: OPTION_VALUE_ALL=All +;TODO: OPTION_VALUE_PLAYER=Player + +;TODO: SING_OPTIONS_NETWORK_INSERT_USER_INFO=Press key "Insert" to add user to this web... +;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website +;TODO: SING_OPTIONS_NETWORK_USERNAME=Username +;TODO: SING_OPTIONS_NETWORK_PASSWORD=Password +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name +;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto +;TODO: SING_OPTIONS_NETWORK_AUTO_PLAYER=Player +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) +;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! +;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? +;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert +;TODO: SING_OPTIONS_NETWORK_LEGEND_DELETE=Delete + +;TODO: OPTION_PLAYER_1=Player 1 +;TODO: OPTION_PLAYER_2=Player 2 +;TODO: OPTION_PLAYER_3=Player 3 +;TODO: OPTION_PLAYER_4=Player 4 +;TODO: OPTION_PLAYER_5=Player 5 +;TODO: OPTION_PLAYER_6=Player 6 +;TODO: OPTION_ALL_PLAYERS=All +;TODO: OPTION_ALL_SCORES=All +;TODO: OPTION_VALUE_SAVE=Save +;TODO: OPTION_VALUE_SEND=Send + +;TODO: MSG_INSERT_USER_TITLE=%0:s +;TODO: MSG_INSERT_USER_DESC=Fill the fields: +;TODO: MSG_INSERT_USER_ADD=Add +;TODO: MSG_INSERT_USER_CANCEL=Cancel + +;TODO: WEBSITE_NO_CONNECTION=No website connection! +;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! +;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! +;TODO: WEBSITE_EXIST_USER=Existing user! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! +;TODO: WEBSITE_OK_SEND=Score sent successfully! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! +;TODO: WEBSITE_SAVE_SCORE=Score save successfully! +;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? + +;TODO: SONG_MENU_REFRESH_SCORES=Update Scores +;TODO: SONG_MENU_REFRESH_SCORES_TITLE=Update +;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! +;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online +;TODO: SONG_MENU_REFRESH_SCORES_FILE=File +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song +;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! + +;TODO: SONG_SCORE_MAX=Best: +;TODO: SONG_SCORE_MEDIA=Average: + +;TODO: SCORE_SEND_DESC=Send score +;TODO: SCORE_SEND=Send +;TODO: SCORE_SEND_PLAYER=Player +;TODO: SCORE_SEND_OTHER_USER= Other username +;TODO: SCORE_SAVE=Save + +;TODO: SCORE_DOWNLOAD_TITLE=Download +;TODO: SCORE_DOWNLOAD_SONG=Song: +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... +;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... +;TODO: SCORE_DOWNLOAD_CANCEL=Cancel +;TODO: SCORE_DOWNLOAD_OK=OK +;TODO: SCORE_DOWNLOAD_SONG_UPDATE=%0:d song(s) change(s) by web! + +;TODO: SING_OPTIONS_WEBCAM_ID=Webcam +;TODO: SING_OPTIONS_WEBCAM_RESOLUTION=Resolution +;TODO: SING_OPTIONS_WEBCAM_FPS=FPS +;TODO: SING_OPTIONS_WEBCAM_FLIP=Flip +;TODO: SING_OPTIONS_WEBCAM_BRIGHTNESS=Brightness +;TODO: SING_OPTIONS_WEBCAM_SATURATION=Saturation +;TODO: SING_OPTIONS_WEBCAM_HUE=Hue +;TODO: SING_OPTIONS_WEBCAM_EFFECT=Effect +;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview + +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! +;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white +;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate +;TODO: SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Threshold +;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized +;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode + +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_ALPHA=Transparency +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_LINE=Line +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_PROPERTY=Property +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_COLOR=Color +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_RGB_RED=Red +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_RGB_GREEN=Green +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Blue + +;TODO: JUKEBOX_SONGOPTIONS_LYRIC=Lyric Options +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position + +;TODO: OPTION_VALUE_TO_SING=Sing +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom +;TODO: OPTION_VALUE_OTHER=Other +;TODO: OPTION_VALUE_FILL=Fill +;TODO: OPTION_VALUE_OUTLINE=Outline + + +;TODO: SING_LEGEND_SELECT=Select +;TODO: SING_LEGEND_NAVIGATE=Navigate +;TODO: SING_LEGEND_CONTINUE=Continue +;TODO: SING_LEGEND_ESC=Back + +;TODO: SING_SONG_SELECTION=Song selection +;TODO: SING_SONG_SELECTION_MENU=Menu +;TODO: SING_SONG_SELECTION_PLAYLIST=Playlist +;TODO: SING_SONG_IN_CAT=Song ;TODO: SING_SONGS_IN_CAT=Songs ;TODO: PLAYLIST_CATTEXT=Playlist: %s -;TODO: SING_TIME=TIME -;TODO: SING_TOTAL=total -;TODO: SING_MODE=sing solo -;TODO: SING_NOTES=notes -;TODO: SING_GOLDEN_NOTES=golden notes -;TODO: SING_PHRASE_BONUS=line bonus +;TODO: SING_TOTAL=Total +;TODO: SING_MODE=Sing solo +;TODO: SING_NOTES=Notes +;TODO: SING_GOLDEN_NOTES=Golden notes +;TODO: SING_PHRASE_BONUS=Line bonus ;TODO: SING_MENU=Main Menu -;TODO: SONG_SCORE=song score +;TODO: SONG_SCORE=Song score ;TODO: SONG_SCORE_WHEREAMI=Score -;TODO: SING_SCORE_TONE_DEAF=Tone Deaf +;TODO: SING_SCORE_TONE_DEAF=Tone deaf ;TODO: SING_SCORE_AMATEUR=Amateur ;TODO: SING_SCORE_WANNABE=Wannabe ;TODO: SING_SCORE_HOPEFUL=Hopeful -;TODO: SING_SCORE_RISING_STAR=Rising Star -;TODO: SING_SCORE_LEAD_SINGER=Lead Singer +;TODO: SING_SCORE_RISING_STAR=Rising star +;TODO: SING_SCORE_LEAD_SINGER=Lead singer ;TODO: SING_SCORE_SUPERSTAR=Superstar ;TODO: SING_SCORE_ULTRASTAR=Ultrastar -;TODO: SING_TOP_5_CHARTS=top 5 Players -;TODO: SING_TOP_5_CHARTS_WHEREAMI=top 5 -;TODO: SING_TOP_5_CHARTS_CONTINUE=to song selection -;TODO: SING_TOP_5_CHARTS_SWITCH_DIFFICULTY=switch difficulty +;TODO: SING_TOP_5_CHARTS=Top 5 players +;TODO: SING_TOP_5_CHARTS_WHEREAMI=Top 5 +;TODO: SING_TOP_5_CHARTS_CONTINUE=To song selection +;TODO: SING_TOP_5_CHARTS_SWITCH_DIFFICULTY=Switch difficulty -;TODO: POPUP_PERFECT=perfect! -;TODO: POPUP_AWESOME=awesome! -;TODO: POPUP_GREAT=great! -;TODO: POPUP_GOOD=good! -;TODO: POPUP_NOTBAD=not bad! -;TODO: POPUP_BAD=bad! -;TODO: POPUP_POOR=poor! -;TODO: POPUP_AWFUL=awful! +;TODO: POPUP_PERFECT=Perfect! +;TODO: POPUP_AWESOME=Awesome! +;TODO: POPUP_GREAT=Great! +;TODO: POPUP_GOOD=Good! +;TODO: POPUP_NOTBAD=Not bad! +;TODO: POPUP_BAD=Bad! +;TODO: POPUP_POOR=Poor! +;TODO: POPUP_AWFUL=Awful! ;TODO: IMPLODE_GLUE1=, ;TODO: IMPLODE_GLUE2= and -;TODO: SONG_MENU_NAME_MAIN=song menu +;TODO: SONG_MENU_NAME_MAIN=Song menu ;TODO: SONG_MENU_PLAY=Sing -;TODO: SONG_MENU_CHANGEPLAYERS=Change Players -;TODO: SONG_MENU_MODI=Sing a Modi -;TODO: SONG_MENU_CANCEL=Cancel +;TODO: SONG_MENU_CHANGEPLAYERS=Choose who sing it ;TODO: SONG_MENU_NAME_PLAYLIST=Song Menu ;TODO: SONG_MENU_PLAYLIST_ADD=Add Song ;TODO: SONG_MENU_PLAYLIST_DEL=Delete Song -;TODO: SONG_MENU_NAME_PLAYLIST_ADD=Add Song -;TODO: SONG_MENU_PLAYLIST_ADD_NEW=to new playlist -;TODO: SONG_MENU_PLAYLIST_ADD_EXISTING=to existing playlist +;TODO: SONG_MENU_NAME_PLAYLIST_ADD=Add song +;TODO: SONG_MENU_PLAYLIST_ADD_NEW=To new playlist +;TODO: SONG_MENU_PLAYLIST_ADD_EXISTING=To existing playlist ;TODO: SONG_MENU_PLAYLIST_NOEXISTING=No playlist available ;TODO: SONG_MENU_NAME_PLAYLIST_NEW=New Playlist ;TODO: SONG_MENU_PLAYLIST_NEW_CREATE=Create ;TODO: SONG_MENU_PLAYLIST_NEW_UNNAMED=Unnamed -;TODO: SONG_MENU_NAME_PLAYLIST_DELITEM=Really Delete? +;TODO: SONG_MENU_NAME_PLAYLIST_DELITEM=Really delete? ;TODO: SONG_MENU_YES=Yes ;TODO: SONG_MENU_NO=No -;TODO: SONG_MENU_NAME_PLAYLIST_LOAD=Open Playlist -;TODO: SONG_MENU_PLAYLIST_LOAD=open -;TODO: SONG_MENU_PLAYLIST_DELCURRENT=delete current Playlist +;TODO: SONG_MENU_NAME_PLAYLIST_LOAD=Open playlist +;TODO: SONG_MENU_PLAYLIST_LOAD=Open +;TODO: SONG_MENU_PLAYLIST_DELCURRENT=Delete current playlist -;TODO: SONG_MENU_NAME_PLAYLIST_DEL=Delete Playlist? +;TODO: SONG_MENU_NAME_PLAYLIST_DEL=Delete playlist? -;TODO: SONG_MENU_NAME_PARTY_MAIN=Party Menu +;TODO: SONG_MENU_NAME_PARTY_MAIN=Party menu ;TODO: SONG_MENU_JOKER=Joker -;TODO: SONG_MENU_NAME_PARTY_JOKER=take joker +;TODO: SONG_MENU_NAME_PARTY_JOKER=Take joker + +;TODO: SONG_MENU_LEGEND_TITLE=Legend +;TODO: SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +;TODO: SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated -;TODO: SONG_JUMPTO_DESC=search song -;TODO: SONG_JUMPTO_TYPE_DESC=Search for: -;TODO: SONG_JUMPTO_TYPE1=All -;TODO: SONG_JUMPTO_TYPE2=Title -;TODO: SONG_JUMPTO_TYPE3=Artist -;TODO: SONG_JUMPTO_SONGSFOUND=%d Song(s) found -;TODO: SONG_JUMPTO_NOSONGSFOUND=No Song found -;TODO: SONG_JUMPTO_HELP=Type Text to Search for -;TODO: SONG_JUMPTO_CATTEXT=Search for: %s +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley -;TODO: PARTY_MODE=party mode +;TODO: SONG_MENU_NAME_SONG=Song Menu +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +;TODO: SONG_MENU_ADD_SONG=Add Song +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +;TODO: SONG_MENU_DELETE_SONG=Delete song +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? + +;TODO: PARTY_MODE=Party mode ;TODO: PARTY_DIFFICULTY=Difficulty ;TODO: PARTY_PLAYLIST=Playlist Mode ;TODO: PARTY_PLAYLIST_ALL=All songs ;TODO: PARTY_PLAYLIST_CATEGORY=Folder ;TODO: PARTY_PLAYLIST_PLAYLIST=Playlist -;TODO: PARTY_TEAMS=number of teams -;TODO: PARTY_TEAMS_PLAYER1=num. of singers -;TODO: PARTY_TEAMS_PLAYER2=num. of singers -;TODO: PARTY_TEAMS_PLAYER3=num. of singers +;TODO: PARTY_TEAMS=Number of teams +;TODO: PARTY_TEAMS_PLAYER1=Num. of singers +;TODO: PARTY_TEAMS_PLAYER2=Num. of singers +;TODO: PARTY_TEAMS_PLAYER3=Num. of singers -;TODO: PARTY_LEGEND_CONTINUE=continue +;TODO: PARTY_LEGEND_CONTINUE=Continue -;TODO: PARTY_OPTIONS_DESC=settings for the party-game +;TODO: PARTY_OPTIONS_DESC=Settings for the party-game ;TODO: PARTY_OPTIONS_WHEREAMI=Party Options -;TODO: PARTY_PLAYER_DESC=enter player- and teamnames! -;TODO: PARTY_PLAYER_WHEREAMI=Party Names -;TODO: PARTY_PLAYER_ENTER_NAME=enter names +;TODO: PARTY_PLAYER_ENTER_NAME=Enter names +;TODO: PARTY_ROUNDS_LEGEND_CONTINUE=Start party-game +;TODO: PARTY_ROUNDCOUNT=Number of rounds +;TODO: PARTY_SELECTMODE=Round %d -;TODO: PARTY_ROUNDS_DESC=select which modes you want to play -;TODO: PARTY_ROUNDS_WHEREAMI=Party Rounds -;TODO: PARTY_ROUNDS_LEGEND_CONTINUE=start party-game -;TODO: PARTY_ROUNDCOUNT=number of rounds -;TODO: PARTY_SELECTMODE1=mode round 1 -;TODO: PARTY_SELECTMODE2=mode round 2 -;TODO: PARTY_SELECTMODE3=mode round 3 -;TODO: PARTY_SELECTMODE4=mode round 4 -;TODO: PARTY_SELECTMODE5=mode round 5 -;TODO: PARTY_SELECTMODE6=mode round 6 -;TODO: PARTY_SELECTMODE7=mode round 7 +;TODO: PARTY_ROUND_LEGEND_CONTINUE=Start round -;TODO: PARTY_ROUND_DESC=next players to the mics -;TODO: PARTY_ROUND_WHEREAMI=Party Next Round -;TODO: PARTY_ROUND_LEGEND_CONTINUE=start round +;TODO: PARTY_SONG_WHEREAMI=Party song-selection +;TODO: PARTY_SONG_LEGEND_CONTINUE=Sing +;TODO: PARTY_SONG_MENU=Party menu -;TODO: PARTY_SONG_WHEREAMI=Party Song-Selection -;TODO: PARTY_SONG_LEGEND_CONTINUE=sing -;TODO: PARTY_SONG_MENU=party menu +;TODO: OPTION_VALUE_SING=Sing +;TODO: OPTION_VALUE_SELECT_PLAYERS=Select players +;TODO: OPTION_VALUE_OPEN_MENU=Open Menu -;TODO: PARTY_SCORE_DESC=score of the last round -;TODO: PARTY_SCORE_WHEREAMI=Party Points +;TODO: PARTY_SCORE_DESC=Score of the last round +;TODO: PARTY_SCORE_WHEREAMI=Party points -;TODO: PARTY_WIN_DESC=winner of the party-game -;TODO: PARTY_WIN_WHEREAMI=Party Winner -;TODO: PARTY_WIN_LEGEND_CONTINUE=back to main-menu +;TODO: PARTY_WIN_DESC=Winner of the party-game +;TODO: PARTY_WIN_WHEREAMI=Party winner +;TODO: PARTY_WIN_LEGEND_CONTINUE=Back to main-menu ;TODO: PARTY_ROUND=Round ;TODO: PARTY_ROUND_WINNER=Winner -;TODO: PARTY_NOTPLAYEDYET=not played yet -;TODO: PARTY_NOBODY=nobody +;TODO: PARTY_NOTPLAYEDYET=Not played yet +;TODO: PARTY_NOBODY=Nobody ;TODO: NEXT_ROUND=Next round: ;TODO: PARTY_DISMISSED=Dismissed! ;TODO: PARTY_SCORE_WINS=%s -;TODO: PARTY_SCORE_WINS2=wins! +;TODO: PARTY_SCORE_WINS2=Wins! -;TODO: MODE_RANDOM_NAME=Random Mode -;TODO: MODE_RANDOM_DESC=One mode will be choosen randomly +;TODO: MODE_RANDOM_NAME=Random mode +;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! ;TODO: MODE_HOLDTHELINE_NAME=Hold the Line -;TODO: MODE_HOLDTHELINE_DESC=Don't get worse than the pointer at the rating bar shows you. +;TODO: MODE_HOLDTHELINE_DESC=Keep your rating above the line for the longest! + +;TODO: MODE_HOLDTHELINEBLIND_NAME=Hold the Blind +;TODO: MODE_HOLDTHELINEBLIND_DESC=Keep your rating above the line for the longest, but with the notes hidden! + +;TODO: MODE_7000POINTS_NAME=Until 7000 +;TODO: MODE_7000POINTS_DESC=Race to 7000 Points! + +;TODO: MODE_7000POINTSBLIND_NAME=Blind 7000 +;TODO: MODE_7000POINTSBLIND_DESC=Race to 7000 points, but without seeing the notes! ;TODO: MODE_5000POINTS_NAME=Until 5000 -;TODO: MODE_5000POINTS_DESC=Who gets 5000 points first wins the match. +;TODO: MODE_5000POINTS_DESC=Race to 5000 Points! + +;TODO: MODE_5000POINTSBLIND_NAME=Blind 5000 +;TODO: MODE_5000POINTSBLIND_DESC=Race to 5000 points, but without seeing the notes! + +;TODO: MODE_2000POINTS_NAME=Until 2000 +;TODO: MODE_2000POINTS_DESC=Race to 2000 Points! + +;TODO: MODE_2000POINTSBLIND_NAME=Blind 2000 +;TODO: MODE_2000POINTSBLIND_DESC=Race to 2000 points, but without seeing the notes! ;TODO: MODE_DUEL_NAME=Duel -;TODO: MODE_DUEL_DESC=Sing a duel until 10000 points. +;TODO: MODE_DUEL_DESC=A 1v1 duel to get the highest score! -;TODO: MODE_TEAMDUEL_NAME=Team Duell -;TODO: MODE_TEAMDUEL_DESC=Pass The Mic! +;TODO: MODE_TEAMDUEL_NAME=Team Duel +;TODO: MODE_TEAMDUEL_DESC=Pass The Mic! Work together to get a higher score than the other team! ;TODO: MODE_BLIND_NAME=Blind Mode -;TODO: MODE_BLIND_DESC=Duel without seeing the notes. +;TODO: MODE_BLIND_DESC=A 1v1 duel, but with the notes hidden! + +;TODO: MODE_BLINDTOTAL_NAME=Total Darkness! +;TODO: MODE_BLINDTOTAL_DESC=A duel, but with the notes and the lyrics hidden. Only for the brave! + +;TODO: MODE_1000BLIND_NAME = +1000 Blind +;TODO: MODE_1000BLIND_DESC = Gain a lead of more than 1000 points, but without seeing the notes! + +;TODO: MODE_DEAF_NAME = Deaf +;TODO: MODE_DEAF_DESC = Think you know the notes? Can you sing it without the acompaniment? + +;TODO: MODE_BLINDLYRICS_NAME = No Lyrics +;TODO: MODE_BLINDLYRICS_DESC = Think you know all the lyrics? Sing with the lyrics hidden! + +;TODO: MODE_500BLIND_NAME = +500 Blind +;TODO: MODE_500BLIND_DESC = Gain a lead of more than 500 points, but without seeing the notes! + +;TODO: MODE_SHORTSONG_NAME = Short Song +;TODO: MODE_SHORTSONG_DESC = A fast-paced 1v1 duel over half the song! + +;TODO: MODE_HARDCORE_NAME=Hardcore +;TODO: MODE_HARDCORE_DESC=Battle for a three-line lead on your opponent! ;TODO: STAT_MAIN=Statistics -;TODO: STAT_MAIN_DESC=General -;TODO: STAT_MAIN_WHEREAMI=Statistics ;TODO: STAT_OVERVIEW_INTRO=%0:s Statistics. \n Last Reset at %2:.2d.%1:.2d.%3:d ;TODO: STAT_OVERVIEW_SONG=%0:d Songs(%3:d with Video), whereof %1:d already were played and %2:d were not played yet.\n The most popular Song is %5:s from %4:s. @@ -346,52 +481,205 @@ TODO: LANGUAGE=Language ;TODO: STAT_FORMAT_DATE=%1:.2d.%0:.2d.%2:d ;TODO: STAT_DETAIL=Statistics -;TODO: STAT_DETAIL_WHEREAMI=Detail Statistics +;TODO: STAT_DETAIL_WHEREAMI=Detail statistics -;TODO: STAT_NEXT=Next Page -;TODO: STAT_PREV=Previous Page -;TODO: STAT_REVERSE=Reverse Order -;TODO: STAT_PAGE=page %0:d of %1:d pages\n (%2:d of %3:d Entrys) +;TODO: STAT_NEXT=Next page +;TODO: STAT_PREV=Previous page +;TODO: STAT_REVERSE=Reverse order +;TODO: STAT_PAGE=Page %0:d of %1:d \n Entries %2:d of %3:d ;TODO: STAT_DESC_SCORES=HighScores ;TODO: STAT_DESC_SCORES_REVERSED=LowScores ;TODO: STAT_FORMAT_SCORES=%0:s - %1:d [%2:s] %5:s \n (%3:s - %4:s) -;TODO: STAT_DESC_SINGERS=Best Singers -;TODO: STAT_DESC_SINGERS_REVERSED=Worst Singers -;TODO: STAT_FORMAT_SINGERS=%0:s \n Average Score: %1:d +;TODO: STAT_DESC_SINGERS=Best singers +;TODO: STAT_DESC_SINGERS_REVERSED=Worst singers +;TODO: STAT_FORMAT_SINGERS=%0:s \n Average score: %1:d -;TODO: STAT_DESC_SONGS=Most popular Songs -;TODO: STAT_DESC_SONGS_REVERSED=Least popular Songs +;TODO: STAT_DESC_SONGS=Most popular songs +;TODO: STAT_DESC_SONGS_REVERSED=Least popular songs ;TODO: STAT_FORMAT_SONGS=%0:s - %1:s \n %2:dx sung -;TODO: STAT_DESC_BANDS=Most popular Bands -;TODO: STAT_DESC_BANDS_REVERSED=Least popular Bands +;TODO: STAT_DESC_BANDS=Most popular bands +;TODO: STAT_DESC_BANDS_REVERSED=Least popular bands ;TODO: STAT_FORMAT_BANDS=%0:s \n %1:dx Sung -;TODO: SCREENSHOT_SAVED=Screenshot saved -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: PARTY_SELECT_MODE=Mode +;TODO: PARTY_MODE_CLASSIC=Classic +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free +;TODO: PARTY_MODE_CHALLENGE=Challenge +;TODO: PARTY_MODE_TOURNAMENT=Tournament +;TODO: PARTY_MODE_JUKEBOX=Jukebox + +;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players +;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds +;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final +;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals +;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_4FINAL=Quarterfinals +;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_8FINAL=Round of 16 +;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Next players to the mics +;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result +;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! + +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? +;TODO: JUKEBOX_RANDOM=Random +;TODO: JUKEBOX_REPEAT=Repeat +;TODO: JUKEBOX_FIND=Find: +;TODO: JUKEBOX_SORT=Sort: +;TODO: JUKEBOX_SONGLIST=List of songs + +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection +;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! + +;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s +;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! + +;TODO: SING_SONGS_MYSCORES=My scores + +;TODO: NAME_PLAYERS_COUNT=Number of players +;TODO: NAME_CURRENT_PLAYER=Player + +;TODO: JUKEBOX_MODE=Jukebox mode + +;TODO: ABOUT_MAIN=About... +;TODO: ABOUT_USDX_DEVELOPEDBY=Developed by +;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... +;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available +;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection +;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org + +;TODO: DEVELOPERS_TITLE=Developed by +;TODO: DEVELOPERS_OVERVIEW=People who has contributed to this project:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Visit us for more information.\n\nhttps://ultrastar-es.org -;TODO: INFO_FILE_SAVED=File saved -;TODO: ERROR_SAVE_FILE_FAILED=Couldn''t save file -;TODO: ERROR_FILE_NOT_FOUND=File not found - -;TODO: ENCODING_ERROR_ASK_FOR_UTF8=Cannot save changes in current encoding. Convert to UTF-8? +;TODO: SCREENSHOT_SAVED=Screenshot saved +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot ;TODO: MSG_ERROR_TITLE=Error ;TODO: MSG_INFO_TITLE=Information ;TODO: MSG_QUESTION_TITLE=Question ;TODO: MSG_QUIT_USDX=Really leave UltraStar? -;TODO: MSG_END_PARTY=Really leave Party Mode? +;TODO: MSG_END_PARTY=Really leave party mode? -;TODO: ERROR_NO_SONGS=No Songs loaded -;TODO: ERROR_NO_PLUGINS=No Plugins loaded -;TODO: ERROR_NO_MODES_FOR_CURRENT_SETUP=no modes available for current player/team setup -;TODO: ERROR_CAN_NOT_START_PARTY=an error occurred starting the party game +;TODO: ERROR_NO_SONGS=No songs loaded +;TODO: ERROR_NO_PLUGINS=No plugins loaded +;TODO: ERROR_LOADING_SONGS=Wait for loading all the songs ;TODO: ERROR_CORRUPT_SONG=Song could not be loaded. ;TODO: ERROR_CORRUPT_SONG_FILE_NOT_FOUND=Song could not be loaded: File not found ;TODO: ERROR_CORRUPT_SONG_NO_NOTES=Song could not be loaded: Can''t find any notes ;TODO: ERROR_CORRUPT_SONG_NO_BREAKS=Song could not be loaded: Can''t find any linebreaks ;TODO: ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Song could not be loaded: Error parsing line %0:d -;TODO: ERROR_PLAYER_DEVICE_ASSIGNMENT=Player %d is assigned to multiple microphones. Please check your record options -;TODO: ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Player %d is not assigned to a microphone. Please check your record options +;TODO: ERROR_PLAYER_DEVICE_ASSIGNMENT=Player %d is assigned to multiple microphones. Please check your microphone options +;TODO: ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Player %d is not assigned to a microphone. Please check your microphone options + + +;TODO: C_ABOUT=About... +;TODO: C_ADVANCED=Advanced +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +;TODO: C_BACK=Back +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +;TODO: C_COLOR_BLACK=Black +;TODO: C_COLOR_BLUE=Blue +;TODO: C_COLOR_BROWN=Brown +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +;TODO: C_COLOR_GRAY=Gray +;TODO: C_COLOR_GREEN=Green +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +;TODO: C_COLOR_MAGENTA=Magenta +;TODO: C_COLOR_ORANGE=Orange +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +;TODO: C_COLOR_PINK=Pink +;TODO: C_COLOR_PLUM=Plum +;TODO: C_COLOR_RED=Red +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +;TODO: C_COLOR_VIOLET=Violet +;TODO: C_COLOR_WHITE=White +;TODO: C_COLOR_YELLOW=Yellow +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +;TODO: C_GAME=Game +;TODO: C_GRAPHICS=Graphics + +;TODO: C_INFORMATION=Information +;TODO: C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +;TODO: C_LYRICS=Lyrics + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +;TODO: C_MICROPHONES=Microphones +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +;TODO: C_SOUND=Sound +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +;TODO: C_THEMES=Themes +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes diff --git "a/game/languages/Lietuvi\305\263.ini" "b/game/languages/Lietuvi\305\263.ini" index f4e1f504..debafdee 100644 --- "a/game/languages/Lietuvi\305\263.ini" +++ "b/game/languages/Lietuvi\305\263.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Lietuvių +LANGUAGE_ISO_CODE=lt SING_LOADING=Kraunasi... SING_LOADING_SONGS=Įkeliamos dainos iš aplanko %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Sunku SING_OPTIONS=Galimybės -SING_OPTIONS_GAME=Žaidimas -SING_OPTIONS_GRAPHICS=Grafika -SING_OPTIONS_SOUND=Garsas -SING_OPTIONS_LYRICS=Dainos žodžiai -SING_OPTIONS_THEMES=Temos -SING_OPTIONS_MICROPHONES=Įrašyti -SING_OPTIONS_ADVANCED=Išplėstinė -SING_OPTIONS_NETWORK=Internetas -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Atgal - SING_OPTIONS_GAME_LANGUAGE=Kalba SING_OPTIONS_GAME_SONGMENU=Daina Meniu ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Skirtukai SING_OPTIONS_GAME_SORTING=Rūšiavimas -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Kontrolieriaus palaikymas OPTION_VALUE_ROULETTE=Ruletė @@ -80,12 +70,12 @@ OPTION_VALUE_YEAR=Metai OPTION_VALUE_DECADE=Dešimtmetis OPTION_VALUE_PLAYLIST=Grojaraštis -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Visas ekranas SING_OPTIONS_GRAPHICS_RESOLUTION=Rezoliucija SING_OPTIONS_GRAPHICS_SCREENFADE=Ekrano blukimas -;TODO: SING_OPTIONS_GRAPHICS_EFFECTSING=Sing Effects +;TODO: SING_OPTIONS_GRAPHICS_EFFECTSING=Sing effects SING_OPTIONS_GRAPHICS_VISUALIZER=Vizualizacija SING_OPTIONS_GRAPHICS_MOVIE_SIZE=Filmo dydis @@ -153,7 +143,7 @@ OPTION_VALUE_PLAYER=Žaidėjas ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Vartotojo vardas SING_OPTIONS_NETWORK_PASSWORD=Slaptažodis -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Žaidėjas SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Siųsti (Lengva) @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Atšaukti WEBSITE_LOGIN_ERROR=Neteisingas prisijungimas! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ WEBSITE_LOGIN_ERROR=Neteisingas prisijungimas! ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites SONG_MENU_REFRESH_SCORES_ALL_SONGS=Visos dainos SONG_MENU_REFRESH_SCORES_ONLY_SONG=Ši daina ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: SONG_SCORE_MEDIA=Vidurkis: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score SCORE_SEND=Siųsti SCORE_SEND_PLAYER=Žaidėjas -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Parsisiųsti SCORE_DOWNLOAD_SONG=Daina: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Atšaukti SCORE_DOWNLOAD_OK=Gerai @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_BRIGHTNESS=Ryškumas SING_OPTIONS_WEBCAM_EFFECT=Efektas ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normalus ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Slenkstis ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Mėlyna JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Pozicija ;TODO: OPTION_VALUE_TO_SING=Sing -OPTION_VALUE_ACTUAL=Viršutinė -OPTION_VALUE_NEXT=Apatinė +OPTION_VALUE_TOP=Viršutinė +OPTION_VALUE_BOTTOM=Apatinė ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Mėlynas -OPTION_VALUE_GREEN=Žalias -OPTION_VALUE_PINK=Rožinis -OPTION_VALUE_RED=Raudonas -OPTION_VALUE_VIOLET=Violetinis -OPTION_VALUE_ORANGE=Oranžinis -OPTION_VALUE_YELLOW=Geltonas -OPTION_VALUE_BROWN=Rudas -OPTION_VALUE_BLACK=Juodas -;TODO: OPTION_VALUE_MAGENTA=Magenta -;TODO: OPTION_VALUE_GRAY=Gray -OPTION_VALUE_WHITE=Balta -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -OPTION_VALUE_LAVENDER=Levanda -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -OPTION_VALUE_CHOCOLATE=Šokoladas -OPTION_VALUE_GOLD=Auksas -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -OPTION_VALUE_SKY=Dangus -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Pasirinkite SING_LEGEND_NAVIGATE=Naršyti @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Grojaraštis SING_SONG_IN_CAT=Daina SING_SONGS_IN_CAT=Dainos PLAYLIST_CATTEXT=Grojaraštis: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legenda -SING_SONG_SELECTION_LEGEND_VIDEO=Vaizdo įrašas -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duetas SING_TOTAL=Iš viso SING_MODE=Dainuoti solo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= ir SONG_MENU_NAME_MAIN=Dainų meniu SONG_MENU_PLAY=Dainuoti SONG_MENU_CHANGEPLAYERS=Keisti žaidėjus -SONG_MENU_CANCEL=Atšaukti SONG_MENU_NAME_PLAYLIST=Dainų meniu SONG_MENU_PLAYLIST_ADD=Pridėti dainą @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Paimk jokerį -SONG_JUMPTO_DESC=Ieškoti dainos -SONG_JUMPTO_TYPE_DESC=Ieškoti: +SONG_MENU_LEGEND_TITLE=Legenda +SONG_MENU_LEGEND_VIDEO=Vaizdo įrašas +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duetas +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Daina +;TODO: SONG_MENU_MEDLEY=Medley + +;TODO: SONG_MENU_NAME_SONG=Song Menu +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +;TODO: SONG_MENU_ADD_SONG=Add Song +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +;TODO: SONG_MENU_DELETE_SONG=Delete song +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? ;TODO: PARTY_MODE=Party mode ;TODO: PARTY_DIFFICULTY=Difficulty @@ -405,7 +390,7 @@ PARTY_PLAYER_ENTER_NAME=Įveskite pavadinimus ;TODO: PARTY_ROUND_LEGEND_CONTINUE=Start round -;TODO: PARTY_SONG_WHEREAMI=Party Song-Selection +;TODO: PARTY_SONG_WHEREAMI=Party song-selection ;TODO: PARTY_SONG_LEGEND_CONTINUE=Sing ;TODO: PARTY_SONG_MENU=Party menu @@ -414,10 +399,10 @@ OPTION_VALUE_SELECT_PLAYERS=Pasirinkite žaidėjus OPTION_VALUE_OPEN_MENU=Atidarykite meniu ;TODO: PARTY_SCORE_DESC=Score of the last round -;TODO: PARTY_SCORE_WHEREAMI=Party Points +;TODO: PARTY_SCORE_WHEREAMI=Party points ;TODO: PARTY_WIN_DESC=Winner of the party-game -;TODO: PARTY_WIN_WHEREAMI=Party Winner +;TODO: PARTY_WIN_WHEREAMI=Party winner ;TODO: PARTY_WIN_LEGEND_CONTINUE=Back to main-menu ;TODO: PARTY_ROUND=Round @@ -430,7 +415,7 @@ PARTY_NOBODY=Niekas ;TODO: PARTY_SCORE_WINS=%s ;TODO: PARTY_SCORE_WINS2=Wins! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! ;TODO: MODE_HOLDTHELINE_NAME=Hold the Line @@ -469,16 +454,16 @@ MODE_BLIND_NAME=Aklųjų režimas ;TODO: MODE_BLINDTOTAL_NAME=Total Darkness! ;TODO: MODE_BLINDTOTAL_DESC=A duel, but with the notes and the lyrics hidden. Only for the brave! -MODE_1000BLIND_NAME = +1000 Aklas +MODE_1000BLIND_NAME= +1000 Aklas ;TODO: MODE_1000BLIND_DESC = Gain a lead of more than 1000 points, but without seeing the notes! ;TODO: MODE_DEAF_NAME = Deaf ;TODO: MODE_DEAF_DESC = Think you know the notes? Can you sing it without the acompaniment? -MODE_BLINDLYRICS_NAME = Nėra dainų +MODE_BLINDLYRICS_NAME= Nėra dainų ;TODO: MODE_BLINDLYRICS_DESC = Think you know all the lyrics? Sing with the lyrics hidden! -MODE_500BLIND_NAME = +500 Aklas +MODE_500BLIND_NAME= +500 Aklas ;TODO: MODE_500BLIND_DESC = Gain a lead of more than 500 points, but without seeing the notes! ;TODO: MODE_SHORTSONG_NAME = Short Song @@ -496,7 +481,7 @@ STAT_MAIN=Statistika ;TODO: STAT_FORMAT_DATE=%1:.2d.%0:.2d.%2:d STAT_DETAIL=Statistika -;TODO: STAT_DETAIL_WHEREAMI=Detail Statistics +;TODO: STAT_DETAIL_WHEREAMI=Detail statistics STAT_NEXT=Kitas puslapis STAT_PREV=Ankstesnis puslapis @@ -508,26 +493,26 @@ STAT_REVERSE=Atvirkštinė tvarka ;TODO: STAT_FORMAT_SCORES=%0:s - %1:d [%2:s] %5:s \n (%3:s - %4:s) STAT_DESC_SINGERS=Geriausi dainininkai -;TODO: STAT_DESC_SINGERS_REVERSED=Worst Singers -;TODO: STAT_FORMAT_SINGERS=%0:s \n Average Score: %1:d +;TODO: STAT_DESC_SINGERS_REVERSED=Worst singers +;TODO: STAT_FORMAT_SINGERS=%0:s \n Average score: %1:d STAT_DESC_SONGS=Populiariausi dainos -;TODO: STAT_DESC_SONGS_REVERSED=Least popular Songs +;TODO: STAT_DESC_SONGS_REVERSED=Least popular songs ;TODO: STAT_FORMAT_SONGS=%0:s - %1:s \n %2:dx sung -;TODO: STAT_DESC_BANDS=Most popular Bands -;TODO: STAT_DESC_BANDS_REVERSED=Least popular Bands +;TODO: STAT_DESC_BANDS=Most popular bands +;TODO: STAT_DESC_BANDS_REVERSED=Least popular bands ;TODO: STAT_FORMAT_BANDS=%0:s \n %1:dx Sung ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free PARTY_MODE_CHALLENGE=Iššūkis PARTY_MODE_TOURNAMENT=Turnyras ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,36 +522,21 @@ PARTY_MODE_TOURNAMENT=Turnyras ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random JUKEBOX_REPEAT=Pakartokite JUKEBOX_FIND=Rasti: JUKEBOX_SORT=Rūšiuoti: -;TODO: JUKEBOX_SONGLIST=List of Songs - -SONG_MENU_SONG=Daina -;TODO: SONG_MENU_MEDLEY=Medley +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: SONG_MENU_NAME_SONG=Song Menu -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -;TODO: SONG_MENU_ADD_SONG=Add Song -;TODO: SONG_MENU_DELETE_SONG=Delete Song -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Žaidėjų skaičius NAME_CURRENT_PLAYER=Žaidėjas @@ -584,16 +554,16 @@ DEVELOPERS_TITLE=Sukurta DEVELOPERS_OVERVIEW=Žmonės, prisidėję prie šio projekto:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Visit us for more information.\n\nhttps://ultrastar-es.org ;TODO: SCREENSHOT_SAVED=Screenshot saved -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot MSG_ERROR_TITLE=Klaida ;TODO: MSG_INFO_TITLE=Information ;TODO: MSG_QUESTION_TITLE=Question ;TODO: MSG_QUIT_USDX=Really leave UltraStar? -;TODO: MSG_END_PARTY=Really leave Party Mode? +;TODO: MSG_END_PARTY=Really leave party mode? -;TODO: ERROR_NO_SONGS=No Songs loaded -;TODO: ERROR_NO_PLUGINS=No Plugins loaded +;TODO: ERROR_NO_SONGS=No songs loaded +;TODO: ERROR_NO_PLUGINS=No plugins loaded ERROR_LOADING_SONGS=Wait for loading all the songs ;TODO: ERROR_CORRUPT_SONG=Song could not be loaded. ;TODO: ERROR_CORRUPT_SONG_FILE_NOT_FOUND=Song could not be loaded: File not found @@ -602,3 +572,118 @@ ERROR_LOADING_SONGS=Wait for loading all the songs ;TODO: ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Song could not be loaded: Error parsing line %0:d ;TODO: ERROR_PLAYER_DEVICE_ASSIGNMENT=Player %d is assigned to multiple microphones. Please check your microphone options ;TODO: ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Player %d is not assigned to a microphone. Please check your microphone options + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Išplėstinė +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Atgal +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Juodas +C_COLOR_BLUE=Mėlynas +C_COLOR_BROWN=Rudas +;TODO: C_COLOR_CYAN=Cyan +C_COLOR_CHOCOLATE=Šokoladas +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +C_COLOR_GOLD=Auksas +;TODO: C_COLOR_GRAY=Gray +C_COLOR_GREEN=Žalias +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +C_COLOR_LAVENDER=Levanda +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Oranžinis +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Rožinis +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Raudonas +;TODO: C_COLOR_SALMON=Salmon +C_COLOR_SKY=Dangus +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=Violetinis +C_COLOR_WHITE=Balta +C_COLOR_YELLOW=Geltonas +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Žaidimas +C_GRAPHICS=Grafika + +;TODO: C_INFORMATION=Information +C_INTERNET=Internetas + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Dainos žodžiai + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Įrašyti +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Garsas +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Temos +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/L\303\253tzebuergesch.ini" "b/game/languages/L\303\253tzebuergesch.ini" index 2f76a02d..74d62c28 100644 --- "a/game/languages/L\303\253tzebuergesch.ini" +++ "b/game/languages/L\303\253tzebuergesch.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Lëtzebuergesch +LANGUAGE_ISO_CODE=lb SING_LOADING=Lueden... ;TODO: SING_LOADING_SONGS=Loading songs from folder %s @@ -40,29 +41,18 @@ OPTION_VALUE_HARD=Schwéier SING_OPTIONS=Optiounen -SING_OPTIONS_GAME=Spill -SING_OPTIONS_GRAPHICS=Graphik -SING_OPTIONS_SOUND=Toun -SING_OPTIONS_LYRICS=Lyric -SING_OPTIONS_THEMES=Design -SING_OPTIONS_MICROPHONES=Mikro -SING_OPTIONS_ADVANCED=Erweidert -;TODO: SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Zeréck - SING_OPTIONS_GAME_LANGUAGE=Sprooch SING_OPTIONS_GAME_SONGMENU=Menü ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Ordner SING_OPTIONS_GAME_SORTING=Zortéieren no -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Aktivéieren gamepad ;TODO: OPTION_VALUE_ROULETTE=Roulette ;TODO: OPTION_VALUE_CHESSBOARD=Chessboard ;TODO: OPTION_VALUE_CAROUSEL=Carousel -;TODO: OPTION_VALUE_SLOT_MACHINE=Slot Machine +;TODO: OPTION_VALUE_SLOT_MACHINE=Slot machine ;TODO: OPTION_VALUE_LIST=List ;TODO: OPTION_VALUE_MOSAIC=Tile @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Joer OPTION_VALUE_DECADE=Joerzéngt OPTION_VALUE_PLAYLIST=Playlist -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Vollbild SING_OPTIONS_GRAPHICS_RESOLUTION=Ofléisung @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Mikro lauschteren SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Hannergrondmusik SING_OPTIONS_SOUND_CLICK_ASSIST=Click-Assistent SING_OPTIONS_SOUND_BEAT_CLICK=Metronom -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Iwwerbléck Lautst. SING_OPTIONS_SOUND_PREVIEWFADING=Iwwerbléck Fading @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=No Liddauswiel SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Sécherheetsfro SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto Partymenü ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Alles ;TODO: OPTION_VALUE_PLAYER=Player @@ -153,12 +143,12 @@ OPTION_VALUE_ALL=Alles ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website ;TODO: SING_OPTIONS_NETWORK_USERNAME=Username ;TODO: SING_OPTIONS_NETWORK_PASSWORD=Password -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name SING_OPTIONS_NETWORK_AUTO_MODE=Automatesch ;TODO: SING_OPTIONS_NETWORK_AUTO_PLAYER=Player -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Offbriechen ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Offbriechen ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send ;TODO: SCORE_SEND_PLAYER=Player -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Offbriechen ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,22 +220,22 @@ SING_OPTIONS_WEBCAM_RESOLUTION=Ofléisung SING_OPTIONS_WEBCAM_EFFECT=Effekt ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Rauschënnerdrëck. ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode -;TODO: JUKEBOX_SONGOPTIONS_LYRIC_ALPHA=Alpha +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_ALPHA=Transparency ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_LINE=Line ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_PROPERTY=Property JUKEBOX_SONGOPTIONS_LYRIC_COLOR=Faarf @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Blo ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Sangen -;TODO: OPTION_VALUE_ACTUAL=Actual -;TODO: OPTION_VALUE_NEXT=Next +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Blo -OPTION_VALUE_GREEN=Gréng -OPTION_VALUE_PINK=Rosa -OPTION_VALUE_RED=Rout -OPTION_VALUE_VIOLET=Violett -OPTION_VALUE_ORANGE=Orange -OPTION_VALUE_YELLOW=Giel -OPTION_VALUE_BROWN=Brong -OPTION_VALUE_BLACK=Schwaarz -;TODO: OPTION_VALUE_MAGENTA=Magenta -;TODO: OPTION_VALUE_GRAY=Gray -;TODO: OPTION_VALUE_WHITE=White -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Auswielen SING_LEGEND_NAVIGATE=Navigéieren @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Playlist SING_SONG_IN_CAT=Lidd SING_SONGS_IN_CAT=Lidder PLAYLIST_CATTEXT=Playlist: %s -;TODO: SING_SONG_SELECTION_LEGEND_TITLE=Legend -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -;TODO: SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Am Ganzen SING_MODE=Sangmodus @@ -348,7 +306,6 @@ IMPLODE_GLUE2= an SONG_MENU_NAME_MAIN=Menü SONG_MENU_PLAY=Sangen SONG_MENU_CHANGEPLAYERS=Spiller tauschen -SONG_MENU_CANCEL=Offbriechen SONG_MENU_NAME_PLAYLIST=Menü SONG_MENU_PLAYLIST_ADD=Lidd bäifügen @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Joker asetzen -SONG_JUMPTO_DESC=Sichen no -SONG_JUMPTO_TYPE_DESC=Sichen no: +;TODO: SONG_MENU_LEGEND_TITLE=Legend +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +;TODO: SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Menü +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Lidd bäifügen +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Lidd läschen +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Partymodus PARTY_DIFFICULTY=Schwieregkeet @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n Lidder gesongen: %1:d ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Unzuel vu Ronnen ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,47 +522,32 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Déi nächst Spiller un är Mikroen! ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Menü -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Lidd bäifügen -SONG_MENU_DELETE_SONG=Lidd läschen -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! -;TODO: NAME_PLAYERS_COUNT=Number of Players +;TODO: SING_SONGS_MYSCORES=My scores + +;TODO: NAME_PLAYERS_COUNT=Number of players ;TODO: NAME_CURRENT_PLAYER=Player -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Iwwer... ;TODO: ABOUT_USDX_DEVELOPEDBY=Developed by ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org ;TODO: DEVELOPERS_TITLE=Developed by @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Lidd gëtt net gelueden: Et goufe keng Saazwiessel ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Lidd gëtt net gelueden: Feeler beim Parze vun der Zeil %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=De Spiller %d huet ze vill Mikroe gewielt. Iwwerpréift d'Opzeechnungsoptiounen. ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=De Spiller %d huet kee Mikro gewielt. Iwwerpréift d'Opzeechnungsoptiounen. + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Erweidert +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Zeréck +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Schwaarz +C_COLOR_BLUE=Blo +C_COLOR_BROWN=Brong +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +;TODO: C_COLOR_GRAY=Gray +C_COLOR_GREEN=Gréng +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Orange +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Rosa +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Rout +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=Violett +;TODO: C_COLOR_WHITE=White +C_COLOR_YELLOW=Giel +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Spill +C_GRAPHICS=Graphik + +;TODO: C_INFORMATION=Information +;TODO: C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Lyric + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Mikro +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Toun +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Design +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Magyar.ini b/game/languages/Magyar.ini index ba2635c8..2a940695 100644 --- a/game/languages/Magyar.ini +++ b/game/languages/Magyar.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Magyar +LANGUAGE_ISO_CODE=hu SING_LOADING=Betöltés... SING_LOADING_SONGS=Dalok betöltése %s @@ -40,17 +41,6 @@ OPTION_VALUE_HARD=Nehéz SING_OPTIONS=Beállítások -SING_OPTIONS_GAME=Játék -SING_OPTIONS_GRAPHICS=Grafika -SING_OPTIONS_SOUND=Hang -SING_OPTIONS_LYRICS=Dalszöveg -SING_OPTIONS_THEMES=Témák -SING_OPTIONS_MICROPHONES=Mikrofonok -SING_OPTIONS_ADVANCED=Haladó -SING_OPTIONS_NETWORK=Internet -SING_OPTIONS_WEBCAM=Webkamera -SING_OPTIONS_EXIT=Vissza - SING_OPTIONS_GAME_LANGUAGE=Nyelv SING_OPTIONS_GAME_SONGMENU=Dal Menü SING_OPTIONS_GAME_DUETS=Duett @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC=Dalszöveg beállítások JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Pozíció OPTION_VALUE_TO_SING=Énekelt szöveg -OPTION_VALUE_ACTUAL=Aktuális sor -OPTION_VALUE_NEXT=Következő sor +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom OPTION_VALUE_OTHER=Egyéb OPTION_VALUE_FILL=Egyszerű OPTION_VALUE_OUTLINE=Körvonal -OPTION_VALUE_BLUE=Kék -OPTION_VALUE_GREEN=Zöld -OPTION_VALUE_PINK=Rózsaszín -OPTION_VALUE_RED=Piros -OPTION_VALUE_VIOLET=Lila -OPTION_VALUE_ORANGE=Narancs -OPTION_VALUE_YELLOW=Sárga -OPTION_VALUE_BROWN=Barna -OPTION_VALUE_BLACK=Fekete -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Szürke -OPTION_VALUE_WHITE=Fehér -OPTION_VALUE_TURQUOISE=Türkiz -OPTION_VALUE_SALMON=Vörösessárga -OPTION_VALUE_GREENYELLOW=Sárgászöld -OPTION_VALUE_LAVENDER=Levendulakék -OPTION_VALUE_BEIGE=Bézs -OPTION_VALUE_TEAL=Kékeszöld -OPTION_VALUE_ORCHID=Orgonalila -OPTION_VALUE_STEELBLUE=Acélkék -OPTION_VALUE_PLUM=Pasztelpink -OPTION_VALUE_CHOCOLATE=Csokoládébarna -OPTION_VALUE_GOLD=Aranysárga -OPTION_VALUE_DARKBLUE=Sötétkék -OPTION_VALUE_SKY=Égszínkék -OPTION_VALUE_HARLEQUIN=Limezöld -OPTION_VALUE_CYAN=Ciánkék -OPTION_VALUE_FLAME=Tűzvörös + SING_LEGEND_SELECT=Választás SING_LEGEND_NAVIGATE=Navigálás @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Számlista SING_SONG_IN_CAT=Dal SING_SONGS_IN_CAT=Dalok PLAYLIST_CATTEXT=Számlista: %s -SING_SONG_SELECTION_LEGEND_TITLE=Jelmagyarázat -SING_SONG_SELECTION_LEGEND_VIDEO=Videó -SING_SONG_SELECTION_LEGEND_MEDLEY=Egyveleg -SING_SONG_SELECTION_LEGEND_MEDLEYC=Egyveleg kiszámolva -SING_SONG_SELECTION_LEGEND_DUET=Duett SING_TOTAL=Összesen SING_MODE=Egyszeri játékos @@ -348,7 +306,6 @@ IMPLODE_GLUE2= és SONG_MENU_NAME_MAIN=Dal menü SONG_MENU_PLAY=Szám SONG_MENU_CHANGEPLAYERS=Játékos váltás -SONG_MENU_CANCEL=Mégsem SONG_MENU_NAME_PLAYLIST=Szám Menü SONG_MENU_PLAYLIST_ADD=Hozzáad @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Joker felhasználása -SONG_JUMPTO_DESC=Dal keresés -SONG_JUMPTO_TYPE_DESC=Keresés: +SONG_MENU_LEGEND_TITLE=Jelmagyarázat +SONG_MENU_LEGEND_VIDEO=Videó +SONG_MENU_LEGEND_MEDLEY=Egyveleg +SONG_MENU_LEGEND_MEDLEYC=Egyveleg kiszámolva +SONG_MENU_LEGEND_DUET=Duett +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Szám +SONG_MENU_MEDLEY=Egyveleg + +SONG_MENU_NAME_SONG=Szám Menü +SONG_MENU_NAME_MEDLEY=Egyveleg Menü +SONG_MENU_ADD_SONG=Hozzáadás +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Törlés +SONG_MENU_START_MEDLEY=Éneklés +SONG_MENU_START_5_MEDLEY=Énekelj %0:d Dalt! + +SONG_MENU_NAME_SORTING=Rendezés Menü +SONG_MENU_SORTING_APPLY=Rendben + +SONG_MENU_OPEN_CATEGORY=Kategória megnyitása +SONG_MENU_CLOSE_CATEGORY=Kategória bezárása +SONG_MENU_START_JUKEBOX=Induljon a Zenedoboz +SONG_MENU_NAME_JUKEBOX=Zenedoboz Menü + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Buli mód PARTY_DIFFICULTY=Nehézségi Szint @@ -422,7 +407,7 @@ PARTY_WIN_LEGEND_CONTINUE=Vissza a főmenübe PARTY_ROUND=Forduló PARTY_ROUND_WINNER=Nyertes -PARTY_NOTPLAYEDYET= +;TODO: PARTY_NOTPLAYEDYET=Not played yet PARTY_NOBODY=Senki NEXT_ROUND=Következő menet: @@ -469,20 +454,20 @@ MODE_BLIND_DESC=Egymás elleni párbaj, anélkül hogy látnád a hangokat! MODE_BLINDTOTAL_NAME=Teljes vakság! MODE_BLINDTOTAL_DESC=Párbaj ahol a hangok és a szöveg is rejtve marad. Csak bátraknak! -MODE_1000BLIND_NAME = +1000 pont vakon -MODE_1000BLIND_DESC = Gyűjts minimum 1000 pont előnyt, annélkül hogy látnád a hangokat! +MODE_1000BLIND_NAME= +1000 pont vakon +MODE_1000BLIND_DESC= Gyűjts minimum 1000 pont előnyt, annélkül hogy látnád a hangokat! -MODE_DEAF_NAME = Hang nélkül -MODE_DEAF_DESC = Azt hiszed ismered a hangokat? Akkor énekelj nélkülük! +MODE_DEAF_NAME= Hang nélkül +MODE_DEAF_DESC= Azt hiszed ismered a hangokat? Akkor énekelj nélkülük! -MODE_BLINDLYRICS_NAME = Dalszöveg nélkül -MODE_BLINDLYRICS_DESC = Ismered a dalszöveget? Énekeld el úgy hogy rejtve marad! +MODE_BLINDLYRICS_NAME= Dalszöveg nélkül +MODE_BLINDLYRICS_DESC= Ismered a dalszöveget? Énekeld el úgy hogy rejtve marad! -MODE_500BLIND_NAME = +500 pont vakon -MODE_500BLIND_DESC = Gyűjts minimum 500 pont előnyt, annélkül hogy látnád a hangokat! +MODE_500BLIND_NAME= +500 pont vakon +MODE_500BLIND_DESC= Gyűjts minimum 500 pont előnyt, annélkül hogy látnád a hangokat! -MODE_SHORTSONG_NAME = Rövid dal -MODE_SHORTSONG_DESC = Gyors menet a dal feléig! +MODE_SHORTSONG_NAME= Rövid dal +MODE_SHORTSONG_DESC= Gyors menet a dal feléig! MODE_HARDCORE_NAME=Háromsoros MODE_HARDCORE_DESC=Három sornyi előny és tiéd a győzelem! @@ -544,29 +529,14 @@ JUKEBOX_FIND=Keresés: JUKEBOX_SORT=Rendezés: JUKEBOX_SONGLIST=Dalok listája -SONG_MENU_SONG=Szám -SONG_MENU_MEDLEY=Egyveleg - -SONG_MENU_NAME_SONG=Szám Menü -SONG_MENU_NAME_MEDLEY=Egyveleg Menü -SONG_MENU_ADD_SONG=Hozzáadás -SONG_MENU_DELETE_SONG=Törlés -SONG_MENU_START_MEDLEY=Éneklés -SONG_MENU_START_5_MEDLEY=Énekelj %0:d Dalt! - -SONG_MENU_NAME_SORTING=Rendezés Menü -SONG_MENU_SORTING_APPLY=Rendben - PARTY_PLAYLIST_MANUAL=Kézi Választás PARTY_MODE_JUKEBOX_NO_SONGS=Számlista üres! -SONG_MENU_OPEN_CATEGORY=Kategória megnyitása -SONG_MENU_CLOSE_CATEGORY=Kategória bezárása -SONG_MENU_START_JUKEBOX=Induljon a Zenedoboz -SONG_MENU_NAME_JUKEBOX=Zenedoboz Menü WEBSITE_EXIST_SONG=A dal a weboldalhoz tartozik: %0:s WEBSITE_NOT_EXIST_SONG=A dal nem tartozik egyik weboldalhoz sem! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Játékosok száma NAME_CURRENT_PLAYER=Játékos @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Sikertelen dalbetöltés: Nincs benne sortörés ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Sikertelen dalbetöltés: Sikertelen elemzési sor %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Játékos %d több mikrofonhoz van rendelve. Kérlek ellenőrizd a mikrofon beállításokat. ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Játékos %d nincs egy mikrofonhoz sem rendelve. Kérlek ellenőrizd a mikrofon beállításokat. + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Haladó +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Vissza +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Bézs +C_COLOR_BLACK=Fekete +C_COLOR_BLUE=Kék +C_COLOR_BROWN=Barna +C_COLOR_CYAN=Ciánkék +C_COLOR_CHOCOLATE=Csokoládébarna +C_COLOR_DARKBLUE=Sötétkék +C_COLOR_FLAME=Tűzvörös +C_COLOR_GOLD=Aranysárga +C_COLOR_GRAY=Szürke +C_COLOR_GREEN=Zöld +C_COLOR_GREENYELLOW=Sárgászöld +C_COLOR_HARLEQUIN=Limezöld +C_COLOR_LAVENDER=Levendulakék +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Narancs +C_COLOR_ORCHID=Orgonalila +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Rózsaszín +C_COLOR_PLUM=Pasztelpink +C_COLOR_RED=Piros +C_COLOR_SALMON=Vörösessárga +C_COLOR_SKY=Égszínkék +C_COLOR_STEELBLUE=Acélkék +C_COLOR_TEAL=Kékeszöld +C_COLOR_TURQUOISE=Türkiz +C_COLOR_VIOLET=Lila +C_COLOR_WHITE=Fehér +C_COLOR_YELLOW=Sárga +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Játék +C_GRAPHICS=Grafika + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Dalszöveg + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +;TODO: C_MICROPHONES=Mikrofonok +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Hang +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Témák +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +C_WEBCAM=Webkamera + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Nederlands.ini b/game/languages/Nederlands.ini index b13f7332..90edd60c 100644 --- a/game/languages/Nederlands.ini +++ b/game/languages/Nederlands.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Nederlands +LANGUAGE_ISO_CODE=nl SING_LOADING=Laden... SING_LOADING_SONGS=Nummers uit de map laden %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Moeilijk SING_OPTIONS=Opties -SING_OPTIONS_GAME=Spel -SING_OPTIONS_GRAPHICS=Graphics -SING_OPTIONS_SOUND=Geluid -SING_OPTIONS_LYRICS=Tekst -SING_OPTIONS_THEMES=Thema -SING_OPTIONS_MICROPHONES=Opname -SING_OPTIONS_ADVANCED=Geavanceerd -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Terug - SING_OPTIONS_GAME_LANGUAGE=Taal SING_OPTIONS_GAME_SONGMENU=Liedjes Menu ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Tabs SING_OPTIONS_GAME_SORTING=Sorteren -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Activeer gamepad OPTION_VALUE_ROULETTE=Roulette @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Jaar OPTION_VALUE_DECADE=Decennium OPTION_VALUE_PLAYLIST=Afspeellijst -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Fullscreen SING_OPTIONS_GRAPHICS_RESOLUTION=Resolutie @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Microfoon Playback SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Achtergrond Muziek SING_OPTIONS_SOUND_CLICK_ASSIST=Klik assistent SING_OPTIONS_SOUND_BEAT_CLICK=Beat klik -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Voorbeeld volume SING_OPTIONS_SOUND_PREVIEWFADING=Voorbeeld Faden @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Selecties na het Liedje SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Veiligheidsvragen SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto PartyMenu ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Alles OPTION_VALUE_PLAYER=Speler @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Speler ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Gebruikersnaam SING_OPTIONS_NETWORK_PASSWORD=Wachtwoord -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Speler -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Cancel ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Cancel ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: SONG_SCORE_MEDIA=Gemiddelde: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send SCORE_SEND_PLAYER=Speler -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Download SCORE_DOWNLOAD_SONG=Lied: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... SCORE_DOWNLOAD_RECEIVE_LIST=Downloaden... SCORE_DOWNLOAD_CANCEL=Cancel SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_SATURATION=Verzadiging SING_OPTIONS_WEBCAM_EFFECT=Effecten SING_OPTIONS_WEBCAM_PREVIEW=Activeer preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Drempelwaarde SING_OPTIONS_WEBCAM_EFFECT_EDGES=Randen -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_COLOR=Kleur ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Zing - OPTION_VALUE_ACTUAL=Bovenste -OPTION_VALUE_NEXT=Bodem +OPTION_VALUE_TOP=Bovenste +OPTION_VALUE_BOTTOM=Bodem ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Blauw -OPTION_VALUE_GREEN=Groen -OPTION_VALUE_PINK=Roze -OPTION_VALUE_RED=Rood -OPTION_VALUE_VIOLET=Paars -OPTION_VALUE_ORANGE=Oranje -OPTION_VALUE_YELLOW=Geel -OPTION_VALUE_BROWN=Bruin -OPTION_VALUE_BLACK=Zwart -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Grijs -OPTION_VALUE_WHITE=Wit -OPTION_VALUE_TURQUOISE=Turkoois -OPTION_VALUE_SALMON=Zalm -OPTION_VALUE_GREENYELLOW=Groen Geel -OPTION_VALUE_LAVENDER=Lavendel -OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -OPTION_VALUE_ORCHID=Orchidee -OPTION_VALUE_STEELBLUE=Staal blauw -OPTION_VALUE_PLUM=Pruim -OPTION_VALUE_CHOCOLATE=Chocola -OPTION_VALUE_GOLD=Goud -OPTION_VALUE_DARKBLUE=Donkerblauw -OPTION_VALUE_SKY=Hemel -OPTION_VALUE_HARLEQUIN=Harlekijn -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Selecteer SING_LEGEND_NAVIGATE=Navigeer @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Playlist SING_SONG_IN_CAT=Lied SING_SONGS_IN_CAT=Liedjes PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legende -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Totaal SING_MODE=Zing solo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= en SONG_MENU_NAME_MAIN=Liedjes Menu SONG_MENU_PLAY=Zingen SONG_MENU_CHANGEPLAYERS=Verander de spelers -SONG_MENU_CANCEL=Cancel SONG_MENU_NAME_PLAYLIST=Liedjes Menu SONG_MENU_PLAYLIST_ADD=Voeg een liedje toe @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Joker inzetten? -SONG_JUMPTO_DESC=Zoek liedje -SONG_JUMPTO_TYPE_DESC=Zoek naar: +SONG_MENU_LEGEND_TITLE=Legende +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Lied +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Liedjes Menu +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Voeg een liedje toe +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Verwijder Liedje +SONG_MENU_START_MEDLEY=Zingen! +SONG_MENU_START_5_MEDLEY=Zingen %0:d lied! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Party mode PARTY_DIFFICULTY=Moeilijkheidsgraad @@ -430,7 +415,7 @@ PARTY_DISMISSED=Uitgeschakeld! PARTY_SCORE_WINS=%s PARTY_SCORE_WINS2=Overwinningen! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=Hold the Line @@ -469,16 +454,16 @@ MODE_BLIND_NAME=Blinde Mode ;TODO: MODE_BLINDTOTAL_NAME=Total Darkness! ;TODO: MODE_BLINDTOTAL_DESC=A duel, but with the notes and the lyrics hidden. Only for the brave! -MODE_1000BLIND_NAME = +1000 Blind +MODE_1000BLIND_NAME= +1000 Blind ;TODO: MODE_1000BLIND_DESC = Gain a lead of more than 1000 points, but without seeing the notes! -MODE_DEAF_NAME = Doof +MODE_DEAF_NAME= Doof ;TODO: MODE_DEAF_DESC = Think you know the notes? Can you sing it without the acompaniment? ;TODO: MODE_BLINDLYRICS_NAME = No Lyrics ;TODO: MODE_BLINDLYRICS_DESC = Think you know all the lyrics? Sing with the lyrics hidden! -MODE_500BLIND_NAME = +500 Blind +MODE_500BLIND_NAME= +500 Blind ;TODO: MODE_500BLIND_DESC = Gain a lead of more than 500 points, but without seeing the notes! ;TODO: MODE_SHORTSONG_NAME = Short Song @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx gezongen ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,40 +522,25 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Volgende spelers aan de Microfoon ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs +;TODO: JUKEBOX_SONGLIST=List of songs -SONG_MENU_SONG=Lied -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Liedjes Menu -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Voeg een liedje toe -SONG_MENU_DELETE_SONG=Verwijder Liedje -SONG_MENU_START_MEDLEY=Zingen! -SONG_MENU_START_5_MEDLEY=Zingen %0:d lied! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Aantal spelers NAME_CURRENT_PLAYER=Speler -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Over... ABOUT_USDX_DEVELOPEDBY=Ontwikkeld door @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Liedje kon niet geladen worden: Geen linebreaks gev ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Liedje kon niet geladen worden: Probleem met regel %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Speler %d is toegewezen aan meerdere microfoons. Controleer uw microfoonopties ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Speler %d is niet toegewezen aan een microfoon. Controleer uw microfoonopties + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +;TODO: C_ADVANCED=Geavanceerd +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Terug +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Zwart +C_COLOR_BLUE=Blauw +C_COLOR_BROWN=Bruin +C_COLOR_CYAN=Cyan +C_COLOR_CHOCOLATE=Chocola +C_COLOR_DARKBLUE=Donkerblauw +C_COLOR_FLAME=Flame +C_COLOR_GOLD=Goud +C_COLOR_GRAY=Grijs +C_COLOR_GREEN=Groen +C_COLOR_GREENYELLOW=Groen Geel +C_COLOR_HARLEQUIN=Harlekijn +C_COLOR_LAVENDER=Lavendel +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Oranje +C_COLOR_ORCHID=Orchidee +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Roze +C_COLOR_PLUM=Pruim +C_COLOR_RED=Rood +C_COLOR_SALMON=Zalm +C_COLOR_SKY=Hemel +C_COLOR_STEELBLUE=Staal blauw +C_COLOR_TEAL=Teal +C_COLOR_TURQUOISE=Turkoois +C_COLOR_VIOLET=Paars +C_COLOR_WHITE=Wit +C_COLOR_YELLOW=Geel +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Spel +C_GRAPHICS=Graphics + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Tekst + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Opname +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Geluid +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Thema +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Norsk.ini b/game/languages/Norsk.ini index be5774e0..93d20fff 100644 --- a/game/languages/Norsk.ini +++ b/game/languages/Norsk.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Norsk +LANGUAGE_ISO_CODE=no SING_LOADING=Laster... SING_LOADING_SONGS=Laster inn sanger fra mappe %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Vanskelig SING_OPTIONS=Innstillinger -SING_OPTIONS_GAME=Spill -SING_OPTIONS_GRAPHICS=Grafikk -SING_OPTIONS_SOUND=Lyd -SING_OPTIONS_LYRICS=Tekst -SING_OPTIONS_THEMES=Utseende -SING_OPTIONS_MICROPHONES=Opptak -SING_OPTIONS_ADVANCED=Avansert -SING_OPTIONS_NETWORK=Internett -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Tilbake - SING_OPTIONS_GAME_LANGUAGE=Språk SING_OPTIONS_GAME_SONGMENU=Sangmeny ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Mappeinndeling SING_OPTIONS_GAME_SORTING=Sortering -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Aktiver gamepad OPTION_VALUE_ROULETTE=Rulett @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=År OPTION_VALUE_DECADE=Tiår OPTION_VALUE_PLAYLIST=Spillelist -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Fullskjerm SING_OPTIONS_GRAPHICS_RESOLUTION=Oppløsning @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Hør stemmen min SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Bakgrunnsmusikk SING_OPTIONS_SOUND_CLICK_ASSIST=Klikke-assistanse SING_OPTIONS_SOUND_BEAT_CLICK=Beat-klikk -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Preview-volum SING_OPTIONS_SOUND_PREVIEWFADING=Preview-fading @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Etter sang: SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Sikkerhetsspørsmål SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto partymeny ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Alt OPTION_VALUE_PLAYER=Spiller @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Spiller ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Brukernavn SING_OPTIONS_NETWORK_PASSWORD=Passord -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Spiller -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=AVbryt ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,20 +186,20 @@ MSG_INSERT_USER_CANCEL=AVbryt ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! SONG_SCORE_MAX=Beste: SONG_SCORE_MEDIA=Gjennomsnitt: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send ;TODO: SCORE_SEND_PLAYER=Player -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Nedlasting @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_SATURATION=Metning SING_OPTIONS_WEBCAM_EFFECT=Effekter SING_OPTIONS_WEBCAM_PREVIEW=Aktiver forhåndsvisning -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Toleransegrense ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Blå ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Syng -OPTION_VALUE_ACTUAL=Øverste -OPTION_VALUE_NEXT=Bunn +OPTION_VALUE_TOP=Øverste +OPTION_VALUE_BOTTOM=Bunn ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Blå -OPTION_VALUE_GREEN=Grønn -OPTION_VALUE_PINK=Rosa -OPTION_VALUE_RED=Rød -OPTION_VALUE_VIOLET=Violet -OPTION_VALUE_ORANGE=Oransje -OPTION_VALUE_YELLOW=Gul -OPTION_VALUE_BROWN=Brun -OPTION_VALUE_BLACK=Svart -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Grå -OPTION_VALUE_WHITE=Hvit -OPTION_VALUE_TURQUOISE=Turkis -OPTION_VALUE_SALMON=Laks -OPTION_VALUE_GREENYELLOW=Grønn gul -OPTION_VALUE_LAVENDER=Lavendel -OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -OPTION_VALUE_STEELBLUE=Stålblå -;TODO: OPTION_VALUE_PLUM=Plum -OPTION_VALUE_CHOCOLATE=Sjokolade -OPTION_VALUE_GOLD=Gull -OPTION_VALUE_DARKBLUE=Mørke blå -OPTION_VALUE_SKY=Himmel -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Velg SING_LEGEND_NAVIGATE=Naviger @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Spilleliste SING_SONG_IN_CAT=Sang SING_SONGS_IN_CAT=Sanger PLAYLIST_CATTEXT=Spilleliste: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legende -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duett SING_TOTAL=Total SING_MODE=Syng solo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= og SONG_MENU_NAME_MAIN=Sangmeny SONG_MENU_PLAY=Syng SONG_MENU_CHANGEPLAYERS=Endre spillere -SONG_MENU_CANCEL=AVbryt SONG_MENU_NAME_PLAYLIST=Sangmeny SONG_MENU_PLAYLIST_ADD=Legg til sang @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Bruk joker -SONG_JUMPTO_DESC=Søk etter sang -SONG_JUMPTO_TYPE_DESC=Søk etter: +SONG_MENU_LEGEND_TITLE=Legende +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duett +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Sang +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Sangmeny +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Legg til sang +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Ta bort sang +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Partymodus PARTY_DIFFICULTY=Vanskelighetsgrad @@ -472,13 +457,13 @@ MODE_BLIND_NAME=Blindemodus ;TODO: MODE_1000BLIND_NAME = +1000 Blind ;TODO: MODE_1000BLIND_DESC = Gain a lead of more than 1000 points, but without seeing the notes! -MODE_DEAF_NAME = Døv +MODE_DEAF_NAME= Døv ;TODO: MODE_DEAF_DESC = Think you know the notes? Can you sing it without the acompaniment? ;TODO: MODE_BLINDLYRICS_NAME = No Lyrics ;TODO: MODE_BLINDLYRICS_DESC = Think you know all the lyrics? Sing with the lyrics hidden! -MODE_500BLIND_NAME = +500 Blind +MODE_500BLIND_NAME= +500 Blind ;TODO: MODE_500BLIND_DESC = Gain a lead of more than 500 points, but without seeing the notes! ;TODO: MODE_SHORTSONG_NAME = Short Song @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx Sunget ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,40 +522,25 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Neste spillere til mikrofonene ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -SONG_MENU_SONG=Sang -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Sangmeny -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Legg til sang -SONG_MENU_DELETE_SONG=Ta bort sang -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Antall spillere NAME_CURRENT_PLAYER=Spiller -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Handle om... ABOUT_USDX_DEVELOPEDBY=Utviklet av @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG=Sangen kunne ikke lastes ;TODO: ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Song could not be loaded: Error parsing line %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Spiller %d er tilordnet flere mikrofoner. Vennligst sjekk mikrofonene dine ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Spiller %d er ikke tilordnet en mikrofon. Vennligst sjekk mikrofonene dine + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Avansert +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Tilbake +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Svart +C_COLOR_BLUE=Blå +C_COLOR_BROWN=Brun +;TODO: C_COLOR_CYAN=Cyan +C_COLOR_CHOCOLATE=Sjokolade +C_COLOR_DARKBLUE=Mørke blå +;TODO: C_COLOR_FLAME=Flame +C_COLOR_GOLD=Gull +C_COLOR_GRAY=Grå +C_COLOR_GREEN=Grønn +C_COLOR_GREENYELLOW=Grønn gul +;TODO: C_COLOR_HARLEQUIN=Harlequin +C_COLOR_LAVENDER=Lavendel +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Oransje +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Rosa +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Rød +C_COLOR_SALMON=Laks +C_COLOR_SKY=Himmel +C_COLOR_STEELBLUE=Stålblå +;TODO: C_COLOR_TEAL=Teal +C_COLOR_TURQUOISE=Turkis +;TODO: C_COLOR_VIOLET=Violet +C_COLOR_WHITE=Hvit +C_COLOR_YELLOW=Gul +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Spill +C_GRAPHICS=Grafikk + +;TODO: C_INFORMATION=Information +C_INTERNET=Internett + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Tekst + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Opptak +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Lyd +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Utseende +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Polski.ini b/game/languages/Polski.ini index f4e62075..56a92bd1 100644 --- a/game/languages/Polski.ini +++ b/game/languages/Polski.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Polski +LANGUAGE_ISO_CODE=pl SING_LOADING=Wczytywanie... SING_LOADING_SONGS=Ładowanie utworów z folderu %s @@ -40,17 +41,6 @@ OPTION_VALUE_HARD=Trudno SING_OPTIONS=Opcje -SING_OPTIONS_GAME=Gra -SING_OPTIONS_GRAPHICS=Grafika -SING_OPTIONS_SOUND=Dźwięk -SING_OPTIONS_LYRICS=Tekst -SING_OPTIONS_THEMES=Style -SING_OPTIONS_MICROPHONES=Nagrywanie -SING_OPTIONS_ADVANCED=Zaawansow. -SING_OPTIONS_NETWORK=Internet -SING_OPTIONS_WEBCAM=Kamerka -SING_OPTIONS_EXIT=Wstecz - SING_OPTIONS_GAME_LANGUAGE=Język SING_OPTIONS_GAME_SONGMENU=Menu piosenki SING_OPTIONS_GAME_DUETS=Duety @@ -224,10 +214,10 @@ SING_OPTIONS_WEBCAM_ID=Kamerka SING_OPTIONS_WEBCAM_RESOLUTION=Rozdzielczość SING_OPTIONS_WEBCAM_FPS=FPS SING_OPTIONS_WEBCAM_FLIP=Odwróć -SING_OPTIONS_WEBCAM_EFFECT=Efekt SING_OPTIONS_WEBCAM_BRIGHTNESS=Jasność SING_OPTIONS_WEBCAM_SATURATION=Nasycenie SING_OPTIONS_WEBCAM_HUE=Odcień +SING_OPTIONS_WEBCAM_EFFECT=Efekt SING_OPTIONS_WEBCAM_PREVIEW=Aktywuj podgląd SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Włącz podgląd @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC=Opcje tekstu JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Pozycja OPTION_VALUE_TO_SING=Śpiewaj -OPTION_VALUE_ACTUAL=Aktualne -OPTION_VALUE_NEXT=Następne +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom OPTION_VALUE_OTHER=Inne OPTION_VALUE_FILL=Wypełnij OPTION_VALUE_OUTLINE=Zarys -OPTION_VALUE_BLUE=Niebieski -OPTION_VALUE_GREEN=Zielony -OPTION_VALUE_PINK=Różowy -OPTION_VALUE_RED=Czerwony -OPTION_VALUE_VIOLET=Fioletowy -OPTION_VALUE_ORANGE=Pomarańczowy -OPTION_VALUE_YELLOW=Żółty -OPTION_VALUE_BROWN=Brązowy -OPTION_VALUE_BLACK=Czarny -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Szary -OPTION_VALUE_WHITE=Biały -OPTION_VALUE_TURQUOISE=Turkusowy -OPTION_VALUE_SALMON=Łososiowy -OPTION_VALUE_GREENYELLOW=Zielono-żółty -OPTION_VALUE_LAVENDER=Lawendowy -OPTION_VALUE_BEIGE=Beżowy -OPTION_VALUE_TEAL=Cyraneczkowy -OPTION_VALUE_ORCHID=Storczykowy -OPTION_VALUE_STEELBLUE=Stalowo-niebieski -OPTION_VALUE_PLUM=Śliwkowy -OPTION_VALUE_CHOCOLATE=Czekoladowy -OPTION_VALUE_GOLD=Złoty -OPTION_VALUE_DARKBLUE=Ciemno-niebieski -OPTION_VALUE_SKY=Niebieski -OPTION_VALUE_HARLEQUIN=Arlekin -OPTION_VALUE_CYAN=Cyjan -OPTION_VALUE_FLAME=Płomień + SING_LEGEND_SELECT=Wybierz SING_LEGEND_NAVIGATE=Nawiguj @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Playlista SING_SONG_IN_CAT=Piosenka SING_SONGS_IN_CAT=Piosenki PLAYLIST_CATTEXT=Playlista: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legenda -SING_SONG_SELECTION_LEGEND_VIDEO=Wideo -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Cały SING_MODE=Śpiewaj solo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= oraz SONG_MENU_NAME_MAIN=Menu piosenki SONG_MENU_PLAY=Śpiewaj SONG_MENU_CHANGEPLAYERS=Zmień graczy -SONG_MENU_CANCEL=Anuluj SONG_MENU_NAME_PLAYLIST=Menu piosenki SONG_MENU_PLAYLIST_ADD=Dodaj piosenkę @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Weź jokera -SONG_JUMPTO_DESC=Szukaj -SONG_JUMPTO_TYPE_DESC=Szukaj: +SONG_MENU_LEGEND_TITLE=Legenda +SONG_MENU_LEGEND_VIDEO=Wideo +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Piosenka +SONG_MENU_MEDLEY=Składanka + +SONG_MENU_NAME_SONG=Menu piosenki +SONG_MENU_NAME_MEDLEY=Menu składanki +SONG_MENU_ADD_SONG=Dodaj piosenkę +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Usuń piosenkę +SONG_MENU_START_MEDLEY=Śpiewaj! +SONG_MENU_START_5_MEDLEY=Śpiewaj %0:d piosenek! + +SONG_MENU_NAME_SORTING=Menu sortowania +SONG_MENU_SORTING_APPLY=Zastosuj + +SONG_MENU_OPEN_CATEGORY=Otwórz kategorię +SONG_MENU_CLOSE_CATEGORY=Zamknij kategorię +SONG_MENU_START_JUKEBOX=Włącz szafę grającą! +SONG_MENU_NAME_JUKEBOX=Menu szafy grającej + +SONG_SEARCH_DESC=Co chcesz teraz zaśpiewać? PARTY_MODE=Tryb imprezy PARTY_DIFFICULTY=Poziom @@ -469,20 +454,20 @@ MODE_BLIND_DESC=Pojedynek 1v1, ale z ukrytymi nutami! ;TODO: MODE_BLINDTOTAL_NAME=Total Darkness! MODE_BLINDTOTAL_DESC=Pojedynek, ale z ukrytymi nutami i napisami. Tylko dla odważnych! -MODE_1000BLIND_NAME = +1000 Ślepy -MODE_1000BLIND_DESC = Uzbieraj ponad 1000 punktów, ale z ukrytymi nutami! +MODE_1000BLIND_NAME= +1000 Ślepy +MODE_1000BLIND_DESC= Uzbieraj ponad 1000 punktów, ale z ukrytymi nutami! -MODE_DEAF_NAME = Głuchy -MODE_DEAF_DESC = Myślisz że znasz nuty? Czy zaśpiewasz bez akompaniamentu? +MODE_DEAF_NAME= Głuchy +MODE_DEAF_DESC= Myślisz że znasz nuty? Czy zaśpiewasz bez akompaniamentu? -MODE_BLINDLYRICS_NAME = Bez Napisów -MODE_BLINDLYRICS_DESC = Myślisz że znasz tekst? Zaśpiewaj bez patrzenia na napisy! +MODE_BLINDLYRICS_NAME= Bez Napisów +MODE_BLINDLYRICS_DESC= Myślisz że znasz tekst? Zaśpiewaj bez patrzenia na napisy! -MODE_500BLIND_NAME = +500 Ślepy -MODE_500BLIND_DESC = Uzbieraj ponad 500 punktów, ale z ukrytymi nutami! +MODE_500BLIND_NAME= +500 Ślepy +MODE_500BLIND_DESC= Uzbieraj ponad 500 punktów, ale z ukrytymi nutami! ;TODO: MODE_SHORTSONG_NAME = Short Song -MODE_SHORTSONG_DESC = Szybki pojedynek 1v1 do połowy piosenki! +MODE_SHORTSONG_DESC= Szybki pojedynek 1v1 do połowy piosenki! ;TODO: MODE_HARDCORE_NAME=Hardcore MODE_HARDCORE_DESC=Bitwa o zdobycie trzy-liniowej przewagi nad przeciwnikiem! @@ -544,29 +529,14 @@ JUKEBOX_FIND=Znajdź: JUKEBOX_SORT=Sortuj: JUKEBOX_SONGLIST=Lista piosenek -SONG_MENU_SONG=Piosenka -SONG_MENU_MEDLEY=Składanka - -SONG_MENU_NAME_SONG=Menu piosenki -SONG_MENU_NAME_MEDLEY=Menu składanki -SONG_MENU_ADD_SONG=Dodaj piosenkę -SONG_MENU_DELETE_SONG=Usuń piosenkę -SONG_MENU_START_MEDLEY=Śpiewaj! -SONG_MENU_START_5_MEDLEY=Śpiewaj %0:d piosenek! - -SONG_MENU_NAME_SORTING=Menu sortowania -SONG_MENU_SORTING_APPLY=Zastosuj - PARTY_PLAYLIST_MANUAL=Wybór ręczny PARTY_MODE_JUKEBOX_NO_SONGS=Playlista jest pusta! -SONG_MENU_OPEN_CATEGORY=Otwórz kategorię -SONG_MENU_CLOSE_CATEGORY=Zamknij kategorię -SONG_MENU_START_JUKEBOX=Włącz szafę grającą! -SONG_MENU_NAME_JUKEBOX=Menu szafy grającej WEBSITE_EXIST_SONG=Piosenka należy do strony internetowej: %0:s WEBSITE_NOT_EXIST_SONG=Ta piosenka nie należy do żadnej strony internetowej! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Liczba graczy NAME_CURRENT_PLAYER=Gracz @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Piosenka nie może być załadowana: nie mogę znal ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Piosenka nie może być załadowana: Błąd rozpoznawania linii %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Gracz %d został przypisany do wielu mikrofonów. Sprawdź ustawienia mikrofonów. ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Gracz %d nie ma przypisanego mikrofonu. Sprawdź ustawienia mikrofonów. + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +;TODO: C_ADVANCED=Zaawansow +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Wstecz +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Beżowy +C_COLOR_BLACK=Czarny +C_COLOR_BLUE=Niebieski +C_COLOR_BROWN=Brązowy +C_COLOR_CYAN=Cyjan +C_COLOR_CHOCOLATE=Czekoladowy +C_COLOR_DARKBLUE=Ciemno-niebieski +C_COLOR_FLAME=Płomień +C_COLOR_GOLD=Złoty +C_COLOR_GRAY=Szary +C_COLOR_GREEN=Zielony +C_COLOR_GREENYELLOW=Zielono-żółty +C_COLOR_HARLEQUIN=Arlekin +C_COLOR_LAVENDER=Lawendowy +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Pomarańczowy +C_COLOR_ORCHID=Storczykowy +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Różowy +C_COLOR_PLUM=Śliwkowy +C_COLOR_RED=Czerwony +C_COLOR_SALMON=Łososiowy +C_COLOR_SKY=Niebieski +C_COLOR_STEELBLUE=Stalowo-niebieski +C_COLOR_TEAL=Cyraneczkowy +C_COLOR_TURQUOISE=Turkusowy +C_COLOR_VIOLET=Fioletowy +C_COLOR_WHITE=Biały +C_COLOR_YELLOW=Żółty +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Gra +C_GRAPHICS=Grafika + +;TODO: C_INFORMATION=Information +;TODO: C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Tekst + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Nagrywanie +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Dźwięk +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Style +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +C_WEBCAM=Kamerka + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/Portugu\303\252s.ini" "b/game/languages/Portugu\303\252s.ini" index ed6f039e..8a1e0feb 100644 --- "a/game/languages/Portugu\303\252s.ini" +++ "b/game/languages/Portugu\303\252s.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Português +LANGUAGE_ISO_CODE=pt SING_LOADING=A Ler... SING_LOADING_SONGS=Carregando canções da pasta %s @@ -40,17 +41,6 @@ OPTION_VALUE_HARD=Difícil SING_OPTIONS=Opções -SING_OPTIONS_GAME=Jogo -SING_OPTIONS_GRAPHICS=Gráficos -SING_OPTIONS_SOUND=Som -SING_OPTIONS_LYRICS=Letras -SING_OPTIONS_THEMES=Temas -SING_OPTIONS_MICROPHONES=Gravação -SING_OPTIONS_ADVANCED=Avançado -SING_OPTIONS_NETWORK=Network -SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Voltar - SING_OPTIONS_GAME_LANGUAGE=Idioma SING_OPTIONS_GAME_SONGMENU=Menu de Canções SING_OPTIONS_GAME_DUETS=Duetos @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Playback Microfone SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Música de Fundo SING_OPTIONS_SOUND_CLICK_ASSIST=Click de Ajuda SING_OPTIONS_SOUND_BEAT_CLICK=Click de Batida -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Preview Volume SING_OPTIONS_SOUND_PREVIEWFADING=Preview Fading @@ -120,7 +110,7 @@ SING_OPTIONS_LYRICS_NOTELINES=Pauta OPTION_VALUE_PLAIN=Estilizado OPTION_VALUE_OLINE1=com borda fina -;TODO: OPTION_VALUE_OLINE2=with thick edge +;TODO: OPTION_VALUE_OLINE2=With thick edge OPTION_VALUE_SIMPLE=Simples OPTION_VALUE_ZOOM=Zoom @@ -159,7 +149,7 @@ SING_OPTIONS_NETWORK_AUTO_PLAYER=Jogador SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Pontuação (Fácil) SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Pontuação (Médio) SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Pontuação (Difícil) -SING_OPTIONS_NETWORK_NO_DLL=Não existem Web Dll's compatíveis com o Ultrastar Deluxe... +SING_OPTIONS_NETWORK_NO_DLL=Não existem Web Dll's compatíveis com o Ultrastar WorldParty... SING_OPTIONS_NETWORK_DELETE_PLAYER=Deseja mesmo eliminar o utilizador %0:s do website %1:s? SING_OPTIONS_NETWORK_LEGEND_INSERT=Inserir SING_OPTIONS_NETWORK_LEGEND_DELETE=Apagar @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC=Opções de Letra JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Posição OPTION_VALUE_TO_SING=Cantar -OPTION_VALUE_ACTUAL=Actual -OPTION_VALUE_NEXT=Seguinte +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom OPTION_VALUE_OTHER=Outra OPTION_VALUE_FILL=Fundo OPTION_VALUE_OUTLINE=Contorno -OPTION_VALUE_BLUE=Azul -OPTION_VALUE_GREEN=Verde -OPTION_VALUE_PINK=Rosa -OPTION_VALUE_RED=Vermelho -OPTION_VALUE_VIOLET=Violeta -OPTION_VALUE_ORANGE=Laranja -OPTION_VALUE_YELLOW=Amarelo -OPTION_VALUE_BROWN=Castanho -OPTION_VALUE_BLACK=Preto -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Cinzento -OPTION_VALUE_WHITE=Branco -OPTION_VALUE_TURQUOISE=Turquesa -OPTION_VALUE_SALMON=Salmão -OPTION_VALUE_GREENYELLOW=Lima -OPTION_VALUE_LAVENDER=Lavanda -OPTION_VALUE_BEIGE=Bege -OPTION_VALUE_TEAL=Verde Azulado -OPTION_VALUE_ORCHID=Orquídea -OPTION_VALUE_STEELBLUE=Azul Aço -OPTION_VALUE_PLUM=Ameixa -OPTION_VALUE_CHOCOLATE=Chocolate -OPTION_VALUE_GOLD=Ouro -OPTION_VALUE_DARKBLUE=Azul Escuro -OPTION_VALUE_SKY=Celeste -OPTION_VALUE_HARLEQUIN=Alecrim -OPTION_VALUE_CYAN=Ciano -OPTION_VALUE_FLAME=Fogo + SING_LEGEND_SELECT=Seleccionar SING_LEGEND_NAVIGATE=Navegar @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Playlist SING_SONG_IN_CAT=Cançao SING_SONGS_IN_CAT=Canções PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Lenda -SING_SONG_SELECTION_LEGEND_VIDEO=Vídeo -SING_SONG_SELECTION_LEGEND_MEDLEY=Versão curta -SING_SONG_SELECTION_LEGEND_MEDLEYC=Versão curta calculada -SING_SONG_SELECTION_LEGEND_DUET=Dueto SING_TOTAL=Total SING_MODE=Cantar Solo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= e SONG_MENU_NAME_MAIN=Menu de canções SONG_MENU_PLAY=Cantar SONG_MENU_CHANGEPLAYERS=Mudar Jogadores -SONG_MENU_CANCEL=Cancelar SONG_MENU_NAME_PLAYLIST=Menu de Canções SONG_MENU_PLAYLIST_ADD=Adicionar Canção @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Usar Joker -SONG_JUMPTO_DESC=Procurar -SONG_JUMPTO_TYPE_DESC=Procurar por: +SONG_MENU_LEGEND_TITLE=Lenda +SONG_MENU_LEGEND_VIDEO=Vídeo +SONG_MENU_LEGEND_MEDLEY=Versão curta +SONG_MENU_LEGEND_MEDLEYC=Versão curta calculada +SONG_MENU_LEGEND_DUET=Dueto +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Canção +SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Menu Canção +SONG_MENU_NAME_MEDLEY=Menu Medley +SONG_MENU_ADD_SONG=Adicionar Canção +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Apagar Canção +SONG_MENU_START_MEDLEY=Cantar! +SONG_MENU_START_5_MEDLEY=Cantar %0:d canções! + +SONG_MENU_NAME_SORTING=Menu Ordenação +SONG_MENU_SORTING_APPLY=Aplicar + +SONG_MENU_OPEN_CATEGORY=Abrir Categoria +SONG_MENU_CLOSE_CATEGORY=Fechar Categoria +SONG_MENU_START_JUKEBOX=Iniciar Jukebox! +SONG_MENU_NAME_JUKEBOX=Menu Jukebox + +SONG_SEARCH_DESC=O que queres cantar agora? PARTY_MODE=Modo Festa PARTY_DIFFICULTY=Dificuldade @@ -469,7 +454,7 @@ MODE_BLIND_NAME=Cego S/Notas ;TODO: MODE_BLINDTOTAL_NAME=Total Darkness! ;TODO: MODE_BLINDTOTAL_DESC=A duel, but with the notes and the lyrics hidden. Only for the brave! -MODE_1000BLIND_NAME = +1000 Cego +MODE_1000BLIND_NAME= +1000 Cego ;TODO: MODE_1000BLIND_DESC = Gain a lead of more than 1000 points, but without seeing the notes! ;TODO: MODE_DEAF_NAME = Deaf @@ -478,10 +463,10 @@ MODE_1000BLIND_NAME = +1000 Cego ;TODO: MODE_BLINDLYRICS_NAME = No Lyrics ;TODO: MODE_BLINDLYRICS_DESC = Think you know all the lyrics? Sing with the lyrics hidden! -MODE_500BLIND_NAME = +500 Cego +MODE_500BLIND_NAME= +500 Cego ;TODO: MODE_500BLIND_DESC = Gain a lead of more than 500 points, but without seeing the notes! -MODE_SHORTSONG_NAME = Canção Curta +MODE_SHORTSONG_NAME= Canção Curta ;TODO: MODE_SHORTSONG_DESC = A fast-paced 1v1 duel over half the song! MODE_HARDCORE_NAME=Hardcore @@ -544,29 +529,14 @@ JUKEBOX_FIND=Procurar: JUKEBOX_SORT=Ordenar: JUKEBOX_SONGLIST=Lista de Músicas -SONG_MENU_SONG=Canção -SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Menu Canção -SONG_MENU_NAME_MEDLEY=Menu Medley -SONG_MENU_ADD_SONG=Adicionar Canção -SONG_MENU_DELETE_SONG=Apagar Canção -SONG_MENU_START_MEDLEY=Cantar! -SONG_MENU_START_5_MEDLEY=Cantar %0:d canções! - -SONG_MENU_NAME_SORTING=Menu Ordenação -SONG_MENU_SORTING_APPLY=Aplicar - PARTY_PLAYLIST_MANUAL=Seleção manual PARTY_MODE_JUKEBOX_NO_SONGS=Lista de canções está vazia! -SONG_MENU_OPEN_CATEGORY=Abrir Categoria -SONG_MENU_CLOSE_CATEGORY=Fechar Categoria -SONG_MENU_START_JUKEBOX=Iniciar Jukebox! -SONG_MENU_NAME_JUKEBOX=Menu Jukebox WEBSITE_EXIST_SONG=A canção pertence ao website: %0:s WEBSITE_NOT_EXIST_SONG=A canção não pertence a nenhum website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Nº de Jogadores NAME_CURRENT_PLAYER=Jogador @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=A canção não tem quebras de linha! ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Erro durante o parsing da linha %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=O Jogador %d está atribuído a vários microfones. Por favor verifique as opções de microfone! ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=O Jogador %d não está atribuído a nenhum microfone. Por favor verifique as opções de microfone! + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Avançado +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Voltar +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Bege +C_COLOR_BLACK=Preto +C_COLOR_BLUE=Azul +C_COLOR_BROWN=Castanho +C_COLOR_CYAN=Ciano +C_COLOR_CHOCOLATE=Chocolate +C_COLOR_DARKBLUE=Azul Escuro +C_COLOR_FLAME=Fogo +C_COLOR_GOLD=Ouro +C_COLOR_GRAY=Cinzento +C_COLOR_GREEN=Verde +C_COLOR_GREENYELLOW=Lima +C_COLOR_HARLEQUIN=Alecrim +C_COLOR_LAVENDER=Lavanda +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Laranja +C_COLOR_ORCHID=Orquídea +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Rosa +C_COLOR_PLUM=Ameixa +C_COLOR_RED=Vermelho +C_COLOR_SALMON=Salmão +C_COLOR_SKY=Celeste +C_COLOR_STEELBLUE=Azul Aço +C_COLOR_TEAL=Verde azulado +C_COLOR_TURQUOISE=Turquesa +C_COLOR_VIOLET=Violeta +C_COLOR_WHITE=Branco +C_COLOR_YELLOW=Amarelo +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Jogo +C_GRAPHICS=Gráficos + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Letras + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Gravação +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Som +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Temas +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/P\321\203\314\201\321\201\321\201\320\272\320\270\320\271.ini" "b/game/languages/P\321\203\314\201\321\201\321\201\320\272\320\270\320\271.ini" index 084077be..9e3278df 100644 --- "a/game/languages/P\321\203\314\201\321\201\321\201\320\272\320\270\320\271.ini" +++ "b/game/languages/P\321\203\314\201\321\201\321\201\320\272\320\270\320\271.ini" @@ -1,5 +1,6 @@ [Text] -LANGUAGE=Pу́сский +LANGUAGE=Pyсский +LANGUAGE_ISO_CODE=ru SING_LOADING=Загрузка... SING_LOADING_SONGS=Поиск композиций в папке %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Сложный SING_OPTIONS=Настройки -SING_OPTIONS_GAME=игра -SING_OPTIONS_GRAPHICS=графика -SING_OPTIONS_SOUND=звук -SING_OPTIONS_LYRICS=текст -SING_OPTIONS_THEMES=темы -SING_OPTIONS_MICROPHONES=запись -SING_OPTIONS_ADVANCED=продвинутые -SING_OPTIONS_NETWORK=интернет -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=назад - SING_OPTIONS_GAME_LANGUAGE=Язык SING_OPTIONS_GAME_SONGMENU=Меню песен ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Табы SING_OPTIONS_GAME_SORTING=Сортировка -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Активировать геймпад OPTION_VALUE_ROULETTE=рулетка @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Год OPTION_VALUE_DECADE=десятилетие OPTION_VALUE_PLAYLIST=плэйлист -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Полный экран SING_OPTIONS_GRAPHICS_RESOLUTION=Разрешение @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Вывод с микрофона SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Фоновая музыка SING_OPTIONS_SOUND_CLICK_ASSIST=Метроном-помощник SING_OPTIONS_SOUND_BEAT_CLICK=Метроном -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Громкость превью SING_OPTIONS_SOUND_PREVIEWFADING=Затухание превью @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=После выбора песни SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Запросы ;TODO: SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto PartyMenu ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Всё OPTION_VALUE_PLAYER=игрок @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=игрок ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=имя пользователя SING_OPTIONS_NETWORK_PASSWORD=пароль -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name SING_OPTIONS_NETWORK_AUTO_MODE=Авто SING_OPTIONS_NETWORK_AUTO_PLAYER=игрок -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Отмена ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Отмена ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! SONG_SCORE_MAX=Лучший: SONG_SCORE_MEDIA=В среднем: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send SCORE_SEND_PLAYER=игрок -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Скачать SCORE_DOWNLOAD_SONG=песня: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Отмена ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_SATURATION=насыщение SING_OPTIONS_WEBCAM_EFFECT=Эффект SING_OPTIONS_WEBCAM_PREVIEW=Активировать просмотр -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Погрешность ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Синий ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Пение -OPTION_VALUE_ACTUAL=верхний -OPTION_VALUE_NEXT=Дно +OPTION_VALUE_TOP=верхний +OPTION_VALUE_BOTTOM=Дно OPTION_VALUE_OTHER=Другие ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Синий -OPTION_VALUE_GREEN=Зелёный -OPTION_VALUE_PINK=Розовый -OPTION_VALUE_RED=Красный -OPTION_VALUE_VIOLET=Фиолетовый -OPTION_VALUE_ORANGE=Оранжевый -OPTION_VALUE_YELLOW=Жёлтый -OPTION_VALUE_BROWN=Коричневый -OPTION_VALUE_BLACK=Чёрный -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Серый -OPTION_VALUE_WHITE=белый -OPTION_VALUE_TURQUOISE=Бирюзовый -OPTION_VALUE_SALMON=Лосось -OPTION_VALUE_GREENYELLOW=Желто-зеленый -OPTION_VALUE_LAVENDER=лаванда -OPTION_VALUE_BEIGE=Бежевый -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=выбрать SING_LEGEND_NAVIGATE=перейти @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=плэйлист SING_SONG_IN_CAT=песня SING_SONGS_IN_CAT=Песни PLAYLIST_CATTEXT=Плэйлист: %s -SING_SONG_SELECTION_LEGEND_TITLE=легенда -SING_SONG_SELECTION_LEGEND_VIDEO=видео -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Дуэт SING_TOTAL=всего SING_MODE=пение соло @@ -348,7 +306,6 @@ IMPLODE_GLUE2= и SONG_MENU_NAME_MAIN=меню пения SONG_MENU_PLAY=Петь SONG_MENU_CHANGEPLAYERS=Изменить игроков -SONG_MENU_CANCEL=Отмена SONG_MENU_NAME_PLAYLIST=Меню песен SONG_MENU_PLAYLIST_ADD=Добавить песню @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Джокер SONG_MENU_NAME_PARTY_JOKER=взять джокер -SONG_JUMPTO_DESC=поиск песни -SONG_JUMPTO_TYPE_DESC=Искать: +SONG_MENU_LEGEND_TITLE=легенда +SONG_MENU_LEGEND_VIDEO=видео +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Дуэт +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Меню песен +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Добавить песню +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Удалить песню +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=режим вечеринки PARTY_DIFFICULTY=Сложность @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n звучала %1:dx ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players PARTY_MODE_TOURNAMENT_OPTIONS_DESC=число раундов ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,47 +522,32 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=следующие игроки к микро ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Меню песен -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Добавить песню -SONG_MENU_DELETE_SONG=Удалить песню -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Количество игроков NAME_CURRENT_PLAYER=игрок -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Около... ABOUT_USDX_DEVELOPEDBY=Разработано ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Разработано @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Песня не может быть загруже ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Песня не может быть загружена: Ошибка обработки строки %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Игроку %d назначено несколько микрофонов. Проверьте настройки микрофона ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Игроку %d не назначено ни одного микрофона. Проверьте настройки микрофона + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=продвинутые +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=назад +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Бежевый +;TODO: C_COLOR_BLACK=Чёрный +;TODO: C_COLOR_BLUE=Синий +;TODO: C_COLOR_BROWN=Коричневый +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +;TODO: C_COLOR_GRAY=Серый +;TODO: C_COLOR_GREEN=Зелёный +;TODO: C_COLOR_GREENYELLOW=Желто-зеленый +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=лаванда +;TODO: C_COLOR_MAGENTA=Magenta +;TODO: C_COLOR_ORANGE=Оранжевый +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +;TODO: C_COLOR_PINK=Розовый +;TODO: C_COLOR_PLUM=Plum +;TODO: C_COLOR_RED=Красный +;TODO: C_COLOR_SALMON=Лосось +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Бирюзовый +;TODO: C_COLOR_VIOLET=Фиолетовый +;TODO: C_COLOR_WHITE=белый +;TODO: C_COLOR_YELLOW=Жёлтый +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=игра +C_GRAPHICS=графика + +;TODO: C_INFORMATION=Information +C_INTERNET=интернет + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=текст + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=запись +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=звук +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=темы +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/Rom\303\242n\304\203.ini" "b/game/languages/Rom\303\242n\304\203.ini" index 19bdb357..d68a703d 100644 --- "a/game/languages/Rom\303\242n\304\203.ini" +++ "b/game/languages/Rom\303\242n\304\203.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Română +LANGUAGE_ISO_CODE=ro SING_LOADING=Încărcând ... ;TODO: SING_LOADING_SONGS=Loading songs from folder %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Greu SING_OPTIONS=Opţiuni -SING_OPTIONS_GAME=Joc -SING_OPTIONS_GRAPHICS=Grafică -SING_OPTIONS_SOUND=Sunet -SING_OPTIONS_LYRICS=Versuri -SING_OPTIONS_THEMES=Aspect -SING_OPTIONS_MICROPHONES=Microfoane -SING_OPTIONS_ADVANCED=Avansat -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Înapoi - SING_OPTIONS_GAME_LANGUAGE=Limbă -;TODO: SING_OPTIONS_GAME_SONGMENU=Song Menu +;TODO: SING_OPTIONS_GAME_SONGMENU=Song menu ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Etichete SING_OPTIONS_GAME_SORTING=Sortează după -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Activați gamepad OPTION_VALUE_ROULETTE=Ruletă @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=An OPTION_VALUE_DECADE=Deceniu ;TODO: OPTION_VALUE_PLAYLIST=Playlist -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Ecran complet SING_OPTIONS_GRAPHICS_RESOLUTION=Rezoluție @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Ascultă microfon SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Muzică de fundal SING_OPTIONS_SOUND_CLICK_ASSIST=Ajutor note SING_OPTIONS_SOUND_BEAT_CLICK=Clic ritm -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Vezi volum SING_OPTIONS_SOUND_PREVIEWFADING=Vezi atenuare @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=După alegere cântec.. SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Confirmă ştergere SING_OPTIONS_ADVANCED_PARTYPOPUP=Meniu party automat ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Toate OPTION_VALUE_PLAYER=Jucător @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Jucător SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Nume de utilizator SING_OPTIONS_NETWORK_PASSWORD=Parola -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto ;TODO: SING_OPTIONS_NETWORK_AUTO_PLAYER=Player -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Anulare ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Anulare ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send SCORE_SEND_PLAYER=Jucător -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... ;TODO: SCORE_DOWNLOAD_CANCEL=Cancel ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_SATURATION=Saturare ;TODO: SING_OPTIONS_WEBCAM_EFFECT=Effect SING_OPTIONS_WEBCAM_PREVIEW=Activați previzualizarea -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate ;TODO: SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Threshold ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Albastru ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position ;TODO: OPTION_VALUE_TO_SING=Sing -OPTION_VALUE_ACTUAL=Superior -OPTION_VALUE_NEXT=Inferior +OPTION_VALUE_TOP=Superior +OPTION_VALUE_BOTTOM=Inferior ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Albastru -OPTION_VALUE_GREEN=Verde -OPTION_VALUE_PINK=Roz -OPTION_VALUE_RED=Roșu -OPTION_VALUE_VIOLET=Violet -OPTION_VALUE_ORANGE=Orange -OPTION_VALUE_YELLOW=Galben -OPTION_VALUE_BROWN=Maro -OPTION_VALUE_BLACK=Negru -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Gri -OPTION_VALUE_WHITE=Alb -OPTION_VALUE_TURQUOISE=Turcoaz -OPTION_VALUE_SALMON=Somon -OPTION_VALUE_GREENYELLOW=Verde galben -OPTION_VALUE_LAVENDER=Lavandă -OPTION_VALUE_BEIGE=Bej -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -OPTION_VALUE_CHOCOLATE=Ciocolată -OPTION_VALUE_GOLD=Aur -OPTION_VALUE_DARKBLUE=Albastru inchis -OPTION_VALUE_SKY=Cer -OPTION_VALUE_HARLEQUIN=Arlechin -OPTION_VALUE_CYAN=Cyan -OPTION_VALUE_FLAME=Flacără + SING_LEGEND_SELECT=Alege SING_LEGEND_NAVIGATE=Navighează @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Lista SING_SONG_IN_CAT=Cântec SING_SONGS_IN_CAT=Cântece PLAYLIST_CATTEXT=Lista: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legendă -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Total SING_MODE=Cântă singur @@ -348,7 +306,6 @@ IMPLODE_GLUE2=și SONG_MENU_NAME_MAIN=Meniu cântece SONG_MENU_PLAY=Cântă SONG_MENU_CHANGEPLAYERS=Schimbă jucători -SONG_MENU_CANCEL=Renunță SONG_MENU_NAME_PLAYLIST=Meniu cântece SONG_MENU_PLAYLIST_ADD=Adaugă cântec @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Cântă unul la întâmplare SONG_MENU_NAME_PARTY_JOKER=La întâmplare -SONG_JUMPTO_DESC=Caută cântec -SONG_JUMPTO_TYPE_DESC=Caută după: +SONG_MENU_LEGEND_TITLE=Legendă +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +;TODO: SONG_MENU_NAME_SONG=Song Menu +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +;TODO: SONG_MENU_ADD_SONG=Add Song +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +;TODO: SONG_MENU_DELETE_SONG=Delete song +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Modul party PARTY_DIFFICULTY=Dificultate @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx cântat ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,40 +522,25 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx cântat ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: SONG_MENU_NAME_SONG=Song Menu -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -;TODO: SONG_MENU_ADD_SONG=Add Song -;TODO: SONG_MENU_DELETE_SONG=Delete Song -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Număr de jucători NAME_CURRENT_PLAYER=Jucător -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Despre... ABOUT_USDX_DEVELOPEDBY=Dezvoltat de @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Nu pot încărca cântecul: Nu sunt pauze de linie ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Imposibil de încărcat cântecul: Eroare în analiza liniei %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Jucătorului %d i s-au atribuit mai multe microfoane. Verifică opţiunile de microfon. ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Jucătorului %d nu i s-a atribuit nici un microfon. Verifică opţiunile de microfon. + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Avansat +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Înapoi +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Bej +C_COLOR_BLACK=Negru +C_COLOR_BLUE=Albastru +C_COLOR_BROWN=Maro +C_COLOR_CYAN=Cyan +C_COLOR_CHOCOLATE=Ciocolată +C_COLOR_DARKBLUE=Albastru inchis +C_COLOR_FLAME=Flacără +C_COLOR_GOLD=Aur +C_COLOR_GRAY=Gri +C_COLOR_GREEN=Verde +C_COLOR_GREENYELLOW=Verde galben +C_COLOR_HARLEQUIN=Arlechin +C_COLOR_LAVENDER=Lavandă +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Orange +C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Roz +C_COLOR_PLUM=Plum +C_COLOR_RED=Roșu +C_COLOR_SALMON=Somon +C_COLOR_SKY=Cer +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +C_COLOR_TURQUOISE=Turcoaz +C_COLOR_VIOLET=Violet +C_COLOR_WHITE=Alb +C_COLOR_YELLOW=Galben +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Joc +C_GRAPHICS=Grafică + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Versuri + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Microfoane +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Sunet +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Aspect +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/Slovensk\303\275.ini" "b/game/languages/Slovensk\303\275.ini" index b8b993a9..e137588a 100644 --- "a/game/languages/Slovensk\303\275.ini" +++ "b/game/languages/Slovensk\303\275.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Slovenský +LANGUAGE_ISO_CODE=sk SING_LOADING=... nahráva sa hra! SING_LOADING_SONGS=Načítavajú sa skladby z priečinka %s @@ -40,23 +41,11 @@ OPTION_VALUE_HARD=Ťažká SING_OPTIONS=Nastavenia -SING_OPTIONS_GAME=Hra -SING_OPTIONS_GRAPHICS=Grafika -SING_OPTIONS_SOUND=Zvuk -SING_OPTIONS_LYRICS=Text -SING_OPTIONS_THEMES=Témy -SING_OPTIONS_MICROPHONES=Mikrofón -SING_OPTIONS_ADVANCED=Iné -SING_OPTIONS_NETWORK=Internet -SING_OPTIONS_WEBCAM=Webová kamera -SING_OPTIONS_EXIT=Späť - SING_OPTIONS_GAME_LANGUAGE=Jazyk SING_OPTIONS_GAME_SONGMENU=Skladby -;TODO: SING_OPTIONS_GAME_DUETS=Duets +SING_OPTIONS_GAME_DUETS=Duety SING_OPTIONS_GAME_TABS=Kategórie SING_OPTIONS_GAME_SORTING=Triedenie -SING_OPTIONS_GAME_DUETS=Duety SING_OPTIONS_GAME_SHOWSCORES=Zobraziť skóre SING_OPTIONS_GAME_JOYPAD_SUPPORT=Gamepad @@ -81,7 +70,7 @@ OPTION_VALUE_YEAR=Rok OPTION_VALUE_DECADE=Desaťročia OPTION_VALUE_PLAYLIST=Playlist -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Celá obrazovka SING_OPTIONS_GRAPHICS_RESOLUTION=Rozlíšenie @@ -154,12 +143,12 @@ OPTION_VALUE_PLAYER=Hráč ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Užívateľské meno SING_OPTIONS_NETWORK_PASSWORD=Heslo -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto -;TODO: SING_OPTIONS_NETWORK_AUTO_PLAYER=Prehrávač -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_PLAYER=Player +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) SING_OPTIONS_NETWORK_NO_DLL=Nebol nájdený žiaden kompatibilný modul leaderboard! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -185,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Zrušiť ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -197,12 +186,12 @@ SONG_MENU_REFRESH_SCORES=Aktualizovať skóre SONG_MENU_REFRESH_SCORES_NO_WEB=Neexistujú webové stránky! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! SONG_SCORE_MAX=Najlepší: SONG_SCORE_MEDIA=Priemerne: @@ -210,12 +199,12 @@ SONG_SCORE_MEDIA=Priemerne: SCORE_SEND_DESC=Odoslať skóre SCORE_SEND=Odoslať SCORE_SEND_PLAYER=Hráč -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Stiahnuť SCORE_DOWNLOAD_SONG=Skladba: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Zrušiť SCORE_DOWNLOAD_OK=OK @@ -254,40 +243,16 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_RED=Červená JUKEBOX_SONGOPTIONS_LYRIC_RGB_GREEN=Zelená JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Modrá +;TODO: JUKEBOX_SONGOPTIONS_LYRIC=Lyric Options +;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position + OPTION_VALUE_TO_SING=Spev -OPTION_VALUE_ACTUAL=Aktuálny -OPTION_VALUE_NEXT=Ďalší +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom OPTION_VALUE_OTHER=Ostatné OPTION_VALUE_FILL=Výplň OPTION_VALUE_OUTLINE=Obrysy -OPTION_VALUE_BLUE=Modrá -OPTION_VALUE_GREEN=Zelená -OPTION_VALUE_PINK=Ružová -OPTION_VALUE_RED=Červená -OPTION_VALUE_VIOLET=Fialová -OPTION_VALUE_ORANGE=Oranžová -OPTION_VALUE_YELLOW=Žltá -OPTION_VALUE_BROWN=Hnedá -OPTION_VALUE_BLACK=Čierna -OPTION_VALUE_MAGENTA=Purpurová -OPTION_VALUE_GRAY=Šedá -OPTION_VALUE_WHITE=Biela -OPTION_VALUE_TURQUOISE=Tyrkysová -OPTION_VALUE_SALMON=Lososová -OPTION_VALUE_GREENYELLOW=Zelenožltá -OPTION_VALUE_LAVENDER=Levanduľová -OPTION_VALUE_BEIGE=Béžová -OPTION_VALUE_TEAL=Modrozelená -OPTION_VALUE_ORCHID=Orchidea -OPTION_VALUE_STEELBLUE=Oceľová modrá -OPTION_VALUE_PLUM=Slivková -OPTION_VALUE_CHOCOLATE=Čokoládová -OPTION_VALUE_GOLD=Zlatá -OPTION_VALUE_DARKBLUE=Tmavomodrá -OPTION_VALUE_SKY=Nebeská -OPTION_VALUE_HARLEQUIN=Harlekýn -OPTION_VALUE_CYAN=Tyrkysová -OPTION_VALUE_FLAME=Plameň + SING_LEGEND_SELECT=Výber SING_LEGEND_NAVIGATE=Navigácia @@ -300,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Playlist SING_SONG_IN_CAT=Pieseň SING_SONGS_IN_CAT=Skladba PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legenda -SING_SONG_SELECTION_LEGEND_VIDEO=Video -SING_SONG_SELECTION_LEGEND_MEDLEY=Všehochuť -SING_SONG_SELECTION_LEGEND_MEDLEYC=Všehochuť (vypočítaná) -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Celkovo SING_MODE=Spievať sólo @@ -346,7 +306,6 @@ IMPLODE_GLUE2= a SONG_MENU_NAME_MAIN=Výber hudby SONG_MENU_PLAY=Štart SONG_MENU_CHANGEPLAYERS=Iný hráč -SONG_MENU_CANCEL=Zrušiť SONG_MENU_NAME_PLAYLIST=Skladby SONG_MENU_PLAYLIST_ADD=Pridať skladbu @@ -376,8 +335,36 @@ SONG_MENU_JOKER=Žolík SONG_MENU_NAME_PARTY_JOKER=Použiť žolíka -SONG_JUMPTO_DESC=Hľadať skladbu -SONG_JUMPTO_TYPE_DESC=Hľadať: +SONG_MENU_LEGEND_TITLE=Legenda +SONG_MENU_LEGEND_VIDEO=Video +SONG_MENU_LEGEND_MEDLEY=Všehochuť +SONG_MENU_LEGEND_MEDLEYC=Všehochuť (vypočítaná) +SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Skladba +SONG_MENU_MEDLEY=Všehochuť + +SONG_MENU_NAME_SONG=Skladby +SONG_MENU_NAME_MEDLEY=Ponuka všehochute +SONG_MENU_ADD_SONG=Pridať skladbu +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Zmazať skladbu +SONG_MENU_START_MEDLEY=Spievajte! +SONG_MENU_START_5_MEDLEY=Zaspievajte %0:d piesní! + +SONG_MENU_NAME_SORTING=Ponuka triedenia +SONG_MENU_SORTING_APPLY=Použiť + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Párty mód PARTY_DIFFICULTY=Obtiažnosť @@ -467,20 +454,20 @@ MODE_BLIND_DESC=Duel bez zobrazenia nôt! MODE_BLINDTOTAL_NAME=Úplná tma! MODE_BLINDTOTAL_DESC=Duel so skrytými notami aj textom. Iba pre odvážnych! -MODE_1000BLIND_NAME = +1000 naslepo -MODE_1000BLIND_DESC = Získajte aspoň 1000bodový náskok, ale bez toho aby ste videli noty! +MODE_1000BLIND_NAME= +1000 naslepo +MODE_1000BLIND_DESC= Získajte aspoň 1000bodový náskok, ale bez toho aby ste videli noty! -MODE_DEAF_NAME = Bez hudby -MODE_DEAF_DESC = Myslíte si, že dokonale poznáte melódiu? Dokážete spievať bez podkladu? +MODE_DEAF_NAME= Bez hudby +MODE_DEAF_DESC= Myslíte si, že dokonale poznáte melódiu? Dokážete spievať bez podkladu? -MODE_BLINDLYRICS_NAME = Bez textu -MODE_BLINDLYRICS_DESC = Poznáte text pesničky? Tak spievajte bez neho! +MODE_BLINDLYRICS_NAME= Bez textu +MODE_BLINDLYRICS_DESC= Poznáte text pesničky? Tak spievajte bez neho! -MODE_500BLIND_NAME = +500 naslepo -MODE_500BLIND_DESC = Získajte aspoň 500bodový náskok, ale bez toho aby ste videli noty! +MODE_500BLIND_NAME= +500 naslepo +MODE_500BLIND_DESC= Získajte aspoň 500bodový náskok, ale bez toho aby ste videli noty! -MODE_SHORTSONG_NAME = Krátka skladba -MODE_SHORTSONG_DESC = Rýchly duel na polovici skladby! +MODE_SHORTSONG_NAME= Krátka skladba +MODE_SHORTSONG_DESC= Rýchly duel na polovici skladby! MODE_HARDCORE_NAME=Skúška ohňom MODE_HARDCORE_DESC=Súboj o trojriadkový náskok pred súperom! @@ -525,7 +512,7 @@ PARTY_MODE_TOURNAMENT=Turnaj PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -542,40 +529,25 @@ JUKEBOX_FIND=Hľadať: JUKEBOX_SORT=Triedenie: JUKEBOX_SONGLIST=Zoznam skladieb -SONG_MENU_SONG=Skladba -SONG_MENU_MEDLEY=Všehochuť - -SONG_MENU_NAME_SONG=Skladby -SONG_MENU_NAME_MEDLEY=Ponuka všehochute -SONG_MENU_ADD_SONG=Pridať skladbu -SONG_MENU_DELETE_SONG=Zmazať skladbu -SONG_MENU_START_MEDLEY=Spievajte! -SONG_MENU_START_5_MEDLEY=Zaspievajte %0:d piesní! - -SONG_MENU_NAME_SORTING=Ponuka triedenia -SONG_MENU_SORTING_APPLY=Použiť - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Počet hráčov NAME_CURRENT_PLAYER=Hráč -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=O... ABOUT_USDX_DEVELOPEDBY=Vyvinutý ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ABOUT_OVERVIEW=Objavte nový spôsob spevu, sám, v páre alebo s priateľmi.\nZábava je zaručená.\n\nWorldParty je odnož pôvodnej verzie Ultrastar Deluxe 1.1 navrhnutý a vyvinutý tímom UltraStar España, počíta s najväčšou karaoke komunitou.\n\n\nTento program je bezplatný (free) a slobodný (libre) pod licenciou GPL. \n\n Navštívte nás pre viac informácií.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Vyvinutý @@ -600,3 +572,118 @@ ERROR_CORRUPT_SONG=Skladbu sa nepodarilo nahrať. ;TODO: ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Song could not be loaded: Error parsing line %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Hráč %d má priradených viac mikrofónov. Skontrolujte možnosti mikrofónu ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Hráč %d nemá priradený mikrofón. Skontrolujte možnosti mikrofónu + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Iné +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Späť +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Béžová +C_COLOR_BLACK=Čierna +C_COLOR_BLUE=Modrá +C_COLOR_BROWN=Hnedá +C_COLOR_CYAN=Tyrkysová +C_COLOR_CHOCOLATE=Čokoládová +C_COLOR_DARKBLUE=Tmavomodrá +C_COLOR_FLAME=Plameň +C_COLOR_GOLD=Zlatá +C_COLOR_GRAY=Šedá +C_COLOR_GREEN=Zelená +C_COLOR_GREENYELLOW=Zelenožltá +C_COLOR_HARLEQUIN=Harlekýn +C_COLOR_LAVENDER=Levanduľová +C_COLOR_MAGENTA=Purpurová +C_COLOR_ORANGE=Oranžová +C_COLOR_ORCHID=Orchidea +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Ružová +C_COLOR_PLUM=Slivková +C_COLOR_RED=Červená +C_COLOR_SALMON=Lososová +C_COLOR_SKY=Nebeská +C_COLOR_STEELBLUE=Oceľová modrá +C_COLOR_TEAL=Modrozelená +C_COLOR_TURQUOISE=Tyrkysová +C_COLOR_VIOLET=Fialová +C_COLOR_WHITE=Biela +C_COLOR_YELLOW=Žltá +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Hra +C_GRAPHICS=Grafika + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Text + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Mikrofón +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Zvuk +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Témy +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +C_WEBCAM=Webová kamera + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/Sloven\305\241\304\215ina.ini" "b/game/languages/Sloven\305\241\304\215ina.ini" index 30c78ee0..ab7aa6cc 100644 --- "a/game/languages/Sloven\305\241\304\215ina.ini" +++ "b/game/languages/Sloven\305\241\304\215ina.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Slovenščina +LANGUAGE_ISO_CODE=sl SING_LOADING=Nalaganje... SING_LOADING_SONGS=Nalaganje skladb iz mape %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Težko SING_OPTIONS=Nastavitve -SING_OPTIONS_GAME=Igra -SING_OPTIONS_GRAPHICS=Izgled -SING_OPTIONS_SOUND=Zvok -SING_OPTIONS_LYRICS=Besedilo -SING_OPTIONS_THEMES=Tema -SING_OPTIONS_MICROPHONES=Mikrofoni -SING_OPTIONS_ADVANCED=Napredno -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Nazaj - SING_OPTIONS_GAME_LANGUAGE=Jezik SING_OPTIONS_GAME_SONGMENU=Meni Pesem ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Mape SING_OPTIONS_GAME_SORTING=Sortiranje -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Aktivirajte gamepad OPTION_VALUE_ROULETTE=Ruleta @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Leto OPTION_VALUE_DECADE=Desetletje OPTION_VALUE_PLAYLIST=Seznam -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Celozaslonski nacin SING_OPTIONS_GRAPHICS_RESOLUTION=Locljivost @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Mikrofonski Playback SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Glasbena podlaga SING_OPTIONS_SOUND_CLICK_ASSIST=Asistent klikanja SING_OPTIONS_SOUND_BEAT_CLICK=Klikanje po ritmu -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Glasnost predogleda SING_OPTIONS_SOUND_PREVIEWFADING=Narašcanje glasnosti @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Po izboru pesmi SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Zašcitno vprašanje SING_OPTIONS_ADVANCED_PARTYPOPUP=Samodejni nacin Zabava ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Vse OPTION_VALUE_PLAYER=Igralec @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Igralec ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Uporabniško ime SING_OPTIONS_NETWORK_PASSWORD=Geslo -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Igralec -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? SING_OPTIONS_NETWORK_LEGEND_INSERT=Vstavi @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Preklici ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Preklici ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send SCORE_SEND_PLAYER=Igralec -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Prenesi SCORE_DOWNLOAD_SONG=Pesem: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Preklici ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_RESOLUTION=Locljivost SING_OPTIONS_WEBCAM_EFFECT=Ucinek ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Prag ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Modra ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Poj -OPTION_VALUE_ACTUAL=Zgornja -OPTION_VALUE_NEXT=Spodnja +OPTION_VALUE_TOP=Zgornja +OPTION_VALUE_BOTTOM=Spodnja ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Modra -OPTION_VALUE_GREEN=Zelena -OPTION_VALUE_PINK=Roza -OPTION_VALUE_RED=Rdeča -OPTION_VALUE_VIOLET=Violet -OPTION_VALUE_ORANGE=Oranžna -OPTION_VALUE_YELLOW=Rumena -OPTION_VALUE_BROWN=Rjav -OPTION_VALUE_BLACK=Črna -OPTION_VALUE_MAGENTA=Magenta -;TODO: OPTION_VALUE_GRAY=Gray -;TODO: OPTION_VALUE_WHITE=White -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Izberi SING_LEGEND_NAVIGATE=Premik @@ -299,14 +262,9 @@ SING_LEGEND_ESC=Nazaj SING_SONG_SELECTION=Izbira pesmi SING_SONG_SELECTION_MENU=Meni SING_SONG_SELECTION_PLAYLIST=Seznam predvajanja -SING_SONGS_IN_CAT=Pesmi SING_SONG_IN_CAT=Pesem +SING_SONGS_IN_CAT=Pesmi PLAYLIST_CATTEXT=Lista: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legenda -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Skupaj SING_MODE=Petje @@ -348,7 +306,6 @@ IMPLODE_GLUE2= in SONG_MENU_NAME_MAIN=Meni pesmi SONG_MENU_PLAY=Poj SONG_MENU_CHANGEPLAYERS=Spremeni igralca -SONG_MENU_CANCEL=Preklici SONG_MENU_NAME_PLAYLIST=Meni Pesem SONG_MENU_PLAYLIST_ADD=Dodaj pesem @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=Izkoristi jokerja -SONG_JUMPTO_DESC=Poišci pesem -SONG_JUMPTO_TYPE_DESC=Isci po: +SONG_MENU_LEGEND_TITLE=Legenda +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Meni Pesem +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Dodaj pesem +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Izbriši pesem +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Zabava PARTY_DIFFICULTY=Težavnost @@ -430,7 +415,7 @@ PARTY_DISMISSED=Zakljucena! PARTY_SCORE_WINS=%s PARTY_SCORE_WINS2=Zmaga! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=Zdrži nivo @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx igrano ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,54 +522,39 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Naslednji igralec k mikrofonu ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley +;TODO: JUKEBOX_SONGLIST=List of songs -SONG_MENU_NAME_SONG=Meni Pesem -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Dodaj pesem -SONG_MENU_DELETE_SONG=Izbriši pesem -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! -;TODO: NAME_PLAYERS_COUNT=Number of Players +;TODO: SING_SONGS_MYSCORES=My scores + +;TODO: NAME_PLAYERS_COUNT=Number of players ;TODO: NAME_CURRENT_PLAYER=Player -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=O... ;TODO: ABOUT_USDX_DEVELOPEDBY=Developed by ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ABOUT_OVERVIEW=Odkrijte nov način petja, samega, v paru ali s prijatelji. \n Zabava je zajamčena.\n\nWorldParty je fork originalne verzije Ultrastar Deluxe 1.1 ki ga je razvila in izdelala ekipa UltraStar España, šteje pri največji skupini karaoke.\n\n\nTa program je brezplačen in libre pod licenco GPL. \n\n Obiščite nas za več informacij.\n\nhttps://ultrastar-es.org ;TODO: DEVELOPERS_TITLE=Developed by DEVELOPERS_OVERVIEW=Ljudje, ki so prispevali k temu projektu:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Obiščite nas za več informacij.\n\nhttps://ultrastar-es.org ;TODO: SCREENSHOT_SAVED=Screenshot saved -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot MSG_ERROR_TITLE=Napaka ;TODO: MSG_INFO_TITLE=Information @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Ne morem naložiti pesmi: Ne najdem prelomov vrstic ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Ne morem naložiti pesmi: Napaka v parsanju vrstice %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Igralec %d je dodeljena več mikrofonom. Preverite možnosti mikrofona ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Igralec %d ni dodeljen mikrofonu. Preverite možnosti mikrofona + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Napredno +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Nazaj +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Črna +C_COLOR_BLUE=Modra +C_COLOR_BROWN=Rjav +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +;TODO: C_COLOR_GRAY=Gray +C_COLOR_GREEN=Zelena +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Oranžna +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Roza +;TODO: C_COLOR_PLUM=Plum +;C_COLOR_RED=Rdeča +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=Violet +;TODO: C_COLOR_WHITE=White +C_COLOR_YELLOW=Rumena +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Igra +C_GRAPHICS=Izgled + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Besedilo + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Mikrofoni +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Zvok +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Tema +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/Suomi.ini b/game/languages/Suomi.ini index 57dcf3c4..62139c11 100644 --- a/game/languages/Suomi.ini +++ b/game/languages/Suomi.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Suomi +LANGUAGE_ISO_CODE=fi SING_LOADING=Moikkamoi! Tää systeemi niinku lataa... SING_LOADING_SONGS=Ladataan kappaleita %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Vaikea SING_OPTIONS=Asetukset -SING_OPTIONS_GAME=Peli -SING_OPTIONS_GRAPHICS=Kuva -SING_OPTIONS_SOUND=Äänet -SING_OPTIONS_LYRICS=Lyriikat -SING_OPTIONS_THEMES=Teemat -SING_OPTIONS_MICROPHONES=Mikrofonit -SING_OPTIONS_ADVANCED=Erikoiset -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Takaisin - SING_OPTIONS_GAME_LANGUAGE=Kieli SING_OPTIONS_GAME_SONGMENU=Kappalelistavalikko ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Välilehdet SING_OPTIONS_GAME_SORTING=Järjestys -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Aktivoi peliohjain OPTION_VALUE_ROULETTE=Ruletti @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Vuosi OPTION_VALUE_DECADE=Vuosikymmen OPTION_VALUE_PLAYLIST=Kappalelista -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Kokoruutu SING_OPTIONS_GRAPHICS_RESOLUTION=Resoluutio @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Laulusi kuuluu kaittimista SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Tausta musiikki SING_OPTIONS_SOUND_CLICK_ASSIST=Klikkausapuri SING_OPTIONS_SOUND_BEAT_CLICK=Biitti klikkaaja -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Esikatselutaso SING_OPTIONS_SOUND_PREVIEWFADING=Esikatselufeidaus @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Kappaleen valinnan jälkeen SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Turvakyselyt SING_OPTIONS_ADVANCED_PARTYPOPUP=Automaattinen tiimipeli ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Kaikki ;TODO: OPTION_VALUE_PLAYER=Player @@ -153,12 +143,12 @@ OPTION_VALUE_ALL=Kaikki ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Käyttäjätunnus SING_OPTIONS_NETWORK_PASSWORD=Salasana -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Pelaaja -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Peruuta ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Peruuta ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! SONG_SCORE_MAX=Parhaat: SONG_SCORE_MEDIA=Keskiverto: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send SCORE_SEND_PLAYER=Pelaaja -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download SCORE_DOWNLOAD_SONG=Laulu: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Peruuta ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_SATURATION=Kyllästys SING_OPTIONS_WEBCAM_EFFECT=Tehoste ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Aloituspiste ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Sininen ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Laula -OPTION_VALUE_ACTUAL=Ylempi -OPTION_VALUE_NEXT=Pohja +OPTION_VALUE_TOP=Ylempi +OPTION_VALUE_BOTTOM=Pohja ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Sininen -OPTION_VALUE_GREEN=Vihreä -OPTION_VALUE_PINK=Pinkki -OPTION_VALUE_RED=Punainen -OPTION_VALUE_VIOLET=Violetti -OPTION_VALUE_ORANGE=Oranssi -OPTION_VALUE_YELLOW=Keltainen -OPTION_VALUE_BROWN=Ruskea -OPTION_VALUE_BLACK=Musta -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Harmaa -OPTION_VALUE_WHITE=Valkoinen -OPTION_VALUE_TURQUOISE=Turkoosi -OPTION_VALUE_SALMON=Lohi -OPTION_VALUE_GREENYELLOW=Vihreä keltainen -OPTION_VALUE_LAVENDER=Laventeli -OPTION_VALUE_BEIGE=Beige -OPTION_VALUE_TEAL=Tavi -OPTION_VALUE_ORCHID=Orkidea -OPTION_VALUE_STEELBLUE=Terässininen -OPTION_VALUE_PLUM=Luumu -OPTION_VALUE_CHOCOLATE=Suklaa -OPTION_VALUE_GOLD=Kulta -OPTION_VALUE_DARKBLUE=Tummansininen -OPTION_VALUE_SKY=Taivas -OPTION_VALUE_HARLEQUIN=Harlekiini -OPTION_VALUE_CYAN=Syaani -OPTION_VALUE_FLAME=Liekki + SING_LEGEND_SELECT=Valitse SING_LEGEND_NAVIGATE=Selaa @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Kappalelista SING_SONG_IN_CAT=Laulu SING_SONGS_IN_CAT=Kappaletta PLAYLIST_CATTEXT=Kappalelista: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legenda -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duetto SING_TOTAL=Pisteesi SING_MODE=Soololaulu @@ -348,7 +306,6 @@ IMPLODE_GLUE2= ja SONG_MENU_NAME_MAIN=Kappalevalikko SONG_MENU_PLAY=Laula SONG_MENU_CHANGEPLAYERS=Vaihda pelinimeä -SONG_MENU_CANCEL=Peruuta SONG_MENU_NAME_PLAYLIST=Kappalelistavalikko SONG_MENU_PLAYLIST_ADD=Lisää kappale @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Jokeri SONG_MENU_NAME_PARTY_JOKER=Ota jokeri -SONG_JUMPTO_DESC=Etsi kappaletta -SONG_JUMPTO_TYPE_DESC=Etsi kaletta: +SONG_MENU_LEGEND_TITLE=Legenda +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duetto +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Kappalelistavalikko +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Lisää kappale +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Poista kappale +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Tiimit PARTY_DIFFICULTY=Vaikeustaso @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx Laulettu ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Kierroksien määrä ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,54 +522,39 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Seuraavat laulajat mikrofoneille ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Kappalelistavalikko -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Lisää kappale -SONG_MENU_DELETE_SONG=Poista kappale -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Pelaajien määrä NAME_CURRENT_PLAYER=Pelaaja -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ;TODO: ABOUT_MAIN=About... ;TODO: ABOUT_USDX_DEVELOPEDBY=Developed by ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org ;TODO: DEVELOPERS_TITLE=Developed by ;TODO: DEVELOPERS_OVERVIEW=People who has contributed to this project:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Visit us for more information.\n\nhttps://ultrastar-es.org ;TODO: SCREENSHOT_SAVED=Screenshot saved -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot MSG_ERROR_TITLE=Virhe MSG_INFO_TITLE=Informaatio @@ -600,5 +570,159 @@ ERROR_CORRUPT_SONG_FILE_NOT_FOUND=Kappaletta ei voitu avata: Tiedostoa ei löyty ERROR_CORRUPT_SONG_NO_NOTES=Kappaletta ei voitu avata: Ei löytynyt yhtään nuottia ERROR_CORRUPT_SONG_NO_BREAKS=Kappaletta ei voitu avata: Ei löytynyt yhtään rivinvaihtoa ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Kappaletta ei voitu avata: Virhe jäsentäessä riviä %0:d -;TODO: ERROR_PLAYER_DEVICE_ASSIGNMENT=Pelaaja %d is assigned to multiple microphones. Tarkista mikrofoniasetukset -;TODO: ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Pelaaja %d is not assigned to a microphones. Tarkista mikrofoniasetukset +ERROR_PLAYER_DEVICE_ASSIGNMENT=Pelaaja %d is assigned to multiple microphones. Tarkista mikrofoniasetukset +ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Pelaaja %d is not assigned to a microphones. Tarkista mikrofoniasetukset + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Erikoiset +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Takaisin +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Musta +C_COLOR_BLUE=Sininen +C_COLOR_BROWN=Ruskea +C_COLOR_CYAN=Syaani +C_COLOR_CHOCOLATE=Suklaa +C_COLOR_DARKBLUE=Tummansininen +C_COLOR_FLAME=Liekki +C_COLOR_GOLD=Kulta +C_COLOR_GRAY=Harmaa +C_COLOR_GREEN=Vihreä +C_COLOR_GREENYELLOW=Vihreä keltainen +C_COLOR_HARLEQUIN=Harlekiini +C_COLOR_LAVENDER=Laventeli +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Oranssi +C_COLOR_ORCHID=Orkidea +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Pinkki +C_COLOR_PLUM=Luumu +C_COLOR_RED=Punainen +C_COLOR_SALMON=Lohi +C_COLOR_SKY=Taivas +C_COLOR_STEELBLUE=Terässininen +C_COLOR_TEAL=Tavi +C_COLOR_TURQUOISE=Turkoosi +C_COLOR_VIOLET=Violetti +C_COLOR_WHITE=Valkoinen +C_COLOR_YELLOW=Keltainen +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Peli +C_GRAPHICS=Kuva + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Lyriikat + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Mikrofonit +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Äänet +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Teemat +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes + +;UNUSED: SING_OPTIONS_GAME= +;UNUSED: SING_OPTIONS_GRAPHICS= +;UNUSED: SING_OPTIONS_SOUND= +;UNUSED: SING_OPTIONS_LYRICS= +;UNUSED: SING_OPTIONS_THEMES= +;UNUSED: SING_OPTIONS_MICROPHONES= +;UNUSED: SING_OPTIONS_ADVANCED= +;UNUSED: SING_OPTIONS_NETWORK=Internet +;UNUSED: SING_OPTIONS_EXIT= + +;UNUSED: OPTION_VALUE_BLUE= +;UNUSED: OPTION_VALUE_GREEN= +;UNUSED: OPTION_VALUE_PINK= +;UNUSED: OPTION_VALUE_RED= +;UNUSED: OPTION_VALUE_VIOLET= +;UNUSED: OPTION_VALUE_ORANGE= +;UNUSED: OPTION_VALUE_YELLOW= +;UNUSED: OPTION_VALUE_BROWN= +;UNUSED: OPTION_VALUE_BLACK= +;UNUSED: OPTION_VALUE_GRAY= +;UNUSED: OPTION_VALUE_WHITE= +;UNUSED: OPTION_VALUE_TURQUOISE= +;UNUSED: OPTION_VALUE_SALMON= +;UNUSED: OPTION_VALUE_GREENYELLOW= +;UNUSED: OPTION_VALUE_LAVENDER= +;UNUSED: OPTION_VALUE_BEIGE=Beige +;UNUSED: OPTION_VALUE_TEAL= +;UNUSED: OPTION_VALUE_ORCHID= +;UNUSED: OPTION_VALUE_STEELBLUE= +;UNUSED: OPTION_VALUE_PLUM= +;UNUSED: OPTION_VALUE_CHOCOLATE= +;UNUSED: OPTION_VALUE_GOLD= +;UNUSED: OPTION_VALUE_DARKBLUE= +;UNUSED: OPTION_VALUE_SKY= +;UNUSED: OPTION_VALUE_HARLEQUIN= +;UNUSED: OPTION_VALUE_CYAN= +;UNUSED: OPTION_VALUE_FLAME= + diff --git a/game/languages/Svenska.ini b/game/languages/Svenska.ini index f8f16de7..c97dc7f5 100644 --- a/game/languages/Svenska.ini +++ b/game/languages/Svenska.ini @@ -1,5 +1,6 @@ [Text] LANGUAGE=Svenska +LANGUAGE_ISO_CODE=sv SING_LOADING=Läser in... SING_LOADING_SONGS=Läser in låtar från mapp %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Svår SING_OPTIONS=Inställningar -SING_OPTIONS_GAME=Spel -SING_OPTIONS_GRAPHICS=Grafik -SING_OPTIONS_SOUND=Ljud -SING_OPTIONS_LYRICS=Text -SING_OPTIONS_THEMES=Teman -SING_OPTIONS_MICROPHONES=Inspelning -SING_OPTIONS_ADVANCED=Avancerat -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Tillbaka - SING_OPTIONS_GAME_LANGUAGE=Språk SING_OPTIONS_GAME_SONGMENU=Låtmeny ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Tabbar SING_OPTIONS_GAME_SORTING=Sortering -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Aktivera gamepad OPTION_VALUE_ROULETTE=Roulett @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=År OPTION_VALUE_DECADE=Årtionde OPTION_VALUE_PLAYLIST=Spellista -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Helskärm SING_OPTIONS_GRAPHICS_RESOLUTION=Upplösning @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Mikrofonuppspelning SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Bakgrundsmusik SING_OPTIONS_SOUND_CLICK_ASSIST=Hjälpljud SING_OPTIONS_SOUND_BEAT_CLICK=Taktljud -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Volym i låtvalsmenyn SING_OPTIONS_SOUND_PREVIEWFADING=Toning i låtvalsmenyn @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Vid låtval SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Säkerhetsfråga SING_OPTIONS_ADVANCED_PARTYPOPUP=Automatisk Partymeny ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Alla OPTION_VALUE_PLAYER=Spelare @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Spelare ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Användarnamn SING_OPTIONS_NETWORK_PASSWORD=Lösenord -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Spelare -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? SING_OPTIONS_NETWORK_LEGEND_INSERT=Föra in @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Ångra ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Ångra ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! SONG_SCORE_MAX=Bäst: SONG_SCORE_MEDIA=Genomsnitt: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send SCORE_SEND_PLAYER=Spelare -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Ladda ner SCORE_DOWNLOAD_SONG=Låt: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Ångra ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_SATURATION=Mättnad SING_OPTIONS_WEBCAM_EFFECT=Effekt SING_OPTIONS_WEBCAM_PREVIEW=Aktivera förhandsgranskning -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Ljudtröskel ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Blå ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Sjung -OPTION_VALUE_ACTUAL=Övre -OPTION_VALUE_NEXT=Botten +OPTION_VALUE_TOP=Övre +OPTION_VALUE_BOTTOM=Botten ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Blå -OPTION_VALUE_GREEN=Grön -OPTION_VALUE_PINK=Rosa -OPTION_VALUE_RED=Röd -OPTION_VALUE_VIOLET=Lila -OPTION_VALUE_ORANGE=Orange -OPTION_VALUE_YELLOW=Gul -OPTION_VALUE_BROWN=Brun -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_BLACK=Svart -OPTION_VALUE_GRAY=Grå -OPTION_VALUE_WHITE=Vit -OPTION_VALUE_TURQUOISE=Turkos -OPTION_VALUE_SALMON=Lax -OPTION_VALUE_GREENYELLOW=Grön gul -OPTION_VALUE_LAVENDER=Lavendel -OPTION_VALUE_BEIGE=Beige -OPTION_VALUE_TEAL=Kricka -OPTION_VALUE_ORCHID=Orkide -OPTION_VALUE_STEELBLUE=Stålblå -OPTION_VALUE_PLUM=Plommon -OPTION_VALUE_CHOCOLATE=Choklad -OPTION_VALUE_GOLD=Guld -OPTION_VALUE_DARKBLUE=Mörkblå -OPTION_VALUE_SKY=Himmel -OPTION_VALUE_HARLEQUIN=Harlekin -OPTION_VALUE_CYAN=Cyan -OPTION_VALUE_FLAME=Flamma + SING_LEGEND_SELECT=Välj SING_LEGEND_NAVIGATE=Navigera @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Spellista SING_SONG_IN_CAT=Låt SING_SONGS_IN_CAT=Låtar PLAYLIST_CATTEXT=Spellista: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legend -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duett SING_TOTAL=Totalt SING_MODE=Sjung solo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= och SONG_MENU_NAME_MAIN=Låtmeny SONG_MENU_PLAY=Sjung SONG_MENU_CHANGEPLAYERS=Ändra spelare -SONG_MENU_CANCEL=Ångra SONG_MENU_NAME_PLAYLIST=Låtmeny SONG_MENU_PLAYLIST_ADD=Lägg till låt @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Joker SONG_MENU_NAME_PARTY_JOKER=ta joker -SONG_JUMPTO_DESC=sök låt -SONG_JUMPTO_TYPE_DESC=Sök efter: +SONG_MENU_LEGEND_TITLE=Legend +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duett +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Låt +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Låtmeny +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Lägg till låt +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Ta bort låt +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=partyläge PARTY_DIFFICULTY=Svårighetsnivå @@ -430,7 +415,7 @@ PARTY_DISMISSED=Avbröt! PARTY_SCORE_WINS=%s PARTY_SCORE_WINS2=vann! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=Håll god ton @@ -469,7 +454,7 @@ MODE_BLIND_NAME=Blindläge ;TODO: MODE_BLINDTOTAL_NAME=Total Darkness! ;TODO: MODE_BLINDTOTAL_DESC=A duel, but with the notes and the lyrics hidden. Only for the brave! -MODE_1000BLIND_NAME = +1000 Blind +MODE_1000BLIND_NAME= +1000 Blind ;TODO: MODE_1000BLIND_DESC = Gain a lead of more than 1000 points, but without seeing the notes! ;TODO: MODE_DEAF_NAME = Deaf @@ -478,7 +463,7 @@ MODE_1000BLIND_NAME = +1000 Blind ;TODO: MODE_BLINDLYRICS_NAME = No Lyrics ;TODO: MODE_BLINDLYRICS_DESC = Think you know all the lyrics? Sing with the lyrics hidden! -MODE_500BLIND_NAME = +500 Blind +MODE_500BLIND_NAME= +500 Blind ;TODO: MODE_500BLIND_DESC = Gain a lead of more than 500 points, but without seeing the notes! ;TODO: MODE_SHORTSONG_NAME = Short Song @@ -521,7 +506,7 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx sjungna ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox @@ -537,54 +522,39 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=nästa spelare till mikrofonerna ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? JUKEBOX_RANDOM=Slumpmässig JUKEBOX_REPEAT=Upprepa JUKEBOX_FIND=Hitta: JUKEBOX_SORT=Sortera: JUKEBOX_SONGLIST=Lista över låtar -SONG_MENU_SONG=Låt -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Låtmeny -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Lägg till låt -SONG_MENU_DELETE_SONG=Ta bort låt -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Antal spelare NAME_CURRENT_PLAYER=Spelare -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Handla om... ABOUT_USDX_DEVELOPEDBY=Utvecklad av ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ABOUT_OVERVIEW=Upptäck ett nytt sätt att sjunga, ensam, i par eller med vänner. \n Fun är garanterad.\n\nWorldParty är en fork av den ursprungliga versionen Ultrastar Deluxe 1.1 designad och utvecklad av UltraStar España-laget, räknas det med den största karaoke-gemenskapen.\n\n\nDetta program är gratis och libre under GPL-licensen. \n\n Besök oss för mer information.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Utvecklad av DEVELOPERS_OVERVIEW=Personer som har bidragit till detta projekt:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Besök oss för mer information.\n\nhttps://ultrastar-es.org ;TODO: SCREENSHOT_SAVED=Screenshot saved -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot MSG_ERROR_TITLE=Fel ;TODO: MSG_INFO_TITLE=Information @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Låten kunde inte laddas: Kan inte hitta radbrytnin ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Låten kunde inte laddas: Fel på rad %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Spelare %d är tilldelad flera mikrofoner. Kontrollera dina mikrofonalternativ ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Spelare %d är inte tilldelad en mikrofon. Kontrollera dina mikrofonalternativ + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Avancerat +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Tillbaka +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Svart +C_COLOR_BLUE=Blå +C_COLOR_BROWN=Brun +C_COLOR_CYAN=Cyan +C_COLOR_CHOCOLATE=Choklad +C_COLOR_DARKBLUE=Mörkblå +C_COLOR_FLAME=Flamma +C_COLOR_GOLD=Guld +C_COLOR_GRAY=Grå +C_COLOR_GREEN=Grön +C_COLOR_GREENYELLOW=Grön gul +C_COLOR_HARLEQUIN=Harlekin +C_COLOR_LAVENDER=Lavendel +;TODO: C_COLOR_MAGENTA=Magenta +;TODO: C_COLOR_ORANGE=Orange +C_COLOR_ORCHID=Orkide +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Rosa +C_COLOR_PLUM=Plommon +C_COLOR_RED=Röd +C_COLOR_SALMON=Lax +C_COLOR_SKY=Himmel +C_COLOR_STEELBLUE=Stålblå +C_COLOR_TEAL=Kricka +C_COLOR_TURQUOISE=Turkos +C_COLOR_VIOLET=Lila +C_COLOR_WHITE=Vit +C_COLOR_YELLOW=Gul +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Spel +C_GRAPHICS=Grafik + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Text + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Inspelning +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Ljud +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Teman +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/languages/readme.txt b/game/languages/readme.txt index 5628092c..cbe4d3f8 100644 --- a/game/languages/readme.txt +++ b/game/languages/readme.txt @@ -1,45 +1,29 @@ -.o0 Ultrastar Deluxe in your language 0o. +** How to translate Ultrastar WorldParty to your language ** ------------------------ - Table of Contents ------------------------ -1. Introduction -2. Translate texts -3. Wildcards +First of all, thanks for your interest helping us to approach the game to more people. ------------------------ -1. Introduction: ------------------------ -To translate USDX to a new language, copy the file Language.new to [Language].ini with [Language] -replaced by the English name of your language (e.g. German.ini for German). -Translate all texts according to section (2) of this file. +You should clone the project to make the changes. ------------------------ -2. Translate texts: ------------------------ -1) For each target language there is a translation file named [Language].ini where [Language] is the target - language. -2) All lines that have not been translated so far are prefixed with ";TODO:" like the following line - ;TODO: SOME_OPTION=English text here -3) Translate the text if you are familiar with the target language -4) After you have done so remove the ";TODO: " prefix so that it looks like in this German translation: - SOME_OPTION=Hier der deutsche Text - IMPORTANT: Do NOT remove the ";TODO: " prefix if you did not translate the text and it is still English. -5) At the end of the file there might be some lines which start with ";INVALID: " or ";UNUSED: ". - Invalid lines are not correctly formatted lines and might crash USDX. Unused lines are not used - anymore by USDX or they have been renamed. -6) If you want you may add your name to the END (not the beginning) of the file: - ;TRANSLATOR: Mario Translatori - Note the ";" in front of it. -7) Share your translation with others: - - Send the translated file to our Patch-Tracker at SourceForge (http://sourceforge.net/tracker/?group_id=191560&atid=937872) - - or contact us via our IRC channel +Check if your language is under this folder. + +If your language is already created, you should edit that file, if not, copy the English file and rename it to your language. + + +-------------------- +Translating texts: +-------------------- + +- First, check if there are lines with "TODO:" prefix at the begining. + +- You have to translate everything to the right of the "=" sign. + +- Once done, delete the "TODO:" prefix. DO NOT remove it if you haven't translated it + +- Keep in mind, there are some weird signs in the translation, we use it to introduce additional information in the game, DO NOT remove it, adjust it with the rest of the sentence translated. Here you have more info: ----------------------- 3. Wildcards: ----------------------- -Here are some informations about the wildcards in the language texts for the statistic screens (STAT_...): -Information that will replace the wildcards: STAT_OVERVIEW_INTRO: Format: @@ -97,3 +81,10 @@ Y is optional, it is the number of digits for deciaml numbers (Z=d). So, if y is z can be d for numbers and s for texts For the date thing in STAT_OVERVIEW_INTRO you may use %1:.2d for the day and %2:.2d for the month. + + +Once you're done, create a pull request with your changes, or you can upload it to our forum https:/ultrastar-es.org/foro + +If you have any doubt in any translation, you can ask in our forum, we'll be pleased to help you. + +we'll add you to the credits in github, once merged ;) diff --git "a/game/languages/\303\215slenska.ini" "b/game/languages/\303\215slenska.ini" index 16fe009d..2832c9ca 100644 --- "a/game/languages/\303\215slenska.ini" +++ "b/game/languages/\303\215slenska.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Íslenska +LANGUAGE_ISO_CODE=is SING_LOADING=Hleður... SING_LOADING_SONGS=Hleður lög frá möppu %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Erfitt SING_OPTIONS=Stillingar -SING_OPTIONS_GAME=Leikur -SING_OPTIONS_GRAPHICS=Mynd -SING_OPTIONS_SOUND=Hljóð -SING_OPTIONS_LYRICS=Lagatextar -SING_OPTIONS_THEMES=Snið -SING_OPTIONS_MICROPHONES=Upptaka -SING_OPTIONS_ADVANCED=Fleiri stillingar -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Til baka - SING_OPTIONS_GAME_LANGUAGE=Tungumál SING_OPTIONS_GAME_SONGMENU=Lagavalmynd ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Flipar SING_OPTIONS_GAME_SORTING=Röðun -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Virkja gamepad OPTION_VALUE_ROULETTE=Rúlletta @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Ár OPTION_VALUE_DECADE=Áratugur OPTION_VALUE_PLAYLIST=Lagalisti -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Skjáfyllir SING_OPTIONS_GRAPHICS_RESOLUTION=Skjáupplausn @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Spilun af hljóðnema SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Bakgrunnstónlist SING_OPTIONS_SOUND_CLICK_ASSIST=Taktstuðningur SING_OPTIONS_SOUND_BEAT_CLICK=Slá takt -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Forsýn hljóðstyrkur SING_OPTIONS_SOUND_PREVIEWFADING=Forsýn útþynning @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Eftir Lagaval SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Öryggisspurningar SING_OPTIONS_ADVANCED_PARTYPOPUP=Sjálfvirk Partívalmynd ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Öllu OPTION_VALUE_PLAYER=Leikmaður @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Leikmaður ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Notendanafn SING_OPTIONS_NETWORK_PASSWORD=Lykilorð -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name SING_OPTIONS_NETWORK_AUTO_MODE=Sjálfvirkt SING_OPTIONS_NETWORK_AUTO_PLAYER=Leikmaður -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Hætta við ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ SONG_MENU_REFRESH_SCORES_TITLE=Uppfæra ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song SONG_MENU_REFRESH_SCORES_REFRESH=Uppfæra ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send ;TODO: SCORE_SEND_PLAYER=Player -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Sækja ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Hætta við ;TODO: SCORE_DOWNLOAD_OK=OK @@ -231,17 +221,17 @@ SING_OPTIONS_WEBCAM_EFFECT=Brellur SING_OPTIONS_WEBCAM_PREVIEW=Virkja forskoðun SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Virkja forskoðun -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Þröskuldur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Blár ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Syngja -OPTION_VALUE_ACTUAL=Efri -OPTION_VALUE_NEXT=Neðst +OPTION_VALUE_TOP=Efri +OPTION_VALUE_BOTTOM=Neðst ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Blár -OPTION_VALUE_GREEN=Grænn -OPTION_VALUE_PINK=Bleikur -OPTION_VALUE_RED=Rauður -OPTION_VALUE_VIOLET=Fjólublár -OPTION_VALUE_ORANGE=Appelsínulitur -OPTION_VALUE_YELLOW=Gulur -OPTION_VALUE_BROWN=Brúnn -OPTION_VALUE_BLACK=Svartur -;TODO: OPTION_VALUE_MAGENTA=Magenta -;TODO: OPTION_VALUE_GRAY=Gray -OPTION_VALUE_WHITE=Hvítur -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -OPTION_VALUE_CHOCOLATE=Súkkulaði -OPTION_VALUE_GOLD=Gull -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Velja SING_LEGEND_NAVIGATE=Stýra @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Lagalisti SING_SONG_IN_CAT=Song SING_SONGS_IN_CAT=Lög PLAYLIST_CATTEXT=Lagalisti: %s -;TODO: SING_SONG_SELECTION_LEGEND_TITLE=Legend -;TODO: SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -;TODO: SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Samtals SING_MODE=Syngja sóló @@ -348,7 +306,6 @@ IMPLODE_GLUE2= og SONG_MENU_NAME_MAIN=Lagavalmynd SONG_MENU_PLAY=Syngja SONG_MENU_CHANGEPLAYERS=Breyta um leikmenn -SONG_MENU_CANCEL=Hætta við SONG_MENU_NAME_PLAYLIST=Lagavalmynd SONG_MENU_PLAYLIST_ADD=Bæta við lagi @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Jóker SONG_MENU_NAME_PARTY_JOKER=Taka jóker -SONG_JUMPTO_DESC=Lagaleit -SONG_JUMPTO_TYPE_DESC=Leita að: +;TODO: SONG_MENU_LEGEND_TITLE=Legend +;TODO: SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +;TODO: SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Lagavalmynd +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Bæta við +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Eyða lagi +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Partísnið PARTY_DIFFICULTY=Erfiðleikastig @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx Sungið ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Fjöldi umferða ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,40 +522,25 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Næstu leikmenn að hljóðnemunum ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Lagavalmynd -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Bæta við -SONG_MENU_DELETE_SONG=Eyða lagi -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Fjöldi leikmanna NAME_CURRENT_PLAYER=Leikmaður -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Um... ABOUT_USDX_DEVELOPEDBY=Þróað af @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Ekki var hægt að hlaða inn lagi: Finn engar lín ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Ekki var hægt að hlaða inn lagi: Villa við þáttun línu %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Leikmaður %d er úthlutað til margra hljóðnema. Athugaðu hljóðnemann valkosti þína ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Leikmaður %d er ekki úthlutað í hljóðnema. Athugaðu hljóðnemann valkosti þína + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Fleiri stillingar +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Til baka +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Svartur +C_COLOR_BLUE=Blár +C_COLOR_BROWN=Brúnn +;TODO: C_COLOR_CYAN=Cyan +C_COLOR_CHOCOLATE=Súkkulaði +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +C_COLOR_GOLD=Gull +;TODO: C_COLOR_GRAY=Gray +C_COLOR_GREEN=Grænn +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Appelsínulitur +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Bleikur +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Rauður +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=Fjólublár +C_COLOR_WHITE=Hvítur +C_COLOR_YELLOW=Gulur +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Leikur +C_GRAPHICS=Mynd + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Lagatextar + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Upptaka +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Hljóð +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Snið +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/\304\214e\305\241tina.ini" "b/game/languages/\304\214e\305\241tina.ini" index f83f1766..1451a9d5 100644 --- "a/game/languages/\304\214e\305\241tina.ini" +++ "b/game/languages/\304\214e\305\241tina.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Čeština +LANGUAGE_ISO_CODE=cs SING_LOADING=Načítání... ;TODO: SING_LOADING_SONGS=Loading songs from folder %s @@ -40,29 +41,18 @@ OPTION_VALUE_HARD=Těžká SING_OPTIONS=Možnosti -SING_OPTIONS_GAME=Hra -SING_OPTIONS_GRAPHICS=Grafika -SING_OPTIONS_SOUND=Zvuk -SING_OPTIONS_LYRICS=Text -SING_OPTIONS_THEMES=Vzhled -SING_OPTIONS_MICROPHONES=Mikrofony -SING_OPTIONS_ADVANCED=Pokročilé -SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Zpět - SING_OPTIONS_GAME_LANGUAGE=Jazyk SING_OPTIONS_GAME_SONGMENU=Menu skladeb ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Složky SING_OPTIONS_GAME_SORTING=Řazení -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Aktivujte gamepad OPTION_VALUE_ROULETTE=Ruleta OPTION_VALUE_CHESSBOARD=Šachovnice OPTION_VALUE_CAROUSEL=Kolotoč -;TODO: OPTION_VALUE_SLOT_MACHINE=Slot Machine +;TODO: OPTION_VALUE_SLOT_MACHINE=Slot machine OPTION_VALUE_LIST=Seznam OPTION_VALUE_MOSAIC=Dlaždice @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Rok OPTION_VALUE_DECADE=Desetiletí OPTION_VALUE_PLAYLIST=Seznam stop -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Na celou obrazovku SING_OPTIONS_GRAPHICS_RESOLUTION=Rozlišení @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Přehrávání z mikrof. SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Hudba na pozadí SING_OPTIONS_SOUND_CLICK_ASSIST=Pomocné tikání SING_OPTIONS_SOUND_BEAT_CLICK=Další rytmika -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Hlasitost ukázky SING_OPTIONS_SOUND_PREVIEWFADING=Odeznění ukázky @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Po výběru skladby SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Potvrzovací dialogy SING_OPTIONS_ADVANCED_PARTYPOPUP=Auto párty-menu ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Všude OPTION_VALUE_PLAYER=Hráč @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Hráč ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website ;TODO: SING_OPTIONS_NETWORK_USERNAME=Username ;TODO: SING_OPTIONS_NETWORK_PASSWORD=Password -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name SING_OPTIONS_NETWORK_AUTO_MODE=Auto ;TODO: SING_OPTIONS_NETWORK_AUTO_PLAYER=Player -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Zrušit ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Zrušit ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send ;TODO: SCORE_SEND_PLAYER=Player -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Zrušit ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_RESOLUTION=Rozlišení SING_OPTIONS_WEBCAM_EFFECT=Efekt SING_OPTIONS_WEBCAM_PREVIEW=Aktivovat náhled -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Práh ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Modrá ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Zpívat -OPTION_VALUE_ACTUAL=Horní -OPTION_VALUE_NEXT=Dno +OPTION_VALUE_TOP=Horní +OPTION_VALUE_BOTTOM=Dno ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Modrá -OPTION_VALUE_GREEN=Zelená -OPTION_VALUE_PINK=Růžová -OPTION_VALUE_RED=Červená -OPTION_VALUE_VIOLET=Fialová -OPTION_VALUE_ORANGE=Oranžová -OPTION_VALUE_YELLOW=Žlutá -OPTION_VALUE_BROWN=Hnědá -OPTION_VALUE_BLACK=Černá -OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Šedá -OPTION_VALUE_WHITE=Bílý -OPTION_VALUE_TURQUOISE=Tyrkysový -OPTION_VALUE_SALMON=Losos -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=Vybrat SING_LEGEND_NAVIGATE=Navigace @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Seznam stop SING_SONG_IN_CAT=Cançon SING_SONGS_IN_CAT=Skladby PLAYLIST_CATTEXT=Seznam stop: %s -SING_SONG_SELECTION_LEGEND_TITLE=Legenda -SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=Celkem SING_MODE=Zpívat sólo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= a SONG_MENU_NAME_MAIN=Menu skladby SONG_MENU_PLAY=Zpívat SONG_MENU_CHANGEPLAYERS=Změnit hráče -SONG_MENU_CANCEL=Zrušit SONG_MENU_NAME_PLAYLIST=Menu skladeb SONG_MENU_PLAYLIST_ADD=Přidat skladbu @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Žolík SONG_MENU_NAME_PARTY_JOKER=Vzít žolíka -SONG_JUMPTO_DESC=Hledat skladbu -SONG_JUMPTO_TYPE_DESC=Hledat: +SONG_MENU_LEGEND_TITLE=Legenda +SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Menu skladeb +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Přidat skladbu +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Odebrat skladbu +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Párty mód PARTY_DIFFICULTY=Obtížnost @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx zpíváno ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Počet kol ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,47 +522,32 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Další hráč k mikrofonu ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Menu skladeb -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Přidat skladbu -SONG_MENU_DELETE_SONG=Odebrat skladbu -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! -;TODO: NAME_PLAYERS_COUNT=Number of Players +;TODO: SING_SONGS_MYSCORES=My scores + +;TODO: NAME_PLAYERS_COUNT=Number of players ;TODO: NAME_CURRENT_PLAYER=Player -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ;TODO: ABOUT_MAIN=About... ABOUT_USDX_DEVELOPEDBY=Vyvinuto ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ABOUT_OVERVIEW=Objevte nový způsob zpěvu, sám, v páru nebo s přáteli. \n Zábava je zaručena.\n\nWorldParty je fork původní verze Ultrastar Deluxe 1.1 navržený a vyvinutý týmem UltraStar España, to se počítá s největší karaoke komunitou.\n\n\nTento program je zdarma a libre pod licencí GPL. \n\n Navštivte nás pro více informací.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=Vyvinuto @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Skladbu se nepodařilo načíst: Nenalezeny informa ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Skladbu se nepodařilo načíst: Chyba při zpracování řádku %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Hráč %d je přiřazen k vícero mikrofonům. Zkontrolujte možnosti mikrofonu ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Hráč %d není přiřazen k mikrofonu. Zkontrolujte možnosti mikrofonu + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Pokročilé +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Zpět +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=Černá +C_COLOR_BLUE=Modrá +C_COLOR_BROWN=Hnědá +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +C_COLOR_GRAY=Šedá +C_COLOR_GREEN=Zelená +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Oranžová +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Růžová +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=Červená +C_COLOR_SALMON=Losos +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +C_COLOR_TURQUOISE=Tyrkysový +C_COLOR_VIOLET=Fialová +C_COLOR_WHITE=Bílý +C_COLOR_YELLOW=Žlutá +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Hra +C_GRAPHICS=Grafika + +;TODO: C_INFORMATION=Information +C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Text + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Mikrofony +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Zvuk +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Vzhled +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254.ini" "b/game/languages/\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254.ini" index 77127ba5..d769c2e3 100644 --- "a/game/languages/\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254.ini" +++ "b/game/languages/\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Ελληνικά +LANGUAGE_ISO_CODE=el SING_LOADING=Φόρτωνει... ;TODO: SING_LOADING_SONGS=Loading songs from folder %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Δύσκολο SING_OPTIONS=Επιλογές -SING_OPTIONS_GAME=Παιχνίδι -SING_OPTIONS_GRAPHICS=Γραφικά -SING_OPTIONS_SOUND=Ήχος -SING_OPTIONS_LYRICS=Στίχοι -SING_OPTIONS_THEMES=Θέματα -SING_OPTIONS_MICROPHONES=Ηχογράφηση -SING_OPTIONS_ADVANCED=Για προχωρημένους -SING_OPTIONS_NETWORK=Διαδίκτυο -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=Πίσω - SING_OPTIONS_GAME_LANGUAGE=Γλώσσα SING_OPTIONS_GAME_SONGMENU=Μενού τραγουδιού SING_OPTIONS_GAME_DUETS=Ντουέτες SING_OPTIONS_GAME_TABS=Ετικέτες SING_OPTIONS_GAME_SORTING=Ταξινόμιση -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Ενεργοποίηση gamepad OPTION_VALUE_ROULETTE=Ρουλέτα @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Ετος OPTION_VALUE_DECADE=Δεκαετία OPTION_VALUE_PLAYLIST=Λίστα -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Πλήρης οθόνη SING_OPTIONS_GRAPHICS_RESOLUTION=Ανάλυση @@ -95,14 +85,14 @@ OPTION_VALUE_WHENNOVIDEO=Όταν δεν υπάρχει βίντεο OPTION_VALUE_WHENNOVIDEOANDIMAGE=Όταν δεν υπάρχει βίντεο και εικόνα ;TODO: OPTION_VALUE_HALF=Half -;TODO: OPTION_VALUE_FULL_VID=Full (Video) -;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & Video) +;TODO: OPTION_VALUE_FULL_VID=Full (video) +;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & video) SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Ήχος μικροφώνου SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Μουσική στο μενού SING_OPTIONS_SOUND_CLICK_ASSIST=Βοήθεια με κλίκ SING_OPTIONS_SOUND_BEAT_CLICK=Βοήθεια ρυθμού -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Ένταση προεπισκόπισης SING_OPTIONS_SOUND_PREVIEWFADING=Σβήσιμο προεπισκόπισης @@ -140,11 +130,11 @@ SING_OPTIONS_MICROPHONES_MIC_BOOST=Ισχύς μικροφώνου SING_OPTIONS_ADVANCED_DEBUG=Αποσυμφόρηση SING_OPTIONS_ADVANCED_OSCILLOSCOPE=Οσκιλοσκόπιο -SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Ερωτήσεις ασφαλείας SING_OPTIONS_ADVANCED_ONSONGCLICK=Μετά απο την επιλογή τραγουδιού +SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Ερωτήσεις ασφαλείας SING_OPTIONS_ADVANCED_PARTYPOPUP=Αυτόματο μενού "Πάρτυ" ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Όλα OPTION_VALUE_PLAYER=Παίχτης @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Παίχτης ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Όνομα χρήστη SING_OPTIONS_NETWORK_PASSWORD=Κωδικός πρόσβασης -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Παίχτης -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Ακύρωση ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Ακύρωση ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites SONG_MENU_REFRESH_SCORES_ALL_SONGS=Ολα τα τραγούδια SONG_MENU_REFRESH_SCORES_ONLY_SONG=Αυτό το τραγούδι ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: SONG_SCORE_MEDIA=Μέσος: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send SCORE_SEND_PLAYER=Παίχτης -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Κατεβάστε SCORE_DOWNLOAD_SONG=Τραγούδι: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Ακύρωση ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_SATURATION=Κορεσμός SING_OPTIONS_WEBCAM_EFFECT=Εφέ SING_OPTIONS_WEBCAM_PREVIEW=Ενεργοποίηση προεπισκόπησης -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Ευαισθησία μικροφώνου ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Μπλε ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=Τραγουδήστε -OPTION_VALUE_ACTUAL=Άνω -OPTION_VALUE_NEXT=Κάτω μέρος +OPTION_VALUE_TOP=Άνω +OPTION_VALUE_BOTTOM=Κάτω μέρος ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Μπλε -OPTION_VALUE_GREEN=Πράσινος -OPTION_VALUE_PINK=Ροζ -OPTION_VALUE_RED=κόκκινο -OPTION_VALUE_VIOLET=Βιολέτα -OPTION_VALUE_ORANGE=Πορτοκάλι -OPTION_VALUE_YELLOW=Κίτρινος -OPTION_VALUE_BROWN=Καστανός -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_BLACK=Μαύρος -OPTION_VALUE_GRAY=Γκρί -OPTION_VALUE_WHITE=άσπρο -OPTION_VALUE_TURQUOISE=Τουρκουάζ -OPTION_VALUE_SALMON=Σολομός -OPTION_VALUE_GREENYELLOW=Πράσινο κίτρινο -OPTION_VALUE_LAVENDER=Λεβάντα -OPTION_VALUE_BEIGE=Μπεζ -OPTION_VALUE_TEAL=Βάσκας -OPTION_VALUE_ORCHID=Ορχιδέα -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -OPTION_VALUE_PLUM=Δαμάσκηνο -OPTION_VALUE_CHOCOLATE=Σοκολάτα -OPTION_VALUE_GOLD=Χρυσός -OPTION_VALUE_DARKBLUE=Σκούρο μπλε -OPTION_VALUE_SKY=Ουρανός -OPTION_VALUE_HARLEQUIN=Αρλεκίνος -OPTION_VALUE_CYAN=Κυανό -OPTION_VALUE_FLAME=Φλόγα + SING_LEGEND_SELECT=Επέλεξε SING_LEGEND_NAVIGATE=Εξερέυνηση @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Λίστα SING_SONG_IN_CAT=Τραγούδι SING_SONGS_IN_CAT=Τραγούδια PLAYLIST_CATTEXT=Λίστα: %s -SING_SONG_SELECTION_LEGEND_TITLE=Θρύλος -SING_SONG_SELECTION_LEGEND_VIDEO=βίντεο -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Ντουέτο SING_TOTAL=Σύνολο SING_MODE=Τραγούδα σόλο @@ -348,7 +306,6 @@ IMPLODE_GLUE2= και SONG_MENU_NAME_MAIN=Μενού τραγουδιών SONG_MENU_PLAY=Τραγουδήστε SONG_MENU_CHANGEPLAYERS=Αλλάξτε παίχτες -SONG_MENU_CANCEL=Ακύρωση SONG_MENU_NAME_PLAYLIST=Μενού τραγουδιού SONG_MENU_PLAYLIST_ADD=Πρόσθεσε τραγούδι @@ -363,7 +320,7 @@ SONG_MENU_NAME_PLAYLIST_NEW=Νέα λίστα SONG_MENU_PLAYLIST_NEW_CREATE=Φτιαξε νέα SONG_MENU_PLAYLIST_NEW_UNNAMED=Χωρίς όνομα -;TODO: SONG_MENU_NAME_PLAYLIST_DELITEM=Really Delete? +;TODO: SONG_MENU_NAME_PLAYLIST_DELITEM=Really delete? SONG_MENU_YES=Ναι SONG_MENU_NO=Όχι @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Μπαλαντέρ SONG_MENU_NAME_PARTY_JOKER=Επιλογή μπαλαντέρ -SONG_JUMPTO_DESC=Ψάξε τραγούδι -SONG_JUMPTO_TYPE_DESC=Ψάξε για: +SONG_MENU_LEGEND_TITLE=Θρύλος +SONG_MENU_LEGEND_VIDEO=βίντεο +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Ντουέτο +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +SONG_MENU_SONG=Τραγούδι +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Μενού τραγουδιού +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Πρόσθεσε τραγούδι +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Διέγραψε τραγούδι +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +SONG_SEARCH_DESC=Что ты хочешь спеть сейчас? PARTY_MODE=Είδος παιχνιδιού "Πάρτυ" PARTY_DIFFICULTY=Δυσκολία @@ -410,7 +395,7 @@ PARTY_SONG_LEGEND_CONTINUE=Τραγουδήστε PARTY_SONG_MENU=Μενού "Πάρτυ" OPTION_VALUE_SING=Τραγουδήστε -;TODO: OPTION_VALUE_SELECT_PLAYERS=Select Players +;TODO: OPTION_VALUE_SELECT_PLAYERS=Select players OPTION_VALUE_OPEN_MENU=Ανοίξτε μενού PARTY_SCORE_DESC=Βαθμολογία τελευταίου γύρου @@ -430,7 +415,7 @@ PARTY_DISMISSED=Αποβολή! PARTY_SCORE_WINS=%s PARTY_SCORE_WINS2=Νίκησε! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=Μείνε πάνω από τη μπάρα! @@ -469,16 +454,16 @@ MODE_BLIND_NAME=Στα τυφλά ;TODO: MODE_BLINDTOTAL_NAME=Total Darkness! ;TODO: MODE_BLINDTOTAL_DESC=A duel, but with the notes and the lyrics hidden. Only for the brave! -MODE_1000BLIND_NAME = +1000 Τυφλός +MODE_1000BLIND_NAME= +1000 Τυφλός ;TODO: MODE_1000BLIND_DESC = Gain a lead of more than 1000 points, but without seeing the notes! -MODE_DEAF_NAME = Κουφός +MODE_DEAF_NAME= Κουφός ;TODO: MODE_DEAF_DESC = Think you know the notes? Can you sing it without the acompaniment? ;TODO: MODE_BLINDLYRICS_NAME = No Lyrics ;TODO: MODE_BLINDLYRICS_DESC = Think you know all the lyrics? Sing with the lyrics hidden! -MODE_500BLIND_NAME = +500 Τυφλός +MODE_500BLIND_NAME= +500 Τυφλός ;TODO: MODE_500BLIND_DESC = Gain a lead of more than 500 points, but without seeing the notes! ;TODO: MODE_SHORTSONG_NAME = Short Song @@ -521,11 +506,10 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx τραγουδήθηκαν ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox -;TODO: PARTY_MODE_NOT_AVAILABLE=Not Available! ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Αριθμός παικτών @@ -538,40 +522,25 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Επόμενοι παίχτες ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? JUKEBOX_RANDOM=Τυχαίος JUKEBOX_REPEAT=Επαναλαμβάνω JUKEBOX_FIND=Εύρημα: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -SONG_MENU_SONG=Τραγούδι -;TODO: SONG_MENU_MEDLEY=Medley +;TODO: JUKEBOX_SONGLIST=List of songs -SONG_MENU_NAME_SONG=Μενού τραγουδιού -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Πρόσθεσε τραγούδι -SONG_MENU_DELETE_SONG=Διέγραψε τραγούδι -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! -;TODO: NAME_PLAYERS_COUNT=Number of Players +;TODO: SING_SONGS_MYSCORES=My scores + +;TODO: NAME_PLAYERS_COUNT=Number of players ;TODO: NAME_CURRENT_PLAYER=Player -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=Σχετικά με... ABOUT_USDX_DEVELOPEDBY=Αναπτύχθηκε από @@ -585,7 +554,7 @@ DEVELOPERS_TITLE=Αναπτύχθηκε από DEVELOPERS_OVERVIEW=Οι άνθρωποι που συνέβαλαν σε αυτό το έργο:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Επισκεφθείτε μας για περισσότερες πληροφορίες.\n\nhttps://ultrastar-es.org ;TODO: SCREENSHOT_SAVED=Screenshot saved -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot MSG_ERROR_TITLE=Σφάλμα ;TODO: MSG_INFO_TITLE=Information @@ -603,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=Το τραγούδι δεν ήταν δυνατό ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Το τραγούδι δεν ήταν δυνατό να φορτώσει: Λάθος στην επικόληση της γραμμής %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Παίχτης %d έχει εκχωρηθεί σε πολλαπλά μικρόφωνα. Ελέγξτε τις επιλογές μικροφώνου σας ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Παίχτης %d δεν έχει αντιστοιχιστεί σε ένα μικρόφωνο. Ελέγξτε τις επιλογές μικροφώνου σας + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Για προχωρημένους +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Πίσω +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Μπεζ +C_COLOR_BLACK=Μαύρος +C_COLOR_BLUE=Μπλε +C_COLOR_BROWN=Καστανός +C_COLOR_CYAN=Κυανό +C_COLOR_CHOCOLATE=Σοκολάτα +C_COLOR_DARKBLUE=Σκούρο μπλε +C_COLOR_FLAME=Φλόγα +C_COLOR_GOLD=Χρυσός +C_COLOR_GRAY=Γκρί +C_COLOR_GREEN=Πράσινος +C_COLOR_GREENYELLOW=Πράσινο κίτρινο +C_COLOR_HARLEQUIN=Αρλεκίνος +C_COLOR_LAVENDER=Λεβάντα +C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Πορτοκάλι +C_COLOR_ORCHID=Ορχιδέα +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Ροζ +C_COLOR_PLUM=Δαμάσκηνο +C_COLOR_RED=κόκκινο +C_COLOR_SALMON=Σολομός +C_COLOR_SKY=Ουρανός +C_COLOR_STEELBLUE=Steel blue +C_COLOR_TEAL=Βάσκας +C_COLOR_TURQUOISE=Τουρκουάζ +C_COLOR_VIOLET=Βιολέτα +C_COLOR_WHITE=άσπρο +C_COLOR_YELLOW=Κίτρινος +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Παιχνίδι +C_GRAPHICS=Γραφικά + +;TODO: C_INFORMATION=Information +C_INTERNET=Διαδίκτυο + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Στίχοι + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Ηχογράφηση +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Ήχος +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Θέματα +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/\320\241\321\200\320\277\321\201\320\272\320\270.ini" "b/game/languages/\320\241\321\200\320\277\321\201\320\272\320\270.ini" index 4c26012d..55d5f477 100644 --- "a/game/languages/\320\241\321\200\320\277\321\201\320\272\320\270.ini" +++ "b/game/languages/\320\241\321\200\320\277\321\201\320\272\320\270.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=Српски +LANGUAGE_ISO_CODE=sr SING_LOADING=Ucitava se... SING_LOADING_SONGS=Лоадинг песме из фолдера %s @@ -40,23 +41,12 @@ OPTION_VALUE_HARD=Tesko SING_OPTIONS=Opcije -SING_OPTIONS_GAME=Igra -SING_OPTIONS_GRAPHICS=Grafika -SING_OPTIONS_SOUND=Zvuk -SING_OPTIONS_LYRICS=Lirike -SING_OPTIONS_THEMES=Teme -SING_OPTIONS_MICROPHONES=Snimanje -SING_OPTIONS_ADVANCED=Ostalo -SING_OPTIONS_NETWORK=Интернет -SING_OPTIONS_WEBCAM=Вебцам -SING_OPTIONS_EXIT=Nazad - SING_OPTIONS_GAME_LANGUAGE=Jezik SING_OPTIONS_GAME_SONGMENU=Meni Pesme ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=Tabovi SING_OPTIONS_GAME_SORTING=Sortiranje -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=Активирајте гамепад OPTION_VALUE_ROULETTE=Роулетте @@ -80,7 +70,7 @@ OPTION_VALUE_YEAR=Година OPTION_VALUE_DECADE=Декада OPTION_VALUE_PLAYLIST=Lista pesama -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=Pun Ekran SING_OPTIONS_GRAPHICS_RESOLUTION=Rezolucija @@ -95,14 +85,14 @@ OPTION_VALUE_WHENNOVIDEO=Када нема видео записа OPTION_VALUE_WHENNOVIDEOANDIMAGE=Када нема видео и слике ;TODO: OPTION_VALUE_HALF=Half -;TODO: OPTION_VALUE_FULL_VID=Full (Video) -;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & Video) +;TODO: OPTION_VALUE_FULL_VID=Full (video) +;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & video) SING_OPTIONS_SOUND_VOICEPASSTHROUGH=Чујте мој глас SING_OPTIONS_SOUND_BACKGROUNDMUSIC=Позадинска музика SING_OPTIONS_SOUND_CLICK_ASSIST=Click assist SING_OPTIONS_SOUND_BEAT_CLICK=Beat click -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=Provera jacine tona SING_OPTIONS_SOUND_PREVIEWFADING=Provera pomracenja @@ -144,7 +134,7 @@ SING_OPTIONS_ADVANCED_ONSONGCLICK=Posle Odabira Pesme SING_OPTIONS_ADVANCED_ASKBEFOREDEL=Bezbednosna Pitanja SING_OPTIONS_ADVANCED_PARTYPOPUP=Automatski Timski Meni ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=Sve OPTION_VALUE_PLAYER=Играч @@ -153,12 +143,12 @@ OPTION_VALUE_PLAYER=Играч ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website SING_OPTIONS_NETWORK_USERNAME=Корисничко име SING_OPTIONS_NETWORK_PASSWORD=Лозинка -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto SING_OPTIONS_NETWORK_AUTO_PLAYER=Играч -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=Nazad ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=Nazad ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online SONG_MENU_REFRESH_SCORES_FILE=Филе -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send SCORE_SEND_PLAYER=Играч -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save SCORE_DOWNLOAD_TITLE=Преузимање SCORE_DOWNLOAD_SONG=Сонг: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=Nazad ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_SATURATION=Засићење SING_OPTIONS_WEBCAM_EFFECT=Efekti ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=Stepen Cujnosti ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=Плави ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=pevaj -OPTION_VALUE_ACTUAL=горњи -OPTION_VALUE_NEXT=Дно +OPTION_VALUE_TOP=горњи +OPTION_VALUE_BOTTOM=Дно ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=Плави -OPTION_VALUE_GREEN=Зелен -OPTION_VALUE_PINK=Пинк -OPTION_VALUE_RED=Црвена -OPTION_VALUE_VIOLET=Виолет -OPTION_VALUE_ORANGE=Наранџаста -OPTION_VALUE_YELLOW=Жута -OPTION_VALUE_BROWN=Бровн -OPTION_VALUE_BLACK=Црн -;TODO: OPTION_VALUE_MAGENTA=Magenta -OPTION_VALUE_GRAY=Греи -OPTION_VALUE_WHITE=бео -OPTION_VALUE_TURQUOISE=Тиркизна -OPTION_VALUE_SALMON=Лосос -OPTION_VALUE_GREENYELLOW=Зелено жута -OPTION_VALUE_LAVENDER=Лаванда -OPTION_VALUE_BEIGE=Беж -OPTION_VALUE_TEAL=Теал -OPTION_VALUE_ORCHID=Орхидеја -OPTION_VALUE_STEELBLUE=Стеел Блуе -OPTION_VALUE_PLUM=Шљива -OPTION_VALUE_CHOCOLATE=Чоколада -OPTION_VALUE_GOLD=Злато -OPTION_VALUE_DARKBLUE=Тамно плава -OPTION_VALUE_SKY=Небо -OPTION_VALUE_HARLEQUIN=Харлекин -OPTION_VALUE_CYAN=Цијан -OPTION_VALUE_FLAME=Пламен + SING_LEGEND_SELECT=Izaberi SING_LEGEND_NAVIGATE=Biraj @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=Lista pesama SING_SONG_IN_CAT=Сонг SING_SONGS_IN_CAT=Песме PLAYLIST_CATTEXT=Playlist: %s -SING_SONG_SELECTION_LEGEND_TITLE=Легенда -SING_SONG_SELECTION_LEGEND_VIDEO=Видео -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -SING_SONG_SELECTION_LEGEND_DUET=Дует SING_TOTAL=Total SING_MODE=pevaj solo @@ -348,7 +306,6 @@ IMPLODE_GLUE2= i SONG_MENU_NAME_MAIN=Meni pesme SONG_MENU_PLAY=Pevaj SONG_MENU_CHANGEPLAYERS=Promeni Igrace -SONG_MENU_CANCEL=Nazad SONG_MENU_NAME_PLAYLIST=Meni Pesme SONG_MENU_PLAYLIST_ADD=Dodaj Pesmu @@ -378,8 +335,36 @@ SONG_MENU_JOKER=Dzoker SONG_MENU_NAME_PARTY_JOKER=Uzmi dzokera -SONG_JUMPTO_DESC=Trazi pesmu -SONG_JUMPTO_TYPE_DESC=Trazi: +SONG_MENU_LEGEND_TITLE=Легенда +SONG_MENU_LEGEND_VIDEO=Видео +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +SONG_MENU_LEGEND_DUET=Дует +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=Meni Pesme +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=Dodaj Pesmu +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=Obrisi Pesmu +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +;TODO: SONG_SEARCH_DESC=What do you want to sing now? PARTY_MODE=Timski mod PARTY_DIFFICULTY=Tezina @@ -397,7 +382,7 @@ PARTY_LEGEND_CONTINUE=Nastavi PARTY_OPTIONS_DESC=podesavanja za timsku igru PARTY_OPTIONS_WHEREAMI=Timske Opcije -PARTY_PLAYER_DESC=Unesi imena igraca i timova! +;TODO: PARTY_PLAYER_ENTER_NAME=Enter names PARTY_ROUNDS_LEGEND_CONTINUE=Zapocni timsku igru PARTY_ROUNDCOUNT=Број рунди @@ -430,7 +415,7 @@ PARTY_DISMISSED=Otpusten! PARTY_SCORE_WINS=%s PARTY_SCORE_WINS2=Pobedio! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=Drzi liniju @@ -469,16 +454,16 @@ MODE_BLIND_NAME=Slepi Mod ;TODO: MODE_BLINDTOTAL_NAME=Total Darkness! ;TODO: MODE_BLINDTOTAL_DESC=A duel, but with the notes and the lyrics hidden. Only for the brave! -MODE_1000BLIND_NAME = +1000 Слеп +MODE_1000BLIND_NAME= +1000 Слеп ;TODO: MODE_1000BLIND_DESC = Gain a lead of more than 1000 points, but without seeing the notes! -MODE_DEAF_NAME = Глуви +MODE_DEAF_NAME= Глуви ;TODO: MODE_DEAF_DESC = Think you know the notes? Can you sing it without the acompaniment? ;TODO: MODE_BLINDLYRICS_NAME = No Lyrics ;TODO: MODE_BLINDLYRICS_DESC = Think you know all the lyrics? Sing with the lyrics hidden! -MODE_500BLIND_NAME = +500 Слеп +MODE_500BLIND_NAME= +500 Слеп ;TODO: MODE_500BLIND_DESC = Gain a lead of more than 500 points, but without seeing the notes! ;TODO: MODE_SHORTSONG_NAME = Short Song @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx Pevano ;TODO: PARTY_SELECT_MODE=Mode PARTY_MODE_CLASSIC=Цлассиц -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,40 +522,25 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=Sledeci igraci za mikrofonom ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? JUKEBOX_RANDOM=Рандом JUKEBOX_REPEAT=Понављање JUKEBOX_FIND=пронаћи: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=Meni Pesme -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=Dodaj Pesmu -SONG_MENU_DELETE_SONG=Obrisi Pesmu -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! +;TODO: SING_SONGS_MYSCORES=My scores + NAME_PLAYERS_COUNT=Број играча NAME_CURRENT_PLAYER=Играч -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ABOUT_MAIN=О томе... ABOUT_USDX_DEVELOPEDBY=Развијен од стране @@ -584,7 +554,7 @@ DEVELOPERS_TITLE=Развијен од стране DEVELOPERS_OVERVIEW=Људи који су допринели овом пројекту:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n Посетите нас за више информација.\n\nhttps://ultrastar-es.org ;TODO: SCREENSHOT_SAVED=Screenshot saved -;TODO: SCREENSHOT_FAILED=Couldn''t save screenshot +;TODO: SCREENSHOT_FAILED=Couldn't save screenshot MSG_ERROR_TITLE=Greska ;TODO: MSG_INFO_TITLE=Information @@ -602,3 +572,118 @@ ERROR_CORRUPT_SONG=Pesma se ne moze ucitati. ;TODO: ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=Song could not be loaded: Error parsing line %0:d ERROR_PLAYER_DEVICE_ASSIGNMENT=Играч %d додељује се вишеструким микрофонима. Проверите опције микрофона ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Играч %d није додељен микрофону. Проверите опције микрофона + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=Ostalo +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=Nazad +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +C_COLOR_BEIGE=Беж +C_COLOR_BLACK=Црн +C_COLOR_BLUE=Плави +C_COLOR_BROWN=Бровн +C_COLOR_CYAN=Цијан +C_COLOR_CHOCOLATE=Чоколада +C_COLOR_DARKBLUE=Тамно плава +C_COLOR_FLAME=Пламен +C_COLOR_GOLD=Злато +C_COLOR_GRAY=Греи +C_COLOR_GREEN=Зелен +C_COLOR_GREENYELLOW=Зелено жута +C_COLOR_HARLEQUIN=Харлекин +C_COLOR_LAVENDER=Лаванда +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=Наранџаста +C_COLOR_ORCHID=Орхидеја +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=Пинк +C_COLOR_PLUM=Шљива +C_COLOR_RED=Црвена +C_COLOR_SALMON=Лосос +C_COLOR_SKY=Небо +C_COLOR_STEELBLUE=Стеел Блуе +C_COLOR_TEAL=Теал +C_COLOR_TURQUOISE=Тиркизна +C_COLOR_VIOLET=Виолет +C_COLOR_WHITE=бео +C_COLOR_YELLOW=Жута +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=Igra +C_GRAPHICS=Grafika + +;TODO: C_INFORMATION=Information +;C_INTERNET=Интернет + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=Lirike + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=Snimanje +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=Zvuk +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=Teme +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +C_WEBCAM=Вебцам + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/\346\227\245\346\234\254\350\252\236.ini" "b/game/languages/\346\227\245\346\234\254\350\252\236.ini" index 2413c54c..f0f2a854 100644 --- "a/game/languages/\346\227\245\346\234\254\350\252\236.ini" +++ "b/game/languages/\346\227\245\346\234\254\350\252\236.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=日本語 +LANGUAGE_ISO_CODE=ja SING_LOADING=ロード中 ;TODO: SING_LOADING_SONGS=Loading songs from folder %s @@ -40,34 +41,23 @@ OPTION_VALUE_HARD=難しい SING_OPTIONS=設定 -SING_OPTIONS_GAME=ゲーム -SING_OPTIONS_GRAPHICS=グラフィックス -SING_OPTIONS_SOUND=音 -SING_OPTIONS_LYRICS=歌詞 -SING_OPTIONS_THEMES=テーマ -SING_OPTIONS_MICROPHONES=録音 -SING_OPTIONS_ADVANCED=アドバンス -;TODO: SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=戻る - SING_OPTIONS_GAME_LANGUAGE=言語 SING_OPTIONS_GAME_SONGMENU=曲メニュー ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=タッブ SING_OPTIONS_GAME_SORTING=ソーティング -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=ゲームパッドを有効にする ;TODO: OPTION_VALUE_ROULETTE=Roulette ;TODO: OPTION_VALUE_CHESSBOARD=Chessboard ;TODO: OPTION_VALUE_CAROUSEL=Carousel -;TODO: OPTION_VALUE_SLOT_MACHINE=Slot Machine +;TODO: OPTION_VALUE_SLOT_MACHINE=Slot machine ;TODO: OPTION_VALUE_LIST=List ;TODO: OPTION_VALUE_MOSAIC=Tile -;TODO: OPTION_VALUE_ON=オン -;TODO: OPTION_VALUE_OFF=オフ +OPTION_VALUE_ON=オン +OPTION_VALUE_OFF=オフ ;TODO: OPTION_VALUE_EDITION=Edition ;TODO: OPTION_VALUE_GENRE=Genre @@ -80,7 +70,7 @@ OPTION_VALUE_ARTIST=歌手 ;TODO: OPTION_VALUE_DECADE=Decade OPTION_VALUE_PLAYLIST=曲順 -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists SING_OPTIONS_GRAPHICS_FULLSCREEN=フルスクリーン SING_OPTIONS_GRAPHICS_RESOLUTION=解像 @@ -92,17 +82,17 @@ SING_OPTIONS_GRAPHICS_MOVIE_SIZE=動画サイズ ;TODO: OPTION_VALUE_BORDERLESS=Borderless ;TODO: OPTION_VALUE_WHENNOVIDEO=When No Video -;TODO: OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No Video and Image +;TODO: OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No video and image ;TODO: OPTION_VALUE_HALF=Half -;TODO: OPTION_VALUE_FULL_VID=Full (Video) -;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & Video) +;TODO: OPTION_VALUE_FULL_VID=Full (video) +;TODO: OPTION_VALUE_FULL_VID_BG=Full (BG & video) SING_OPTIONS_SOUND_VOICEPASSTHROUGH=マイク再生 SING_OPTIONS_SOUND_BACKGROUNDMUSIC=バックグラウンド・ミュージック SING_OPTIONS_SOUND_CLICK_ASSIST=クリック・アシスト SING_OPTIONS_SOUND_BEAT_CLICK=ビート・クリック -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=音量・プリビュー SING_OPTIONS_SOUND_PREVIEWFADING=フェーディング・プリビュー @@ -118,9 +108,9 @@ SING_OPTIONS_LYRICS_FONT=字形 SING_OPTIONS_LYRICS_EFFECT=エフェクト SING_OPTIONS_LYRICS_NOTELINES=五線譜 -;TODO: OPTION_VALUE_PLAIN=stylized -;TODO: OPTION_VALUE_OLINE1=with thin edge -;TODO: OPTION_VALUE_OLINE2=with thick edge +;TODO: OPTION_VALUE_PLAIN=Stylized +;TODO: OPTION_VALUE_OLINE1=With thin edge +;TODO: OPTION_VALUE_OLINE2=With thick edge ;TODO: OPTION_VALUE_SIMPLE=Simple ;TODO: OPTION_VALUE_ZOOM=Zoom @@ -143,8 +133,8 @@ SING_OPTIONS_ADVANCED_OSCILLOSCOPE=オシロスコープ SING_OPTIONS_ADVANCED_ONSONGCLICK=歌った後は SING_OPTIONS_ADVANCED_ASKBEFOREDEL=消す場合は確認 SING_OPTIONS_ADVANCED_PARTYPOPUP=自動的にパーティー・メニューへ -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=全部 ;TODO: OPTION_VALUE_PLAYER=Player @@ -153,12 +143,12 @@ OPTION_VALUE_ALL=全部 ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website ;TODO: SING_OPTIONS_NETWORK_USERNAME=Username ;TODO: SING_OPTIONS_NETWORK_PASSWORD=Password -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name ;TODO: SING_OPTIONS_NETWORK_AUTO_MODE=Auto ;TODO: SING_OPTIONS_NETWORK_AUTO_PLAYER=Player -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=キャンセル ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=キャンセル ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send ;TODO: SCORE_SEND_PLAYER=Player -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=キャンセル ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_RESOLUTION=解像 SING_OPTIONS_WEBCAM_EFFECT=エフェクト ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=極限 ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_COLOR=色 ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=歌う -;TODO: OPTION_VALUE_ACTUAL=Actual -;TODO: OPTION_VALUE_NEXT=Next +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -;TODO: OPTION_VALUE_BLUE=Blue -;TODO: OPTION_VALUE_GREEN=Green -;TODO: OPTION_VALUE_PINK=Pink -;TODO: OPTION_VALUE_RED=Red -;TODO: OPTION_VALUE_VIOLET=Violet -;TODO: OPTION_VALUE_ORANGE=Orange -;TODO: OPTION_VALUE_YELLOW=Yellow -;TODO: OPTION_VALUE_BROWN=Brown -;TODO: OPTION_VALUE_BLACK=Black -;TODO: OPTION_VALUE_MAGENTA=Magenta -;TODO: OPTION_VALUE_GRAY=Gray -;TODO: OPTION_VALUE_WHITE=White -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=選ぶ SING_LEGEND_NAVIGATE=ナビ @@ -302,11 +265,6 @@ SING_SONG_SELECTION_PLAYLIST=曲順 ;TODO: SING_SONG_IN_CAT=Song SING_SONGS_IN_CAT=曲 PLAYLIST_CATTEXT=曲順: %s -;TODO: SING_SONG_SELECTION_LEGEND_TITLE=Legend -;TODO: SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -;TODO: SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=全部 SING_MODE=一人で歌う @@ -348,7 +306,6 @@ IMPLODE_GLUE2= と SONG_MENU_NAME_MAIN=曲メイン・メニュー SONG_MENU_PLAY=歌う SONG_MENU_CHANGEPLAYERS=プレイヤーを変える -SONG_MENU_CANCEL=キャンセル SONG_MENU_NAME_PLAYLIST=曲メニュー SONG_MENU_PLAYLIST_ADD=曲を加える @@ -378,8 +335,36 @@ SONG_MENU_JOKER=ジョーカー SONG_MENU_NAME_PARTY_JOKER=ジョーカーを使う -SONG_JUMPTO_DESC=曲検索 -SONG_JUMPTO_TYPE_DESC=検索: +;TODO: SONG_MENU_LEGEND_TITLE=Legend +;TODO: SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +;TODO: SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=曲メニュー +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=曲を加える +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=曲を消す +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +SONG_SEARCH_DESC=今、何を歌いたいのか? PARTY_MODE=パーティー・モード PARTY_DIFFICULTY=面倒 @@ -410,7 +395,7 @@ PARTY_SONG_LEGEND_CONTINUE=歌う PARTY_SONG_MENU=パーティー・メニュー OPTION_VALUE_SING=歌う -;TODO: OPTION_VALUE_SELECT_PLAYERS=Select Players +;TODO: OPTION_VALUE_SELECT_PLAYERS=Select players ;TODO: OPTION_VALUE_OPEN_MENU=Open Menu PARTY_SCORE_DESC=先回ラウンドの点数 @@ -430,7 +415,7 @@ PARTY_DISMISSED=追放す! PARTY_SCORE_WINS=%s PARTY_SCORE_WINS2=が勝った! -;TODO: MODE_RANDOM_NAME=Random Mode +;TODO: MODE_RANDOM_NAME=Random mode ;TODO: MODE_RANDOM_DESC=Keep yourself on your toes! The game will select a mode for you at random! MODE_HOLDTHELINE_NAME=ラインをキープ @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx 回歌った ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players ;TODO: PARTY_MODE_TOURNAMENT_OPTIONS_DESC=Number of rounds ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,48 +522,33 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=次のプレイヤーがマイクを ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley +;TODO: JUKEBOX_SONGLIST=List of songs -SONG_MENU_NAME_SONG=曲メニュー -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=曲を加える -SONG_MENU_DELETE_SONG=曲を消す -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply - -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! -;TODO: NAME_PLAYERS_COUNT=Number of Players +;TODO: SING_SONGS_MYSCORES=My scores + +;TODO: NAME_PLAYERS_COUNT=Number of players ;TODO: NAME_CURRENT_PLAYER=Player -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ;TODO: ABOUT_MAIN=About... ABOUT_USDX_DEVELOPEDBY=によって開発された ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection -;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n 詳細は当社にお問い合わせください.\n\nhttps://ultrastar-es.org +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection +;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=によって開発された DEVELOPERS_OVERVIEW=このプロジェクトに貢献した人々:\n\n\nZup3r_vock\n\nDaniel20\n\njmfb\n\nTeLiX\n\n\n 詳細は当社にお問い合わせください.\n\nhttps://ultrastar-es.org @@ -600,5 +570,120 @@ ERROR_CORRUPT_SONG_FILE_NOT_FOUND=曲をロードできない: ファイルが ERROR_CORRUPT_SONG_NO_NOTES=曲をロードできない: 音符が見つからない ERROR_CORRUPT_SONG_NO_BREAKS=曲をロードできない: ライン・ブレークが見つからない ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=曲をロードできない: ライン %0:d の解析エラー -;TODO: ERROR_PLAYER_DEVICE_ASSIGNMENT=Player %d is assigned to multiple microphones. Please check your microphones options -;TODO: ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Player %d is not assigned to a microphone. Please check your microphones options +;TODO: ERROR_PLAYER_DEVICE_ASSIGNMENT=Player %d is assigned to multiple microphones. Please check your microphone options +;TODO: ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=Player %d is not assigned to a microphone. Please check your microphone options + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=アドバンス +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=戻る +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +;TODO: C_COLOR_BLACK=Black +;TODO: C_COLOR_BLUE=Blue +;TODO: C_COLOR_BROWN=Brown +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +;TODO: C_COLOR_GRAY=Gray +;TODO: C_COLOR_GREEN=Green +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +;TODO: C_COLOR_MAGENTA=Magenta +;TODO: C_COLOR_ORANGE=Orange +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +;TODO: C_COLOR_PINK=Pink +;TODO: C_COLOR_PLUM=Plum +;TODO: C_COLOR_RED=Red +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +;TODO: C_COLOR_VIOLET=Violet +;TODO: C_COLOR_WHITE=White +;TODO: C_COLOR_YELLOW=Yellow +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=ゲーム +C_GRAPHICS=グラフィックス + +;TODO: C_INFORMATION=Information +;TODO: C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=歌詞 + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=録音 +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=音 +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=テーマ +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git "a/game/languages/\346\231\256\351\200\232\350\257\235.ini" "b/game/languages/\346\231\256\351\200\232\350\257\235.ini" index ed8accc6..8920e8fa 100644 --- "a/game/languages/\346\231\256\351\200\232\350\257\235.ini" +++ "b/game/languages/\346\231\256\351\200\232\350\257\235.ini" @@ -1,5 +1,6 @@ [Text] LANGUAGE=普通话 +LANGUAGE_ISO_CODE=zh SING_LOADING=载入…… ;TODO: SING_LOADING_SONGS=Loading songs from folder %s @@ -40,29 +41,18 @@ OPTION_VALUE_HARD=困难 SING_OPTIONS=选项 -SING_OPTIONS_GAME=游戏 -SING_OPTIONS_GRAPHICS=画面 -SING_OPTIONS_SOUND=声音 -SING_OPTIONS_LYRICS=歌词 -SING_OPTIONS_THEMES=主题 -SING_OPTIONS_MICROPHONES=录音 -SING_OPTIONS_ADVANCED=高级 -;TODO: SING_OPTIONS_NETWORK=Internet -;TODO: SING_OPTIONS_WEBCAM=Webcam -SING_OPTIONS_EXIT=返回 - SING_OPTIONS_GAME_LANGUAGE=语言 SING_OPTIONS_GAME_SONGMENU=歌曲菜单 ;TODO: SING_OPTIONS_GAME_DUETS=Duets SING_OPTIONS_GAME_TABS=标签 SING_OPTIONS_GAME_SORTING=排列 -;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show Scores +;TODO: SING_OPTIONS_GAME_SHOWSCORES=Show scores SING_OPTIONS_GAME_JOYPAD_SUPPORT=激活游戏手柄 ;TODO: OPTION_VALUE_ROULETTE=Roulette ;TODO: OPTION_VALUE_CHESSBOARD=Chessboard ;TODO: OPTION_VALUE_CAROUSEL=Carousel -;TODO: OPTION_VALUE_SLOT_MACHINE=Slot Machine +;TODO: OPTION_VALUE_SLOT_MACHINE=Slot machine ;TODO: OPTION_VALUE_LIST=List ;TODO: OPTION_VALUE_MOSAIC=Tile @@ -80,19 +70,19 @@ OPTION_VALUE_ARTIST2=艺术家2 ;TODO: OPTION_VALUE_DECADE=Decade OPTION_VALUE_PLAYLIST=播放列表 -;TODO: OPTION_VALUE_WHEN_EXISTS=When Exists +;TODO: OPTION_VALUE_WHEN_EXISTS=When exists -SING_OPTIONS_GRAPHICS_RESOLUTION=分辨率 SING_OPTIONS_GRAPHICS_FULLSCREEN=全屏 -SING_OPTIONS_GRAPHICS_EFFECTSING=演唱效果 +SING_OPTIONS_GRAPHICS_RESOLUTION=分辨率 SING_OPTIONS_GRAPHICS_SCREENFADE=画面渐变 +SING_OPTIONS_GRAPHICS_EFFECTSING=演唱效果 SING_OPTIONS_GRAPHICS_VISUALIZER=可视化 SING_OPTIONS_GRAPHICS_MOVIE_SIZE=影片大小 ;TODO: OPTION_VALUE_BORDERLESS=Borderless OPTION_VALUE_WHENNOVIDEO=无视频时 -;TODO: OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No Video and Image +;TODO: OPTION_VALUE_WHENNOVIDEOANDIMAGE=When No video and image OPTION_VALUE_HALF=一半 OPTION_VALUE_FULL_VID=全屏 (视频) @@ -102,7 +92,7 @@ SING_OPTIONS_SOUND_VOICEPASSTHROUGH=麦克风回放 SING_OPTIONS_SOUND_BACKGROUNDMUSIC=背景音乐 SING_OPTIONS_SOUND_CLICK_ASSIST=“卡嗒”助手 SING_OPTIONS_SOUND_BEAT_CLICK=节拍“卡嗒” -;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music Gain +;TODO: SING_OPTIONS_SOUND_MUSICAUTOGAIN=Music gain SING_OPTIONS_SOUND_PREVIEWVOLUME=预览音量 SING_OPTIONS_SOUND_PREVIEWFADING=预览渐变 @@ -118,9 +108,9 @@ SING_OPTIONS_LYRICS_FONT=字体 SING_OPTIONS_LYRICS_EFFECT=效果 SING_OPTIONS_LYRICS_NOTELINES=五线谱 -;TODO: OPTION_VALUE_PLAIN=stylized -;TODO: OPTION_VALUE_OLINE1=with thin edge -;TODO: OPTION_VALUE_OLINE2=with thick edge +;TODO: OPTION_VALUE_PLAIN=Stylized +;TODO: OPTION_VALUE_OLINE1=With thin edge +;TODO: OPTION_VALUE_OLINE2=With thick edge OPTION_VALUE_SIMPLE=简单 OPTION_VALUE_ZOOM=缩放 @@ -143,8 +133,8 @@ SING_OPTIONS_ADVANCED_OSCILLOSCOPE=示波器 SING_OPTIONS_ADVANCED_ONSONGCLICK=选歌之后 SING_OPTIONS_ADVANCED_ASKBEFOREDEL=安全问题 SING_OPTIONS_ADVANCED_PARTYPOPUP=自动派对菜单 -;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on Singing ;TODO: SING_OPTIONS_ADVANCED_TOPSCORES=Top Scores +;TODO: SING_OPTIONS_ADVANCED_SINGSCORES=Scores on singing OPTION_VALUE_ALL=所有 ;TODO: OPTION_VALUE_PLAYER=Player @@ -153,12 +143,12 @@ OPTION_VALUE_ALL=所有 ;TODO: SING_OPTIONS_NETWORK_WEBSITE=Website ;TODO: SING_OPTIONS_NETWORK_USERNAME=Username ;TODO: SING_OPTIONS_NETWORK_PASSWORD=Password -;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send Name +;TODO: SING_OPTIONS_NETWORK_SEND_SAVE_PLAYER_NAME=Send name SING_OPTIONS_NETWORK_AUTO_MODE=自动 ;TODO: SING_OPTIONS_NETWORK_AUTO_PLAYER=Player -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-Send (Easy) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-Send (Medium) -;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-Send (Hard) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_EASY=Auto-send (easy) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_MEDIUM=Auto-send (medium) +;TODO: SING_OPTIONS_NETWORK_AUTO_SCORE_HARD=Auto-send (hard) ;TODO: SING_OPTIONS_NETWORK_NO_DLL=No compatible leaderboard-plugin found! ;TODO: SING_OPTIONS_NETWORK_DELETE_PLAYER=Really delete the user %0:s of the website %1:s? ;TODO: SING_OPTIONS_NETWORK_LEGEND_INSERT=Insert @@ -184,10 +174,10 @@ MSG_INSERT_USER_CANCEL=取消 ;TODO: WEBSITE_LOGIN_ERROR=Login Incorrect! ;TODO: WEBSITE_BLANK_LOGIN=There are blank fields! ;TODO: WEBSITE_EXIST_USER=Existing user! -;TODO: WEBSITE_ERROR_SCORE=Scoring Error! +;TODO: WEBSITE_ERROR_SCORE=Scoring error! ;TODO: WEBSITE_OK_SEND=Score sent successfully! -;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing Score! -;TODO: WEBSITE_ERROR_SONG=Song Not Found! +;TODO: WEBSITE_ERROR_SCORE_DUPLICATED=Existing score! +;TODO: WEBSITE_ERROR_SONG=Song not found! ;TODO: WEBSITE_SAVE_SCORE=Score save successfully! ;TODO: WEBSITE_NO_CONNECTION_SAVE=No website connection! Save user anyway? @@ -196,25 +186,25 @@ MSG_INSERT_USER_CANCEL=取消 ;TODO: SONG_MENU_REFRESH_SCORES_NO_WEB=There aren't websites! ;TODO: SONG_MENU_REFRESH_SCORES_ONLINE=Online ;TODO: SONG_MENU_REFRESH_SCORES_FILE=File -;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All Websites -;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All Songs -;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This Song +;TODO: SONG_MENU_REFRESH_SCORES_ALL_WEB=All websites +;TODO: SONG_MENU_REFRESH_SCORES_ALL_SONGS=All songs +;TODO: SONG_MENU_REFRESH_SCORES_ONLY_SONG=This song ;TODO: SONG_MENU_REFRESH_SCORES_REFRESH=Update ;TODO: SONG_MENU_REFRESH_SCORES_ERROR_CONNECTION=Error connect to the website: %0:s! -;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [Download Scores]'! +;TODO: SONG_MENU_REFRESH_SCORES_ERROR_FILE=File not found: '%0:s [download scores]'! ;TODO: SONG_SCORE_MAX=Best: ;TODO: SONG_SCORE_MEDIA=Average: -;TODO: SCORE_SEND_DESC=Send Score +;TODO: SCORE_SEND_DESC=Send score ;TODO: SCORE_SEND=Send ;TODO: SCORE_SEND_PLAYER=Player -;TODO: SCORE_SEND_OTHER_USER= Other Username +;TODO: SCORE_SEND_OTHER_USER= Other username ;TODO: SCORE_SAVE=Save ;TODO: SCORE_DOWNLOAD_TITLE=Download ;TODO: SCORE_DOWNLOAD_SONG=Song: -;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing List... +;TODO: SCORE_DOWNLOAD_CREATE_LIST=Preparing list... ;TODO: SCORE_DOWNLOAD_RECEIVE_LIST=Downloading... SCORE_DOWNLOAD_CANCEL=取消 ;TODO: SCORE_DOWNLOAD_OK=OK @@ -230,18 +220,18 @@ SING_OPTIONS_WEBCAM_RESOLUTION=分辨率 SING_OPTIONS_WEBCAM_EFFECT=效果 ;TODO: SING_OPTIONS_WEBCAM_PREVIEW=Activate preview -;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable Preview -;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable Preview -;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No Webcam Found! +;TODO: SING_OPTIONS_WEBCAM_ENABLE_PREVIEW=Enable preview +;TODO: SING_OPTIONS_WEBCAM_DISABLE_PREVIEW=Disable preview +;TODO: SING_OPTIONS_WEBCAM_NO_WEBCAM=No webcam found! ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NORMAL=Normal ;TODO: SING_OPTIONS_WEBCAM_EFFECT_GRAYSCALE=Grayscale -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & White +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BLACK_WHITE=Black & white ;TODO: SING_OPTIONS_WEBCAM_EFFECT_NEGATIVE=Negative -;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary Image +;TODO: SING_OPTIONS_WEBCAM_EFFECT_BINARY_IMAGE=Binary image ;TODO: SING_OPTIONS_WEBCAM_EFFECT_DILATE=Dilate SING_OPTIONS_WEBCAM_EFFECT_THRESHOLD=阈值 ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EDGES=Edges -;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian Blur +;TODO: SING_OPTIONS_WEBCAM_EFFECT_GAUSSIAN_BLUR=Gaussian blur ;TODO: SING_OPTIONS_WEBCAM_EFFECT_EQUALIZED=Equalized ;TODO: SING_OPTIONS_WEBCAM_EFFECT_ERODE=Erode @@ -257,39 +247,12 @@ JUKEBOX_SONGOPTIONS_LYRIC_RGB_BLUE=蓝 ;TODO: JUKEBOX_SONGOPTIONS_LYRIC_POSITION=Position OPTION_VALUE_TO_SING=演唱 -;TODO: OPTION_VALUE_ACTUAL=Actual -;TODO: OPTION_VALUE_NEXT=Next +;TODO: OPTION_VALUE_TOP=Top +;TODO: OPTION_VALUE_BOTTOM=Bottom ;TODO: OPTION_VALUE_OTHER=Other ;TODO: OPTION_VALUE_FILL=Fill ;TODO: OPTION_VALUE_OUTLINE=Outline -OPTION_VALUE_BLUE=蓝 -OPTION_VALUE_GREEN=绿 -OPTION_VALUE_PINK=粉 -OPTION_VALUE_RED=红 -OPTION_VALUE_VIOLET=紫 -OPTION_VALUE_ORANGE=橙 -OPTION_VALUE_YELLOW=黄 -OPTION_VALUE_BROWN=棕 -OPTION_VALUE_BLACK=黑 -;TODO: OPTION_VALUE_MAGENTA=Magenta -;TODO: OPTION_VALUE_GRAY=Gray -;TODO: OPTION_VALUE_WHITE=White -;TODO: OPTION_VALUE_TURQUOISE=Turquoise -;TODO: OPTION_VALUE_SALMON=Salmon -;TODO: OPTION_VALUE_GREENYELLOW=GreenYellow -;TODO: OPTION_VALUE_LAVENDER=Lavender -;TODO: OPTION_VALUE_BEIGE=Beige -;TODO: OPTION_VALUE_TEAL=Teal -;TODO: OPTION_VALUE_ORCHID=Orchid -;TODO: OPTION_VALUE_STEELBLUE=Steel Blue -;TODO: OPTION_VALUE_PLUM=Plum -;TODO: OPTION_VALUE_CHOCOLATE=Chocolate -;TODO: OPTION_VALUE_GOLD=Gold -;TODO: OPTION_VALUE_DARKBLUE=Dark Blue -;TODO: OPTION_VALUE_SKY=Sky -;TODO: OPTION_VALUE_HARLEQUIN=Harlequin -;TODO: OPTION_VALUE_CYAN=Cyan -;TODO: OPTION_VALUE_FLAME=Flame + SING_LEGEND_SELECT=选择 SING_LEGEND_NAVIGATE=导航 @@ -299,14 +262,9 @@ SING_LEGEND_ESC=返回 SING_SONG_SELECTION=歌曲选择 SING_SONG_SELECTION_MENU=菜单 SING_SONG_SELECTION_PLAYLIST=播放列表 -;TODO: SING_SONGS_IN_CAT=Song +;TODO: SING_SONG_IN_CAT=Song SING_SONGS_IN_CAT=歌曲 PLAYLIST_CATTEXT=播放列表: %s -;TODO: SING_SONG_SELECTION_LEGEND_TITLE=Legend -;TODO: SING_SONG_SELECTION_LEGEND_VIDEO=Video -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEY=Medley -;TODO: SING_SONG_SELECTION_LEGEND_MEDLEYC=Medley calculated -;TODO: SING_SONG_SELECTION_LEGEND_DUET=Duet SING_TOTAL=全部 SING_MODE=独唱 @@ -348,7 +306,6 @@ IMPLODE_GLUE2= 和 SONG_MENU_NAME_MAIN=歌曲菜单 SONG_MENU_PLAY=演唱 SONG_MENU_CHANGEPLAYERS=变更玩家 -SONG_MENU_CANCEL=取消 SONG_MENU_NAME_PLAYLIST=歌曲菜单 SONG_MENU_PLAYLIST_ADD=添加歌曲 @@ -378,8 +335,36 @@ SONG_MENU_JOKER=王牌 SONG_MENU_NAME_PARTY_JOKER=使用王牌 -SONG_JUMPTO_DESC=搜索歌曲 -SONG_JUMPTO_TYPE_DESC=查询方式: +;TODO: SONG_MENU_LEGEND_TITLE=Legend +;TODO: SONG_MENU_LEGEND_VIDEO=Video +;TODO: SONG_MENU_LEGEND_MEDLEY=Medley +;TODO: SONG_MENU_LEGEND_MEDLEYC=Medley calculated +;TODO: SONG_MENU_LEGEND_DUET=Duet +;TODO: SONG_MENU_LEGEND_RAP=Rap +;TODO: SONG_MENU_LEGEND_CREATEDBY=Created by +;TODO: SONG_MENU_LEGEND_FIXEDBY=Fixed by +;TODO: SONG_MENU_LEGEND_UNVALIDATED=Unvalidated + +;TODO: SONG_MENU_SONG=Song +;TODO: SONG_MENU_MEDLEY=Medley + +SONG_MENU_NAME_SONG=歌曲菜单 +;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu +SONG_MENU_ADD_SONG=添加歌曲 +;TODO: SONG_MENU_ADD_SONG_TO_LIST=Add song to the list +SONG_MENU_DELETE_SONG=删除歌曲 +;TODO: SONG_MENU_START_MEDLEY=Sing! +;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d songs! + +;TODO: SONG_MENU_NAME_SORTING=Sort menu +;TODO: SONG_MENU_SORTING_APPLY=Apply + +;TODO: SONG_MENU_OPEN_CATEGORY=Open category +;TODO: SONG_MENU_CLOSE_CATEGORY=Close category +;TODO: SONG_MENU_START_JUKEBOX=Start jukebox! +;TODO: SONG_MENU_NAME_JUKEBOX=Menu jukebox + +SONG_SEARCH_DESC=你现在想唱什么? PARTY_MODE=派对模式 PARTY_DIFFICULTY=难度 @@ -521,13 +506,13 @@ STAT_FORMAT_BANDS=%0:s \n %1:dx 唱过 ;TODO: PARTY_SELECT_MODE=Mode ;TODO: PARTY_MODE_CLASSIC=Classic -;TODO: PARTY_MODE_CLASSIC_FREE=Classic Free +;TODO: PARTY_MODE_CLASSIC_FREE=Classic free ;TODO: PARTY_MODE_CHALLENGE=Challenge ;TODO: PARTY_MODE_TOURNAMENT=Tournament ;TODO: PARTY_MODE_JUKEBOX=Jukebox ;TODO: PARTY_MODE_TOURNAMENT_PLAYER_DESC=Insert number and players name -;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of Players +;TODO: PARTY_MODE_TOURNAMENT_NUMBER_PLAYERS=Number of players PARTY_MODE_TOURNAMENT_OPTIONS_DESC=回合数量 ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_FINAL=Final ;TODO: PARTY_MODE_TOURNAMENT_ROUNDS_2FINAL=Semifinals @@ -537,47 +522,32 @@ PARTY_MODE_TOURNAMENT_ROUNDS_DESC=下位演唱歌手 ;TODO: PARTY_MODE_TOURNAMENT_WIN_DESC=Round result ;TODO: PARTY_MODE_TOURNAMENT_CHAMPION=The champion is: %0:s! -;TODO: MSG_END_JUKEBOX=Do you want leave Jukebox Mode? +;TODO: MSG_END_JUKEBOX=Do you want leave jukebox mode? ;TODO: JUKEBOX_RANDOM=Random ;TODO: JUKEBOX_REPEAT=Repeat ;TODO: JUKEBOX_FIND=Find: ;TODO: JUKEBOX_SORT=Sort: -;TODO: JUKEBOX_SONGLIST=List of Songs - -;TODO: SONG_MENU_SONG=Song -;TODO: SONG_MENU_MEDLEY=Medley - -SONG_MENU_NAME_SONG=歌曲菜单 -;TODO: SONG_MENU_NAME_MEDLEY=Medley Menu -SONG_MENU_ADD_SONG=添加歌曲 -SONG_MENU_DELETE_SONG=删除歌曲 -;TODO: SONG_MENU_START_MEDLEY=Sing! -;TODO: SONG_MENU_START_5_MEDLEY=Sing %0:d Songs! - -;TODO: SONG_MENU_NAME_SORTING=Sort Menu -;TODO: SONG_MENU_SORTING_APPLY=Apply +;TODO: JUKEBOX_SONGLIST=List of songs -;TODO: PARTY_PLAYLIST_MANUAL=Manual Selection +;TODO: PARTY_PLAYLIST_MANUAL=Manual selection ;TODO: PARTY_MODE_JUKEBOX_NO_SONGS=Playlist is empty! -;TODO: SONG_MENU_OPEN_CATEGORY=Open category -;TODO: SONG_MENU_CLOSE_CATEGORY=Close category -;TODO: SONG_MENU_START_JUKEBOX=Start Jukebox! -;TODO: SONG_MENU_NAME_JUKEBOX=Menu Jukebox ;TODO: WEBSITE_EXIST_SONG=The song belongs to the website: %0:s ;TODO: WEBSITE_NOT_EXIST_SONG=The song does not belong to any website! -;TODO: NAME_PLAYERS_COUNT=Number of Players +;TODO: SING_SONGS_MYSCORES=My scores + +;TODO: NAME_PLAYERS_COUNT=Number of players ;TODO: NAME_CURRENT_PLAYER=Player -;TODO: JUKEBOX_MODE=Jukebox Mode +;TODO: JUKEBOX_MODE=Jukebox mode ;TODO: ABOUT_MAIN=About... ABOUT_USDX_DEVELOPEDBY=由开发 ;TODO: ABOUT_CHECK_CHECKING=Checking for new updates... ;TODO: ABOUT_CHECK_AVAILABLE=There is a new version available ;TODO: ABOUT_CHECK_UPTODATE=WorldParty is up to date -;TODO: ABOUT_CHECK_CONNECTION=There is no Internet connection +;TODO: ABOUT_CHECK_CONNECTION=There is no internet connection ;TODO: ABOUT_OVERVIEW=Discover a new way of singing, alone, in couple, or with friends. \n Fun is guaranteed.\n\nWorldParty is a fork of the original version Ultrastar Deluxe 1.1 designed and developed by UltraStar España Team, it counts with the biggest karaoke community.\n\n\nThis program is free and libre under the GPL license. \n\n Visit us for more information.\n\nhttps://ultrastar-es.org DEVELOPERS_TITLE=由开发 @@ -595,8 +565,6 @@ MSG_END_PARTY=确定离开派对模式? ERROR_NO_SONGS=未载入歌曲 ERROR_NO_PLUGINS=未载入插件 ;TODO: ERROR_LOADING_SONGS=Wait for loading all the songs -ERROR_NO_MODES_FOR_CURRENT_SETUP=无适合当前玩家/团队设置的模式 -ERROR_CAN_NOT_START_PARTY=派对游戏初始化出现问题 ERROR_CORRUPT_SONG=无法载入歌曲。 ERROR_CORRUPT_SONG_FILE_NOT_FOUND=无法载入歌曲:文件未找到 ERROR_CORRUPT_SONG_NO_NOTES=无法载入歌曲:找不到任何注释 @@ -604,3 +572,118 @@ ERROR_CORRUPT_SONG_NO_BREAKS=无法载入歌曲:找不到任何分秆 ERROR_CORRUPT_SONG_UNKNOWN_IN_LINE=无法载入歌曲:行 %0:d 解析错误 ERROR_PLAYER_DEVICE_ASSIGNMENT=玩家 %d 被指定给多个麦克风,请检查您的麦克风选项 ERROR_PLAYER_NO_DEVICE_ASSIGNMENT=玩家 %d 没有指定麦克风,请检查您的麦克风选项 + +;COMMON TRANSLATIONS: + +;TODO: C_ABOUT=About... +C_ADVANCED=高级 +;TODO: C_ALL=All +;TODO: C_APPLY_CHANGES=Apply changes + +C_BACK=返回 +;TODO: C_BOTTOM=Bottom + +;TODO: C_CLASSIC=Classic +;TODO: C_CHALLENGE=Challenge +;TODO: C_COLOR_BEIGE=Beige +C_COLOR_BLACK=黑 +C_COLOR_BLUE=蓝 +C_COLOR_BROWN=棕 +;TODO: C_COLOR_CYAN=Cyan +;TODO: C_COLOR_CHOCOLATE=Chocolate +;TODO: C_COLOR_DARKBLUE=Dark blue +;TODO: C_COLOR_FLAME=Flame +;TODO: C_COLOR_GOLD=Gold +;TODO: C_COLOR_GRAY=Gray +C_COLOR_GREEN=绿 +;TODO: C_COLOR_GREENYELLOW=Greenyellow +;TODO: C_COLOR_HARLEQUIN=Harlequin +;TODO: C_COLOR_LAVENDER=Lavender +;TODO: C_COLOR_MAGENTA=Magenta +C_COLOR_ORANGE=橙 +;TODO: C_COLOR_ORCHID=Orchid +;TODO: C_COLOR_OTHER=Other +C_COLOR_PINK=粉 +;TODO: C_COLOR_PLUM=Plum +C_COLOR_RED=红 +;TODO: C_COLOR_SALMON=Salmon +;TODO: C_COLOR_SKY=Sky +;TODO: C_COLOR_STEELBLUE=Steel blue +;TODO: C_COLOR_TEAL=Teal +;TODO: C_COLOR_TURQUOISE=Turquoise +C_COLOR_VIOLET=紫 +;TODO: C_COLOR_WHITE=White +C_COLOR_YELLOW=黄 +;TODO: C_CONTINUE=Continue +;TODO: C_CREATEDBY=Created by + +;TODO: C_DUET=Duet +;TODO: C_DUETS=Duets + +;TODO: C_ERROR=Error + +;TODO: C_FIND=Find +;TODO: C_FIXEDBY=Fixed by +;TODO: C_FOLDERS=Folders + +C_GAME=游戏 +C_GRAPHICS=画面 + +;TODO: C_INFORMATION=Information +;TODO: C_INTERNET=Internet + +;TODO: C_JOKER=Joker +;TODO: C_JUKEBOX=Jukebox + +;TODO: C_LEGEND=Legend +;TODO: C_LINE=Line +C_LYRICS=歌词 + +;TODO: C_MEDLEY=Medley +;TODO: C_MEDLEYC=Medyley calcultated +C_MICROPHONES=录音 +;TODO: C_MODE=Mode + +;TODO: C_NEXT=Next +;TODO: C_NO=No +;TODO: C_NO_INTERNET_CONNECTION=No internet connection + +;TODO: C_OPEN_PLAYLIST=Open playlist +;TODO: C_OPTIONS=Options + +;TODO: C_PLAYERS=Players +;TODO: C_PLAYLIST=Playlist +;TODO: C_PROFILES=Profiles + +;TODO: C_QUIT=Quit + +;TODO: C_RANDOM=Random +;TODO: C_RAP=Rap +;TODO: C_REFRESH_SCORES=Refresh scores +;TODO: C_REPEAT=Repeat + +;TODO: C_SAVE=Save +;TODO: C_SEARCH_NEW_SONGS=Search for new songs +;TODO: C_SELECT_THIS_SONG=Select this song +;TODO: C_SEND=Send +;TODO: C_SING=Sing +;TODO: C_SING_MEDLEY=Sing medley +;TODO: C_SONG=Song +;TODO: C_SONGS=Songs +;TODO: C_SORT=Sort +;TODO: C_SORT_SONGS=Sort songs +C_SOUND=声音 +;TODO: C_STATISTICS=Statistics +;TODO: C_STATS=Stats + +;TODO: C_THEME=Theme +C_THEMES=主题 +;TODO: C_TOP=Top + +;TODO: C_UNVALIDATED=Unvalidated + +;TODO: C_VIDEO=Video + +;TODO: C_WEBCAM=Webcam + +;TODO: C_YES=Yes \ No newline at end of file diff --git a/game/libFLAC-8.dll b/game/libFLAC-8.dll deleted file mode 100644 index bcc6524c..00000000 Binary files a/game/libFLAC-8.dll and /dev/null differ diff --git a/game/libjpeg-9.dll b/game/libjpeg-9.dll index 6790e5d8..9d8911ca 100644 Binary files a/game/libjpeg-9.dll and b/game/libjpeg-9.dll differ diff --git a/game/libmodplug-1.dll b/game/libmodplug-1.dll index 69be1be0..d66a317d 100644 Binary files a/game/libmodplug-1.dll and b/game/libmodplug-1.dll differ diff --git a/game/libogg-0.dll b/game/libogg-0.dll deleted file mode 100644 index 1b3a7bd4..00000000 Binary files a/game/libogg-0.dll and /dev/null differ diff --git a/game/libpng16-16.dll b/game/libpng16-16.dll index 30833f0c..fd5db8d1 100644 Binary files a/game/libpng16-16.dll and b/game/libpng16-16.dll differ diff --git a/game/libtiff-5.dll b/game/libtiff-5.dll index 49e2818b..af3c3e66 100644 Binary files a/game/libtiff-5.dll and b/game/libtiff-5.dll differ diff --git a/game/libvorbis-0.dll b/game/libvorbis-0.dll deleted file mode 100644 index 7f79a16a..00000000 Binary files a/game/libvorbis-0.dll and /dev/null differ diff --git a/game/libvorbisfile-3.dll b/game/libvorbisfile-3.dll deleted file mode 100644 index 4e3a5ed9..00000000 Binary files a/game/libvorbisfile-3.dll and /dev/null differ diff --git a/game/libwebp-4.dll b/game/libwebp-4.dll deleted file mode 100644 index 488ce83b..00000000 Binary files a/game/libwebp-4.dll and /dev/null differ diff --git a/game/libwebp-7.dll b/game/libwebp-7.dll new file mode 100644 index 00000000..c11bf138 Binary files /dev/null and b/game/libwebp-7.dll differ diff --git a/game/portaudio_x86.dll b/game/portaudio_x86.dll deleted file mode 100644 index 125b14a1..00000000 Binary files a/game/portaudio_x86.dll and /dev/null differ diff --git a/game/portmixer.dll b/game/portmixer.dll deleted file mode 100644 index fa11a4f0..00000000 Binary files a/game/portmixer.dll and /dev/null differ diff --git a/game/postproc-54.dll b/game/postproc-54.dll deleted file mode 100644 index 59318e24..00000000 Binary files a/game/postproc-54.dll and /dev/null differ diff --git a/game/smpeg2.dll b/game/smpeg2.dll deleted file mode 100644 index 1cef5883..00000000 Binary files a/game/smpeg2.dll and /dev/null differ diff --git a/game/swresample-2.dll b/game/swresample-2.dll deleted file mode 100644 index 60fa41e6..00000000 Binary files a/game/swresample-2.dll and /dev/null differ diff --git a/game/swresample-3.dll b/game/swresample-3.dll new file mode 100644 index 00000000..333100cc Binary files /dev/null and b/game/swresample-3.dll differ diff --git a/game/swscale-4.dll b/game/swscale-4.dll deleted file mode 100644 index 9f07e6dc..00000000 Binary files a/game/swscale-4.dll and /dev/null differ diff --git a/game/swscale-5.dll b/game/swscale-5.dll new file mode 100644 index 00000000..784638b2 Binary files /dev/null and b/game/swscale-5.dll differ diff --git a/game/themes/Fantasy.ini b/game/themes/Argon.ini similarity index 89% rename from game/themes/Fantasy.ini rename to game/themes/Argon.ini index 601b5b51..ee90da85 100644 --- a/game/themes/Fantasy.ini +++ b/game/themes/Argon.ini @@ -8,9 +8,9 @@ ################################### [Theme] -Version = 19.12 +Version = 20.12 Creator = Daniel20 -DefaultSkin = Static Violet +DefaultSkin = Basic Violet [Colors] White = 255 255 255 @@ -50,7 +50,7 @@ Y = 570 Color = White Font = 1 Align = 2 -Size = 24 +Size = 18 Text = SING_LOADING Reflection = 0 ReflectionSpacing = 13 @@ -59,6 +59,28 @@ ReflectionSpacing = 13 [MainBackground] Tex = MainBG +[MainText1] +X = 5 +Y = 15 +Color = White +Font = 0 +Size = 15 +Align = 0 +Text = UltraStar WorldParty 20.12 + +[MainText2] +X = 5 +Y = 35 +Z = 0.5 +Color = White +Font = 0 +Size = 15 +Align = 0 +Text = Beta 1 - https://ultrastar-es.org +Reflection = 0 +ReflectionSpacing = 13 + + [MainTextDescriptionLong] X = 385 Y = 550 @@ -198,7 +220,7 @@ Tex = MainBG #write your name [NameStatic1] X = 50 -Y = 425 +Y = 410 W = 200 H = 35 Tex = MainBar @@ -217,7 +239,7 @@ Type = Transparent [NameText1] X = 30 -Y = 20 +Y = 5 Color = White Font = 0 Size = 45 @@ -226,7 +248,7 @@ Text = SING_PLAYER_TITLE [NameText2] X = 400 -Y = 75 +Y = 60 Color = White Font = 0 Size = 32 @@ -235,12 +257,12 @@ Align = 1 [NameText3] Inheritance = NameText2 -Y = 370 +Y = 355 Text = SING_PLAYER_EDIT [NameText4] X = 70 -Y = 430 +Y = 415 Color = White Font = 0 Size = 22 @@ -260,7 +282,7 @@ Text = SING_PLAYER_NAME Inheritance = OptionsSelectSlide Text = SING_PLAYER_COUNT X = 255 -Y = 150 +Y = 135 W = 205 H = 35 Size = 5 @@ -271,7 +293,7 @@ SBGColor = ColorLight [NamePlayerSelectStatic1] X = 120 -Y = 220 +Y = 205 W = 66 H = 88 Tex = AvatarFrame2 @@ -306,7 +328,7 @@ Color = P6Dark [NamePlayerSelectStatic1Text] X = 152 -Y = 311 +Y = 294 Font = 1 Size = 16 Align = 1 @@ -335,7 +357,7 @@ X = 652 [NamePlayerSelectStatic1Avatar] X = 127 -Y = 228 +Y = 213 W = 51 H = 72 Z = 1 @@ -379,7 +401,7 @@ Type = Transparent [NamePlayerAvatar] X = 570 -Y = 435 +Y = 420 W = 67 H = 90 Type = Transparent @@ -388,7 +410,7 @@ ReflectionSpacing = 10 [NamePlayerButtonAvatar] X = 551 -Y = 417 +Y = 402 W = 107 H = 124 Tex = AvatarFrame @@ -402,7 +424,7 @@ Distance = 40 [NamePlayerButtonName] X = 260 -Y = 425 +Y = 410 W = 150 H = 35 Z = 1 @@ -424,7 +446,7 @@ Color = White Inheritance = OptionsSelectSlide Text= SING_PLAYER_COLOR X = 50 -Y = 470 +Y = 455 W = 200 H = 35 Size = 5 @@ -437,11 +459,11 @@ SBGColor = PlayerLight [NameSelectPlayerLevel] Inheritance = NameSelectPlayerColor Text = SING_PLAYER_LEVEL -Y = 515 +Y = 500 [NamePlayerSingButton] X = 253 -Y = 75 +Y = 60 W = 290 H = 60 Tex = Button @@ -459,7 +481,19 @@ Color = White Size = 30 Font = 0 Align = 1 -Text = STAT_NEXT +Text = C_NEXT + +[NamePlayerExitButton] +Inheritance = OptionsButtonExit2 +X = 50 +Y = 545 +W = 200 +H = 35 + +[NamePlayerExitButtonText1] +Inheritance = OptionsButtonExit2Text +Size = 22 +X = 40 ######################################### ##### S O N G S E L E C T I O N ##### @@ -488,44 +522,34 @@ Type=Fade ColR=0 ColG=0 ColB=0 -Alpha=0.6 +Alpha=0 [SongMenuStatic1] -Tex = interface_dialog_backgroundtop -X = 250 +Tex = Menubg +X = 580 Y = 0 -W = 300 -H = 210 -Z = 0.96 +W = 220 +H = 600 +Z = 0.97 +Alpha = 0.85 Color = White Type = Transparent -#Reflection = 1 -#ReflectionSpacing = 0 - -[SongMenuStatic2] -X = 258 -Y = 15 -W = 24 -H = 24 -Color = White -Tex = icon_song_menu -Type = Colorized -Z = 0.97 [SongMenuTextMenu] -X = 288 -Y = 9 -Z = 0.97 -Color = ColorLight -Size = 36 +X = 690 +Y = 30 +Color = White +Size = 16 Text = MENU +Font = 1 +Align = 1 [SongMenuButton1] -X = 280 -Y = 58 +X = 580 +Y = 70 Z = 0.97 W = 220 -H = 25 +H = 30 Tex = Rectangle Color = ColorLight DColor = ColorDark @@ -533,30 +557,28 @@ Type = Colorized Texts = 1 [SongMenuButton1Text1] -X = 6 -Y = 0 +X = 30 +Y = 6 Z = 0.97 Color = White -Size = 24 -Text = SONG_MENU_PLAY +Size = 14 # shows up instead of Button 1 # in some song menus [SongMenuSelectSlide1] TexSBG = Rectangle -Text = Type = Transparent TypeSBG = Colorized ShowArrows = 1 OneItemOnly = 1 -X = 280 -Y = 58 +X = 580 +Y = 70 W = 0 -H = 25 +H = 30 Z = 0.97 SkipX = 0 SBGW = 220 -TextSize = 24 +TextSize = 15 Color = ColorLight DColor = ColorDark TColor = White @@ -567,103 +589,201 @@ STColor = White STDColor = White [SongMenuButton2] -X = 280 -Y = 85 -Z = 0.97 -W = 220 -H = 25 -Tex = Rectangle -Color = ColorLight -DColor = ColorDark -Type = Colorized -Texts = 1 +Inheritance = SongMenuButton1 +Y = 100 [SongMenuButton2Text1] -X = 6 -Y = 0 -Color = White -Size = 24 -Text = SONG_MENU_EDIT -Z = 0.97 +Inheritance = SongMenuButton1Text1 # shows up instead of Button 2 # in some song menus [SongMenuSelectSlide2] Inheritance = SongMenuSelectSlide1 -Y = 85 +Y = 100 [SongMenuButton3] -X = 280 -Y = 115 -Z = 0.97 -W = 220 -H = 25 -Tex = Rectangle -Color = ColorLight -DColor = ColorDark -Type = Colorized -Texts = 1 +Inheritance = SongMenuButton1 +Y = 130 [SongMenuButton3Text1] -X = 6 -Y = 0 -Color = White -Font = 0 -Size = 24 -Text = SONG_MENU_MODI -Align = 0 -Z = 0.97 +Inheritance = SongMenuButton1Text1 # shows up instead of BUtton 3 # in some song menus [SongMenuSelectSlide3] Inheritance = SongMenuSelectSlide1 -Y = 115 +Y = 130 [SongMenuButton4] -X = 280 -Y = 145 -Z = 0.97 -W = 220 -H = 25 -Tex = Rectangle -Color = ColorLight -DColor = ColorDark -Type = Colorized -Texts = 1 +Inheritance = SongMenuButton1 +Y = 160 [SongMenuButton4Text1] -X = 6 -Y = 0 +Inheritance = SongMenuButton1Text1 + +[SongMenuButton5] +Inheritance = SongMenuButton1 +Y = 190 + +[SongMenuButton5Text1] +Inheritance = SongMenuButton1Text1 + +[SongMenuButton6] +Inheritance = SongMenuButton1 +Y = 220 + +[SongMenuButton6Text1] +Inheritance = SongMenuButton1Text1 + + +# ---- LEGEND SONG MENU ---- + +#text title legend +[SongMenuText1] +X = 690 +Y = 455 +Z = 0.952 +Color = White +Font = 1 +Size = 16 +Align = 1 +Text = C_LEGEND + +#icon video legend +[SongMenuStatic2] +Inheritance = SongVideoIcon +X = 590 +Y = 490 +Z = 0.97 + +#text video legend +[SongMenuText2] +X = 615 +Y = 492 +Z = 0.952 Color = White Font = 0 -Size = 24 -Text = SONG_MENU_CANCEL +Size = 12 Align = 0 +Text = C_VIDEO + +#icon medley legend +[SongMenuStatic3] +Inheritance = SongMedleyIcon +X = 590 +Y = 514 Z = 0.97 -[SongMenuButton5] -X = 280 -Y = 175 +#text medley legend +[SongMenuText3] +X = 615 +Y = 514 +Z = 0.952 +Color = White +Font = 0 +Size = 12 +Align = 0 +Text = C_MEDLEY + +#icon medley calculated legend +[SongMenuStatic4] +Inheritance = SongMenuStatic3 + +#text medley legend +[SongMenuText4] +Inheritance = SongMenuText3 + +#icon duet legend +[SongMenuStatic5] +Inheritance = SongDuetIcon +X = 590 +Y = 536 Z = 0.97 -W = 220 -H = 25 -Tex = Rectangle -Color = ColorLight -DColor = ColorDark -Type = Colorized -Texts = 1 -[SongMenuButton5Text1] -X = 6 -Y = 0 +#text duet legend +[SongMenuText5] +X = 615 +Y = 536 +Z = 0.952 Color = White Font = 0 -Size = 24 -Text = SONG_MENU_CANCEL +Size = 12 +Align = 0 +Text = C_DUET + +#icon rap legend +[SongMenuStatic6] +Inheritance = SongRapIcon +X = 590 +Y = 558 +Z = 0.97 + +#text rap legend +[SongMenuText6] +X = 615 +Y = 558 +Z = 0.952 +Color = White +Font = 0 +Size = 12 +Align = 0 +Text = C_RAP + +#icon Unvalidated legend +[SongMenuStatic9] +Inheritance = SongUnvalidatedIcon +X = 694 +Y = 492 +Z = 0.97 + +#text Unvalidated legend +[SongMenuText9] +X = 717 +Y = 492 +Z = 0.952 +Color = White +Font = 0 +Size = 12 +Align = 0 +Text = C_UNVALIDATED + +#icon createdby legend +[SongMenuStatic7] +Inheritance = SongCreatorIcon +X = 694 +Y = 514 +Z = 0.97 + +#text createdby legend +[SongMenuText7] +X = 717 +Y = 514 +Z = 0.952 +Color = White +Font = 0 +Size = 12 Align = 0 +Text = C_CREATEDBY + +#icon fixedby legend +[SongMenuStatic8] +Inheritance = SongFixerIcon +X = 694 +Y = 536 Z = 0.97 +#text fixedby legend +[SongMenuText8] +X = 717 +Y = 536 +Z = 0.952 +Color = White +Font = 0 +Size = 12 +Align = 0 +Text = C_FIXEDBY + + [SongJumpto] [SongJumptoBackground] @@ -674,62 +794,32 @@ ColB=0 Alpha=0.5 [SongJumptoStatic1] -X = 458 -Y = 20 -W = 24 -H = 24 -Color = White +X = 240 +Y = 555 +W = 320 +H = 30 +Z = 0.97 +Color = ColorDark +DColor = White Tex = icon_song_search Type = Colorized -Z = 0.97 [SongJumptoText1] -X = 488 -Y = 15 +X = 405 +Y = 562 Z = 0.97 -Color = ColorLight -Size = 30 -Text = SONG_JUMPTO_TYPE_DESC +Color = White +Size = 16 +Align = 1 +Text = SONG_SEARCH_DESC -[SongJumptoSelectSlideType] -X = 455 -Y = -40 -Z = 0.97 -H = 30 -SBGW = 240 -SkipX = 0 -Size = 1 -oneItemOnly = 1 -showArrows = 1 -Type = Transparent -#text -TColor = White -TDColor = White -#Select0r.Text.Color -STColor = White -STDColor = White - -[SongJumptoButtonSearchText] -X = 475 -Y = 32 -Z = 0.97 -W = 290 -H = 50 -Size = 30 -Font = 1 -Align = 0 -Color = ColorLight -Type = Transparent - -#[SongJumptoTextFound] -#X = 270 -#Y = 125 -#Color = White -#Font = 0 -#Size = 20 -#Text = SONG_JUMPTO_HELP -#Align = 0 -#Z = 0.97 +[SongJumptoText2] +X = 400 +Y = 560 +Color = White +Font = 0 +Size = 20 +Align = 1 ##################### ### screen song ### @@ -737,98 +827,102 @@ Type = Transparent [SongTextNoSongs] X = 400 -Y = 300 +Y = 280 Align = 1 Color = White Font = 1 -Size = 50 +Size = 30 Text = ERROR_NO_SONGS [SongStaticDuetSinger] -X = 35 -Y = 520 +X = 405 +Y = 435 W = 154 -H = 30 +H = 25 Z = 0.95 Type = Transparent [SongStatic2PlayersDuetSingerP1] Inheritance = SongStaticDuetSinger +X = 405 +Y = 435 Color = P1Dark Tex = SongDuetSinger [SongStatic2PlayersDuetSingerP2] Inheritance = SongStaticDuetSinger -Y = 550 +X = 405 +Y = 460 Color = P2Dark Tex = SongDuetSinger2 Reflection = 0 [SongStatic3PlayersDuetSingerP1] Inheritance = SongStatic2PlayersDuetSingerP1 -Y = 490 +Y = 435 [SongStatic3PlayersDuetSingerP2] Inheritance = SongStatic2PlayersDuetSingerP1 -Y = 520 +Y = 460 Tex = SongDuetSinger3 [SongStatic3PlayersDuetSingerP3] Inheritance = SongStatic2PlayersDuetSingerP2 -Y = 550 +Y = 485 Color = P3Dark [SongStatic4PlayersDuetSingerP3] Inheritance = SongStatic2PlayersDuetSingerP1 -X = 50 +X = 415 Color = P3Dark [SongStatic4PlayersDuetSingerP4] Inheritance = SongStatic2PlayersDuetSingerP2 -X = 50 +X = 415 Color = P4Dark [SongStatic6PlayersDuetSingerP4] Inheritance = SongStatic3PlayersDuetSingerP1 -X = 50 -Y = 490 +X = 415 Color = P4Dark [SongStatic6PlayersDuetSingerP5] Inheritance = SongStatic3PlayersDuetSingerP2 -X = 50 +X = 415 Color = P5Dark [SongStatic6PlayersDuetSingerP6] Inheritance = SongStatic3PlayersDuetSingerP3 -X = 50 +X = 415 Color = P6Dark [SongTextDuetSinger] -X = 112 -Y = 525 +X = 482 +Y = 440 Font = 0 -Size = 20 +Size = 13 Align = 1 Color = White [SongText2PlayersDuetSingerP1] Inheritance = SongTextDuetSinger +Y = 440 [SongText2PlayersDuetSingerP2] Inheritance = SongTextDuetSinger -Y = 555 +Y = 467 [SongText3PlayersDuetSingerP1] Inheritance = SongTextDuetSinger -Y = 495 +Y = 440 [SongText3PlayersDuetSingerP2] Inheritance = SongTextDuetSinger -Y = 525 +Y = 466 [SongText3PlayersDuetSingerP3] Inheritance = SongText2PlayersDuetSingerP2 +Y = 491 [SongEqualizer] Visible = 1 @@ -853,195 +947,143 @@ Reflection = 0 [SongMedleyIcon] Inheritance = SongIcon -X = 335 -Y = 477 -W = 30 -H = 20 +X = 420 +Y = 395 +W = 11 +H = 15 Tex = icon_song_medley [SongCalculatedMedleyIcon] Inheritance = SongMedleyIcon -Tex = icon_song_calcmedley [SongVideoIcon] Inheritance = SongIcon -X = 310 -Y = 475 -W = 18 -H = 24 +X = 345 +Y = 395 +W = 12 +H = 17 Tex = icon_song_video [SongDuetIcon] Inheritance = SongIcon -X = 335 -Y = 475 -W = 20 -H = 24 +X = 420 +Y = 395 +W = 12 +H = 16 Tex = icon_song_duet [SongRapIcon] Inheritance = SongIcon -X = 420 -Y = 475 -W = 18 -H = 24 +X = 450 +Y = 395 +W = 13 +H = 17 Tex = icon_song_rap -########## LEGEND ######### +[SongCreatorIcon] +Inheritance = SongIcon +X = 280 +Y = 510 +W = 12 +H = 16 +Tex = icon_song_createdby -[SongStaticNonParty1] -X = 527 -Y = 405 -Z = 0.95 -W = 163 -H = 107 -Z = 0 -Tex = BGFade -Color = White -Type = Transparent +[SongFixerIcon] +Inheritance = SongIcon +X = 280 +Y = 530 +W = 11 +H = 14 +Tex = icon_song_fixedby -[SongTextNonParty1] -X = 606 -Y = 410 -Z = 0.952 +[SongUnvalidatedIcon] +Inheritance = SongIcon +X = 400 +Y = 535 +W = 11 +H = 14 +Tex = icon_song_unvalidated + +[SongTextMyScores] +X = 335 +Y = 430 Color = White -Font = 1 +Font = 0 Size = 14 Align = 1 -Text = SING_SONG_SELECTION_LEGEND_TITLE +Text = SING_SONGS_MYSCORES -[SongStaticNonParty2] -X = 541 -Y = 430 -Z = 1 -W = 15 -H = 20 -Tex = icon_song_video -Color = White -Type = Transparent +[SongTextWebsite] +Inheritance = SongTextMyScores +X = 445 -[SongTextNonParty2] -X = 570 -Y = 432 -Z = 0.952 -Color = White -Font = 0 -Size = 12 -Align = 0 -Text = SING_SONG_SELECTION_LEGEND_VIDEO +#Local scores -[SongStaticNonParty3] -X = 540 +[SongTextLocalScore1] +X = 325 Y = 450 -Z = 0.952 -W = 26 -H = 16 -Tex = icon_song_medley -Color = White -Type = Transparent - -[SongTextNonParty3] -X = 570 -Y = 452 -Z = 0.952 Color = White Font = 0 Size = 12 -Align = 0 -Text = SING_SONG_SELECTION_LEGEND_MEDLEY +Align = 2 -[SongStaticNonParty4] -X = 540 +[SongTextLocalScore2] +Inheritance = SongTextLocalScore1 Y = 470 -Z = 0.952 -W = 26 -H = 16 -Tex = icon_song_calcmedley -Color = White -Type = Transparent -[SongTextNonParty4] -X = 570 -Y = 472 -Z = 0.952 -Color = White -Font = 0 -Size = 12 -Align = 0 -Text = SING_SONG_SELECTION_LEGEND_MEDLEYC - -[SongStaticNonParty5] -X = 540 +[SongTextLocalScore3] +Inheritance = SongTextLocalScore1 Y = 490 -Z = 0.952 -W = 13 -H = 17 -Tex = icon_song_duet -Color = White -Type = Transparent -[SongTextNonParty5] -X = 570 -Y = 492 -Z = 0.952 +[SongTextUserLocalScore1] +X = 335 +Y = 450 Color = White Font = 0 Size = 12 Align = 0 -Text = SING_SONG_SELECTION_LEGEND_DUET -[SongTextScore] -Color = White -Font = 0 -Size = 22 -Align = 0 +[SongTextUserLocalScore2] +Inheritance = SongTextUserLocalScore1 +Y = 470 -[SongTextMaxScore] -Inheritance = SongTextScore -X = 30 -Y = 500 -Text = SONG_SCORE_MAX +[SongTextUserLocalScore3] +Inheritance = SongTextUserLocalScore1 +Y = 490 -[SongTextMediaScore] -Inheritance = SongTextScore -X = 30 -Y = 540 -Text = SONG_SCORE_MEDIA +#Online Score -[SongTextMaxScore2] -Inheritance = SongTextScore -X = 170 -Y = 500 +[SongTextOnlineScore1] +X = 435 +Y = 450 +Color = White +Font = 0 +Size = 12 Align = 2 -[SongTextMediaScore2] -Inheritance = SongTextScore -X = 170 -Y = 540 -Align = 2 +[SongTextOnlineScore2] +Inheritance = SongTextOnlineScore1 +Y = 470 -[SongTextScoreUser] -Inheritance = SongTextScore -X = 170 -Y = 518 -Color = ColorLight -Align = 2 +[SongTextOnlineScore3] +Inheritance = SongTextOnlineScore1 +Y = 490 -[SongTextMaxScoreLocal] -Inheritance = SongTextScore -X = 180 -Y = 500 +[SongTextUserOnlineScore1] +X = 445 +Y = 450 +Color = White +Font = 0 +Size = 12 +Align = 0 -[SongTextMediaScoreLocal] -Inheritance = SongTextScore -X = 180 -Y = 540 +[SongTextUserOnlineScore2] +Inheritance = SongTextUserOnlineScore1 +Y = 470 -[SongTextScoreUserLocal] -Inheritance = SongTextScore -X = 180 -Y = 518 -Color = ColorLight +[SongTextUserOnlineScore3] +Inheritance = SongTextUserOnlineScore1 +Y = 490 ######################################################################################## ##### ##### @@ -1054,26 +1096,64 @@ Color = ColorLight [SongRouletteBackground] Tex = SongBG -[SongRouletteTextCat] -X = 72 -Y = 58 +#Dummy static +[SongRouletteStaticNonParty1] +Type = Transparent + +#title screen: Song selection +[SongRouletteTextNonParty1] +X = 15 +Y = 15 Color = White Font = 0 -Size = 30 +Size = 40 +Text = SING_SONG_SELECTION Align = 0 +#song info background +[SongRouletteStatic1] +X = 270 +Y = 280 +W = 237 +H = 270 +Z = 0.95 +Alpha = 0.5 +Color = ColorLight +Tex = SongSelection2 +Type = Colorized + +#Arrows +[SongRouletteStatic2] +X = 267 +Y = 100 +W = 244 +H = 200 +Z = 0.95 +Alpha = 0.7 +Color = ColorLight +Tex = SongSelection1 +Type = Colorized + [SongRouletteCover] -Inheritance = SongSlideCover -Y = 150 +X = 315 +Y = 130 H = 150 +W = 150 +Rows = 1 Cols = 5 +Padding = 60 +Reflections = 1 [SongRouletteMainCover] -Inheritance = SongSlideMainCover -Y = 108 +X = 270 +Y = 80 +H = 200 +W = 237 +Type = Transparent [SongRouletteEqualizer] Inheritance = SongEqualizer +Visible = 0 [SongRouletteMedleyIcon] Inheritance = SongMedleyIcon @@ -1090,98 +1170,110 @@ Inheritance = SongDuetIcon [SongRouletteRapIcon] Inheritance = SongRapIcon -[SongRouletteStatic1] -Inheritance = SongSlideStatic1 -Y = 300 -H = 210 +[SongRouletteCreatorIcon] +Inheritance = SongCreatorIcon -[SongRouletteStatic2] -X = 278 -Y = 100 -W = 244 -H = 200 -Z = 0.95 -Alpha = 0.7 -Color = ColorLight -Tex = SongSelection1 -Type = Colorized +[SongRouletteFixerIcon] +Inheritance = SongFixerIcon + +[SongRouletteUnvalidatedIcon] +Inheritance = SongUnvalidatedIcon [SongRouletteTextArtist] -Inheritance = SongSlideTextArtist -Y = 318 +X = 390 +Y = 290 +W = 237 +Color = White +Font = 1 +Size = 20 +Align = 1 [SongRouletteTextTitle] -Inheritance = SongSlideTextTitle -Y = 384 +Inheritance = SongRouletteTextArtist +Y = 340 +Font = 0 +Size = 18 [SongRouletteTextNumber] -Inheritance = SongSlideTextNumber +X = 500 +Y = 530 +Z = 0.95 +Color = White +Size = 12 +Align = 2 [SongRouletteTextYear] -Inheritance = SongSlideTextYear - -########## LEGEND ROULETTE ######### +X = 390 +Y = 395 +Z = 0.95 +Color = White +Size = 16 +Align = 1 -[SongRouletteStaticNonParty1] -Inheritance = SongStaticNonParty1 +[SongRouletteTextCreator] +Inheritance = SongRouletteTextNumber +X = 297 +Y = 510 +Align = 0 -[SongRouletteTextNonParty1] -Inheritance = SongTextNonParty1 +[SongRouletteTextFixer] +Inheritance = SongRouletteTextCreator +Y = 530 -[SongRouletteStaticNonParty2] -Inheritance = SongStaticNonParty2 +[SongRouletteTextMyScores] +Inheritance = SongTextMyScores -[SongRouletteTextNonParty2] -Inheritance = SongTextNonParty2 +[SongRouletteTextWebsite] +Inheritance = SongTextWebsite -[SongRouletteStaticNonParty3] -Inheritance = SongStaticNonParty3 +#Local scores: -[SongRouletteTextNonParty3] -Inheritance = SongTextNonParty3 +[SongRouletteTextLocalScore1] +Inheritance = SongTextLocalScore1 -[SongRouletteStaticNonParty4] -Inheritance = SongStaticNonParty4 +[SongRouletteTextLocalScore2] +Inheritance = SongTextLocalScore2 -[SongRouletteTextNonParty4] -Inheritance = SongTextNonParty4 +[SongRouletteTextLocalScore3] +Inheritance = SongTextLocalScore3 -[SongRouletteStaticNonParty5] -Inheritance = SongStaticNonParty5 +[SongRouletteTextUserLocalScore1] +Inheritance = SongTextUserLocalScore1 -[SongRouletteTextNonParty5] -Inheritance = SongTextNonParty5 +[SongRouletteTextUserLocalScore2] +Inheritance = SongTextUserLocalScore2 -[SongRouletteTextMaxScore] -Inheritance = SongTextMaxScore +[SongRouletteTextUserLocalScore3] +Inheritance = SongTextUserLocalScore3 -[SongRouletteTextMediaScore] -Inheritance = SongTextMediaScore +#Online Scores: -[SongRouletteTextMaxScore2] -Inheritance = SongTextMaxScore2 +[SongRouletteTextOnlineScore1] +Inheritance = SongTextOnlineScore1 -[SongRouletteTextMediaScore2] -Inheritance = SongTextMediaScore2 +[SongRouletteTextOnlineScore2] +Inheritance = SongTextOnlineScore2 -[SongRouletteTextScoreUser] -Inheritance = SongTextScoreUser +[SongRouletteTextOnlineScore3] +Inheritance = SongTextOnlineScore3 -[SongRouletteTextMaxScoreLocal] -Inheritance = SongTextMaxScoreLocal +[SongRouletteTextUserOnlineScore1] +Inheritance = SongTextUserOnlineScore1 -[SongRouletteTextMediaScoreLocal] -Inheritance = SongTextMediaScoreLocal +[SongRouletteTextUserOnlineScore2] +Inheritance = SongTextUserOnlineScore2 -[SongRouletteTextScoreUserLocal] -Inheritance = SongTextScoreUserLocal +[SongRouletteTextUserOnlineScore3] +Inheritance = SongTextUserOnlineScore3 +#Duet singers [SongRouletteStatic2PlayersDuetSingerP1] Inheritance = SongStatic2PlayersDuetSingerP1 [SongRouletteStatic2PlayersDuetSingerP2] Inheritance = SongStatic2PlayersDuetSingerP2 + [SongRouletteStatic3PlayersDuetSingerP1] Inheritance = SongStatic3PlayersDuetSingerP1 @@ -1191,12 +1283,14 @@ Inheritance = SongStatic3PlayersDuetSingerP2 [SongRouletteStatic3PlayersDuetSingerP3] Inheritance = SongStatic3PlayersDuetSingerP3 + [SongRouletteStatic4PlayersDuetSingerP3] Inheritance = SongStatic4PlayersDuetSingerP3 [SongRouletteStatic4PlayersDuetSingerP4] Inheritance = SongStatic4PlayersDuetSingerP4 + [SongRouletteStatic6PlayersDuetSingerP4] Inheritance = SongStatic6PlayersDuetSingerP4 @@ -1206,12 +1300,14 @@ Inheritance = SongStatic6PlayersDuetSingerP5 [SongRouletteStatic6PlayersDuetSingerP6] Inheritance = SongStatic6PlayersDuetSingerP6 + [SongRouletteText2PlayersDuetSingerP1] Inheritance = SongText2PlayersDuetSingerP1 [SongRouletteText2PlayersDuetSingerP2] Inheritance = SongText2PlayersDuetSingerP2 + [SongRouletteText3PlayersDuetSingerP1] Inheritance = SongText3PlayersDuetSingerP1 @@ -1234,89 +1330,7 @@ Inheritance = SongText3PlayersDuetSingerP3 # SongTextNonParty[No] #Here are the ones for singmode -[SongRouletteTextNonParty6] -X = 30 -Y = 6 -Color = White -Font = 0 -Size = 60 -Text = SING_SONG_SELECTION -Align = 0 - -# Menu opens with [M] -[SongRouletteStaticNonParty6] -X = 255 -Y = 560 -W = 25 -H = 30 -Z = 0.952 -Tex = ButtonM -Color = White -Type = Transparent -Reflection = 0 -ReflectionSpacing = 2 - -[SongRouletteTextNonParty7] -X = 287 -Y = 563 -Z = 0.952 -Color = White -Font = 0 -Size = 24 -Align = 0 -Text = SING_SONG_SELECTION_MENU -Reflection = 0 -ReflectionSpacing = 13 - -# The so famous search, shown with [J] -[SongRouletteStaticNonParty7] -X = 375 -Y = 560 -W = 25 -H = 30 -Z = 0.952 -Tex = ButtonJ -Color = White -Type = Transparent -Reflection = 0 -ReflectionSpacing = 2 - -[SongRouletteTextNonParty8] -X = 407 -Y = 563 -Z = 0.952 -Color = White -Font = 0 -Size = 24 -Align = 0 -Text = SONG_JUMPTO_DESC -Reflection = 0 -ReflectionSpacing = 13 - -# [P]laylist -[SongRouletteStaticNonParty8] -X = 580 -Y = 560 -W = 25 -H = 30 -Z = 0.952 -Tex = ButtonP -Color = White -Type = Transparent -Reflection = 0 -ReflectionSpacing = 2 -[SongRouletteTextNonParty9] -X = 612 -Y = 563 -Z = 0.952 -Color = White -Font = 0 -Size = 24 -Align = 0 -Text = SING_SONG_SELECTION_PLAYLIST -Reflection = 0 -ReflectionSpacing = 13 #and these are the ones for partymode @@ -1376,16 +1390,6 @@ Size = 60 Color = White Text = PARTY_MODE -[SongRouletteTextParty3] -X = 238 -Y = 548 -Color = White -Font = 0 -Size = 21 -Align = 2 -Text = PARTY_SONG_WHEREAMI -#variable statics end - # Jokers, 5 for each team, only shown in party Mode [SongRouletteStaticTeamJoker] Inheritance = SongStaticTeamJoker @@ -1499,56 +1503,70 @@ Y = 460 [SongChessboardBackground] Tex = SongBG +#Dummy static +[SongChessboardStaticNonParty1] + +#text title screen +[SongChessboardTextNonParty1] +Inheritance = SongRouletteTextNonParty1 + [SongChessboardStatic1] -Inheritance = SongSlideStatic1 -X = 10 -Y = 270 -W = 195 -H = 195 +#Left panel background +Inheritance = SongRouletteStatic1 +X = 0 +Y = 70 +W = 205 +H = 525 Z = 0.10 -Alpha = 0.45 [SongChessboardStatic2] -X = 750 -Y = 189 -W = 35 -H = 46 +X = 748 +Y = 220 +W = 30 +H = 41 Z = 0.4 Tex = SongSelection1up -Color = ColorLight +Color = ColorDark +DColor = GrayLight Type = Colorized Reflection = 0 ReflectionSpacing = 2 + [SongChessboardStatic3] -X = 750 -Y = 333 -W = 35 -H = 46 +X = 748 +Y = 350 +W = 30 +H = 41 Z = 0.951 Tex = SongSelection1dn -Color = ColorLight +Color = ColorDark +DColor = GrayLight Type = Colorized Reflection = 0 ReflectionSpacing = 2 [SongChessboardCover] -X = 240 -Y = 100 -W = 80 -H = 90 -ZoomThumbW = 100 -ZoomThumbH = 112 -Rows = 4 -Cols = 6 -Padding = 2 +#Central covers Panel +X = 226 +Y = 70 +W = 68 +H = 92 +# Need to be checked: +ZoomThumbW = 120 +# Need to be checked: +ZoomThumbH = 120 +Rows = 5 +Cols = 7 +Padding = 3 Reflections = 0 [SongChessboardMainCover] -X = 10 -Y = 100 -W = 195 -H = 170 +#Video player preview +X = 9 +Y = 83 +W = 186 +H = 145 Type = Transparent [SongChessboardEqualizer] @@ -1562,278 +1580,248 @@ Length = 30 [SongChessboardMedleyIcon] Inheritance = SongMedleyIcon X = 40 -Y = 433 -W = 28 -H = 18 +Y = 390 [SongChessboardCalculatedMedleyIcon] -Inheritance = SongCalculatedMedleyIcon -X = 40 -Y = 433 -W = 28 -H = 18 +Inheritance = SongChessboardMedleyIcon [SongChessboardVideoIcon] Inheritance = SongVideoIcon -X = 18 -Y = 430 -W = 16 -H = 23 +X = 10 +Y = 390 [SongChessboardDuetIcon] Inheritance = SongDuetIcon X = 40 -Y = 430 -W = 18 -H = 22 +Y = 390 [SongChessboardRapIcon] Inheritance = SongRapIcon X = 123 -Y = 430 +Y = 390 + +[SongChessboardCreatorIcon] +Inheritance = SongCreatorIcon +X = 10 +Y = 423 + +[SongChessboardFixerIcon] +Inheritance = SongFixerIcon +X = 10 +Y = 450 + +[SongChessboardUnvalidatedIcon] +Inheritance = SongUnvalidatedIcon [SongChessboardTextArtist] -Inheritance = SongSlideTextArtist -X = 105 -Y = 292 -W = 180 -Size = 21 +Inheritance = SongRouletteTextArtist +X = 102 +Y = 240 +W = 192 [SongChessboardTextTitle] -Inheritance = SongSlideTextTitle -X = 105 -Y = 355 -W = 180 -Size = 21 +Inheritance = SongRouletteTextTitle +X = 102 +Y = 303 +W = 192 [SongChessboardTextNumber] -Inheritance = SongSlideTextNumber -X = 195 -Y = 435 -Size = 15 -Align = 2 +Inheritance = SongRouletteTextNumber +X = 197 +Y = 395 [SongChessboardTextYear] -Inheritance = SongSlideTextYear -X = 105 -Y = 431 -Size = 18 +Inheritance = SongRouletteTextYear +X = 100 +Y = 390 -################# -#### Legend #### -################# +[SongChessboardTextCreator] +Inheritance = SongRouletteTextCreator +X = 30 +Y = 425 -[SongChessboardStaticNonParty1] -Inheritance = SongStaticNonParty1 -X = 567 -Y = 485 +[SongChessboardTextFixer] +Inheritance = SongRouletteTextFixer +X = 30 +Y = 450 -[SongChessboardTextNonParty1] -Inheritance = SongTextNonParty1 -X = 646 -Y = 490 +[SongChessboardTextMyScores] +Inheritance = SongTextMyScores +X = 10 +Y = 480 +Align = 0 + +[SongChessboardTextWebsite] +Inheritance = SongTextWebsite +X = 110 +Y = 480 +Align = 0 +#Local scores: -[SongChessboardStaticNonParty2] -Inheritance = SongStaticNonParty2 -X = 581 +[SongChessboardTextLocalScore1] +Inheritance = SongTextLocalScore1 +X = 35 Y = 510 -[SongChessboardTextNonParty2] -Inheritance = SongTextNonParty2 -X = 610 -Y = 512 -[SongChessboardStaticNonParty3] -Inheritance = SongStaticNonParty3 -X = 580 +[SongChessboardTextLocalScore2] +Inheritance = SongTextLocalScore2 +X = 35 Y = 530 -[SongChessboardTextNonParty3] -Inheritance = SongTextNonParty3 -X = 610 -Y = 532 - -[SongChessboardStaticNonParty4] -Inheritance = SongStaticNonParty4 -X = 580 +[SongChessboardTextLocalScore3] +Inheritance = SongTextLocalScore3 +X = 35 Y = 550 +Align = 2 -[SongChessboardTextNonParty4] -Inheritance = SongTextNonParty4 -X = 610 -Y = 552 - -[SongChessboardStaticNonParty5] -Inheritance = SongStaticNonParty5 -X = 580 -Y = 570 +[SongChessboardTextUserLocalScore1] +Inheritance = SongTextUserLocalScore1 +X = 45 +Y = 510 -[SongChessboardTextNonParty5] -Inheritance = SongTextNonParty5 -X = 610 -Y = 572 +[SongChessboardTextUserLocalScore2] +Inheritance = SongTextUserLocalScore2 +X = 45 +Y = 530 -[SongChessboardTextMaxScore] -Inheritance = SongTextMaxScore -X = 15 -Y = 488 -Size = 20 +[SongChessboardTextUserLocalScore3] +Inheritance = SongTextUserLocalScore3 +X = 45 +Y = 550 -[SongChessboardTextMediaScore] -Inheritance = SongTextMediaScore -X = 15 -Y = 528 -Size = 20 +#Online Scores: +[SongChessboardTextOnlineScore1] +Inheritance = SongTextOnlineScore1 +X = 130 +Y = 510 -[SongChessboardTextMaxScore2] -Inheritance = SongTextMaxScore2 -X = 110 -Y = 488 -Size = 20 +[SongChessboardTextOnlineScore2] +Inheritance = SongTextOnlineScore2 +X = 130 +Y = 530 -[SongChessboardTextMediaScore2] -Inheritance = SongTextMediaScore2 -X = 110 -Y = 528 -Size = 20 +[SongChessboardTextOnlineScore3] +Inheritance = SongTextOnlineScore3 +X = 130 +Y = 550 -[SongChessboardTextScoreUser] -Inheritance = SongTextScoreUser -X = 95 -Y = 506 -Size = 20 -Align = 1 +[SongChessboardTextUserOnlineScore1] +Inheritance = SongTextUserOnlineScore1 +X = 140 +Y = 510 -[SongChessboardTextMaxScoreLocal] -Inheritance = SongTextMaxScoreLocal -X = 165 -Y = 488 -Size = 20 +[SongChessboardTextUserOnlineScore2] +Inheritance = SongTextUserOnlineScore2 +X = 140 +Y = 530 -[SongChessboardTextMediaScoreLocal] -Inheritance = SongTextMediaScoreLocal -X = 165 -Y = 528 -Size = 20 +[SongChessboardTextUserOnlineScore3] +Inheritance = SongTextUserOnlineScore3 +X = 140 +Y = 550 -[SongChessboardTextScoreUserLocal] -Inheritance = SongTextScoreUserLocal -X = 185 -Y = 506 -Size = 20 -Align = 1 [SongChessboardStatic2PlayersDuetSingerP1] Inheritance = SongStatic2PlayersDuetSingerP1 -X = 30 -Y = 475 +X = 100 +Y = 505 +H = 20 +W = 90 [SongChessboardStatic2PlayersDuetSingerP2] Inheritance = SongStatic2PlayersDuetSingerP2 -X = 30 -Y = 505 +X = 100 +Y = 525 +H = 20 +W = 90 [SongChessboardStatic3PlayersDuetSingerP1] Inheritance = SongStatic3PlayersDuetSingerP1 -X = 30 -Y = 475 +X = 100 +Y = 505 +H = 20 +W = 90 [SongChessboardStatic3PlayersDuetSingerP2] Inheritance = SongStatic3PlayersDuetSingerP2 -X = 30 -Y = 505 +X = 100 +Y = 525 +H = 20 +W = 90 [SongChessboardStatic3PlayersDuetSingerP3] Inheritance = SongStatic3PlayersDuetSingerP3 -X = 30 -Y = 535 +X = 100 +Y = 545 +H = 20 +W = 90 [SongChessboardStatic4PlayersDuetSingerP3] Inheritance = SongStatic4PlayersDuetSingerP3 -X = 40 -Y = 475 +X = 108 +Y = 505 +H = 20 +W = 90 [SongChessboardStatic4PlayersDuetSingerP4] Inheritance = SongStatic4PlayersDuetSingerP4 -X = 40 -Y = 505 +X = 108 +Y = 525 +H = 20 +W = 90 [SongChessboardStatic6PlayersDuetSingerP4] Inheritance = SongStatic6PlayersDuetSingerP4 -X = 40 -Y = 475 +X = 108 +Y = 505 +H = 20 +W = 90 [SongChessboardStatic6PlayersDuetSingerP5] Inheritance = SongStatic6PlayersDuetSingerP5 -X = 40 -Y = 505 +X = 108 +Y = 525 +H = 20 +W = 90 [SongChessboardStatic6PlayersDuetSingerP6] Inheritance = SongStatic6PlayersDuetSingerP6 -X = 40 -Y = 535 +X = 108 +Y = 545 +H = 20 +W = 90 + [SongChessboardText2PlayersDuetSingerP1] Inheritance = SongText2PlayersDuetSingerP1 -X = 107 -Y = 480 +X = 145 +Y = 510 +Size = 11 [SongChessboardText2PlayersDuetSingerP2] Inheritance = SongText2PlayersDuetSingerP2 -X = 107 -Y = 510 +X = 145 +Y = 530 +Size = 11 [SongChessboardText3PlayersDuetSingerP1] Inheritance = SongText3PlayersDuetSingerP1 -X = 107 -Y = 480 +X = 145 +Y = 510 +Size = 11 [SongChessboardText3PlayersDuetSingerP2] Inheritance = SongText3PlayersDuetSingerP2 -X = 107 -Y = 510 +X = 145 +Y = 530 +Size = 11 [SongChessboardText3PlayersDuetSingerP3] Inheritance = SongText3PlayersDuetSingerP3 -X = 107 -Y = 540 - -[SongChessboardTextNonParty6] -Inheritance = SongRouletteTextNonParty6 -Y = 15 - -[SongChessboardStaticNonParty6] -Inheritance = SongRouletteStaticNonParty6 -X = 200 -W = 28 - -[SongChessboardTextNonParty7] -Inheritance = SongRouletteTextNonParty7 -X = 237 -Y = 562 -Size = 22 - -[SongChessboardStaticNonParty7] -Inheritance = SongRouletteStaticNonParty7 -X = 295 -W = 28 - -[SongChessboardTextNonParty8] -Inheritance = SongRouletteTextNonParty8 -X = 331 -Y = 562 -Size = 22 - -[SongChessboardStaticNonParty8] -Inheritance = SongRouletteStaticNonParty8 -X = 465 -W = 28 - -[SongChessboardTextNonParty9] -Inheritance = SongRouletteTextNonParty9 -X = 501 -Y = 562 -Size = 22 +X = 145 +Y = 550 +Size = 11 #and these are the ones for partymode # NAVBAR for party @@ -1884,7 +1872,53 @@ Reflection = 0 ReflectionSpacing = 13 #Texts for Party Mode +[SongChessboardStaticParty1] +X = 232 +Y = 561 +Z = 0.952 +W = 26 +H = 28 +Tex = Button13 +Color = White +Type = Transparent + +[SongChessboardTextParty1] +X = 262 +Y = 562 +Z = 0.952 +Color = White +Font = 0 +Size = 24 +Align = 0 +Text = SONG_MENU_NAME_PARTY_JOKER +Reflection = 0 +ReflectionSpacing = 13 + +# menu +[SongChessboardStaticParty3] +X = 410 +Y = 561 +Z = 0.952 +W = 26 +H = 28 +Tex = ButtonM +Color = White +Type = Transparent + [SongChessboardTextParty3] +X = 440 +Y = 562 +Z = 0.952 +Color = White +Font = 0 +Size = 24 +Align = 0 +Text = PARTY_SONG_MENU +Reflection = 0 +ReflectionSpacing = 13 + +#Texts for Party Mode +[SongChessboardTextParty4] X = 30 Y = 15 ColR = 0.7 @@ -1980,16 +2014,24 @@ Y = 520 [SongCarouselBackground] Tex = SongBG +#Dummy static +[SongCarouselStaticNonParty1] + +#text title screen +[SongCarouselTextNonParty1] +Inheritance = SongRouletteTextNonParty1 + [SongCarouselCover] -Inheritance = SongSlideCover -Cols = 3 +Inheritance = SongRouletteCover [SongCarouselMainCover] -Inheritance = SongSlideMainCover +Inheritance = SongRouletteMainCover +X = 280 [SongCarouselEqualizer] Inheritance = SongEqualizer Y = 500 +Visible = 0 [SongCarouselMedleyIcon] Inheritance = SongMedleyIcon @@ -2006,102 +2048,83 @@ Inheritance = SongDuetIcon [SongCarouselRapIcon] Inheritance = SongRapIcon -[SongCarouselStatic1] -Inheritance = SongSlideStatic1 +[SongCarouselCreatorIcon] +Inheritance = SongCreatorIcon -[SongCarouselStatic2] -Inheritance = SongRouletteStatic2 -X = 250 -Y = 120 -W = 302 +[SongCarouselFixerIcon] +Inheritance = SongFixerIcon + +[SongCarouselUnvalidatedIcon] +Inheritance = SongUnvalidatedIcon + +[SongCarouselStatic1] +Inheritance = SongRouletteStatic1 [SongCarouselTextArtist] -Inheritance = SongSlideTextArtist +Inheritance = SongRouletteTextArtist [SongCarouselTextTitle] -Inheritance = SongSlideTextTitle +Inheritance = SongRouletteTextTitle [SongCarouselTextNumber] -Inheritance = SongSlideTextNumber +Inheritance = SongRouletteTextNumber [SongCarouselTextYear] -Inheritance = SongSlideTextYear +Inheritance = SongRouletteTextYear -########## LEGEND CAROUSEL ######### +[SongCarouselTextCreator] +Inheritance = SongRouletteTextCreator -[SongCarouselStaticNonParty1] -Inheritance = SongStaticNonParty1 -X = 582 -Y = 405 +[SongCarouselTextFixer] +Inheritance = SongRouletteTextFixer -[SongCarouselTextNonParty1] -Inheritance = SongTextNonParty1 -X = 661 -Y = 410 +[SongCarouselTextMyScores] +Inheritance = SongTextMyScores -[SongCarouselStaticNonParty2] -Inheritance = SongStaticNonParty2 -X = 596 -Y = 430 +[SongCarouselTextWebsite] +Inheritance = SongTextWebsite -[SongCarouselTextNonParty2] -Inheritance = SongTextNonParty2 -X = 625 -Y = 432 +#Local scores: -[SongCarouselStaticNonParty3] -Inheritance = SongStaticNonParty3 -X = 595 -Y = 450 +[SongCarouselTextLocalScore1] +Inheritance = SongTextLocalScore1 -[SongCarouselTextNonParty3] -Inheritance = SongTextNonParty3 -X = 625 -Y = 452 +[SongCarouselTextLocalScore2] +Inheritance = SongTextLocalScore2 -[SongCarouselStaticNonParty4] -Inheritance = SongStaticNonParty4 -X = 595 -Y = 470 +[SongCarouselTextLocalScore3] +Inheritance = SongTextLocalScore3 -[SongCarouselTextNonParty4] -Inheritance = SongTextNonParty4 -X = 625 -Y = 472 +[SongCarouselTextUserLocalScore1] +Inheritance = SongTextUserLocalScore1 -[SongCarouselStaticNonParty5] -Inheritance = SongStaticNonParty5 -X = 595 -Y = 490 +[SongCarouselTextUserLocalScore2] +Inheritance = SongTextUserLocalScore2 -[SongCarouselTextNonParty5] -Inheritance = SongTextNonParty5 -X = 625 -Y = 492 +[SongCarouselTextUserLocalScore3] +Inheritance = SongTextUserLocalScore3 -[SongCarouselTextMaxScore] -Inheritance = SongTextMaxScore +#Online Scores: -[SongCarouselTextMediaScore] -Inheritance = SongTextMediaScore +[SongCarouselTextOnlineScore1] +Inheritance = SongTextOnlineScore1 -[SongCarouselTextMaxScore2] -Inheritance = SongTextMaxScore2 +[SongCarouselTextOnlineScore2] +Inheritance = SongTextOnlineScore2 -[SongCarouselTextMediaScore2] -Inheritance = SongTextMediaScore2 +[SongCarouselTextOnlineScore3] +Inheritance = SongTextOnlineScore3 -[SongCarouselTextScoreUser] -Inheritance = SongTextScoreUser +[SongCarouselTextUserOnlineScore1] +Inheritance = SongTextUserOnlineScore1 -[SongCarouselTextMaxScoreLocal] -Inheritance = SongTextMaxScoreLocal +[SongCarouselTextUserOnlineScore2] +Inheritance = SongTextUserOnlineScore2 -[SongCarouselTextMediaScoreLocal] -Inheritance = SongTextMediaScoreLocal +[SongCarouselTextUserOnlineScore3] +Inheritance = SongTextUserOnlineScore3 -[SongCarouselTextScoreUserLocal] -Inheritance = SongTextScoreUserLocal +#Duet images: [SongCarouselStatic2PlayersDuetSingerP1] Inheritance = SongStatic2PlayersDuetSingerP1 @@ -2148,27 +2171,6 @@ Inheritance = SongText3PlayersDuetSingerP2 [SongCarouselText3PlayersDuetSingerP3] Inheritance = SongText3PlayersDuetSingerP3 -[SongCarouselTextNonParty6] -Inheritance = SongRouletteTextNonParty6 - -[SongCarouselStaticNonParty6] -Inheritance = SongRouletteStaticNonParty6 - -[SongCarouselTextNonParty7] -Inheritance = SongRouletteTextNonParty7 - -[SongCarouselStaticNonParty7] -Inheritance = SongRouletteStaticNonParty7 - -[SongCarouselTextNonParty8] -Inheritance = SongRouletteTextNonParty8 - -[SongCarouselStaticNonParty8] -Inheritance = SongRouletteStaticNonParty8 - -[SongCarouselTextNonParty9] -Inheritance = SongRouletteTextNonParty9 - #and these are the ones for partymode # NAVBAR for party # enter a number @@ -2299,6 +2301,8 @@ Inheritance = SongRouletteStaticMedley2 [SongCarouselStaticMedley3] Inheritance = SongRouletteStaticMedley3 + + ######################################################################################## ##### ##### ##### SlotMachine ##### @@ -2310,17 +2314,37 @@ Inheritance = SongRouletteStaticMedley3 [SongSlotMachineBackground] Tex = SongBG -[SongSlotMachineCover] -X = 60 +#Dummy static +[SongSlotMachineStaticNonParty1] + +#text title screen +[SongSlotMachineTextNonParty1] +Inheritance = SongRouletteTextNonParty1 + +[SongSlotMachineStatic1] +X = 10 Y = 190 -W = 325 +W = 740 H = 200 -Rows = 3 +Z = 0.95 +Alpha = 0.75 +Color = ColorLight +Tex = SongSelection2 +Type = Colorized + +[SongSlotMachineCover] +X = 40 +Y = 210 +W = 300 +H = 170 +Rows = 1 Cols = 1 [SongSlotMachineMainCover] -Inheritance = SongSlotMachineCover -W = 200 +X = 10 +Y = 190 +W = 240 +H = 200 Type = Transparent [SongSlotMachineEqualizer] @@ -2331,293 +2355,202 @@ W = 3 H = 3 Space = 1 Bands = 30 +Visible = 0 [SongSlotMachineMedleyIcon] Inheritance = SongMedleyIcon -X = 315 -Y = 352 -W = 36 -H = 26 +X = 295 +Y = 350 [SongSlotMachineCalculatedMedleyIcon] Inheritance = SongCalculatedMedleyIcon -X = 315 -Y = 352 -W = 36 -H = 26 +X = 295 +Y = 350 [SongSlotMachineVideoIcon] Inheritance = SongVideoIcon -X = 280 +X = 265 Y = 350 -W = 26 -H = 30 [SongSlotMachineDuetIcon] Inheritance = SongDuetIcon -X = 315 +X = 295 Y = 350 -W = 25 -H = 30 [SongSlotMachineRapIcon] Inheritance = SongRapIcon -X = 357 +X = 332 Y = 350 -W = 25 -H = 30 -[SongSlotMachineStatic1] -X = 260 -Y = 190 -W = 460 -H = 200 -Z = 0.95 -Alpha = 0.45 -Color = ColorLight -Tex = SongSelection3 -Type = Colorized +[SongSlotMachineCreatorIcon] +Inheritance = SongCreatorIcon +X = 500 +Y = 200 + +[SongSlotMachineFixerIcon] +Inheritance = SongFixerIcon +X = 500 +Y = 225 + +[SongSlotMachineUnvalidatedIcon] +Inheritance = SongUnvalidatedIcon + [SongSlotMachineTextArtist] -X = 280 -Y = 210 -W = 420 -Color = White -Font = 1 -Size = 40 +Inheritance = SongRouletteTextArtist +X = 265 +Y = 200 +W = 200 Align = 0 [SongSlotMachineTextTitle] -X = 280 -Y = 280 -W = 420 -Color = White -Size = 36 +Inheritance = SongRouletteTextTitle +X = 265 +Y = 260 +W = 200 Align = 0 [SongSlotMachineTextNumber] -Inheritance = SongSlideTextNumber -X = 705 -Y = 200 -Size = 22 +Inheritance = SongRouletteTextNumber +X = 745 +Y = 370 [SongSlotMachineTextYear] -Inheritance = SongSlideTextYear -X = 460 -Y = 350 -Size = 28 +Inheritance = SongRouletteTextYear +X = 280 +Y = 320 -########## LEGEND SLOT MACHINE ######### +[SongSlotMachineTextCreator] +Inheritance = SongRouletteTextCreator +X = 520 +Y = 202 -[SongSlotMachineStaticNonParty1] -Inheritance = SongStaticNonParty1 -X = 555 -Y = 415 +[SongSlotMachineTextFixer] +Inheritance = SongRouletteTextFixer +X = 520 +Y = 227 -[SongSlotMachineTextNonParty1] -Inheritance = SongTextNonParty1 -X = 635 -Y = 420 +[SongSlotMachineTextMyScores] +Inheritance = SongTextMyScores +X = 520 +Y = 255 +Align = 0 -[SongSlotMachineStaticNonParty2] -Inheritance = SongStaticNonParty2 -X = 566 -Y = 438 +[SongSlotMachineTextWebsite] +Inheritance = SongTextWebsite +X = 680 +Y = 255 -[SongSlotMachineTextNonParty2] -Inheritance = SongTextNonParty2 -X = 595 -Y = 442 +#Local scores: -[SongSlotMachineStaticNonParty3] -Inheritance = SongStaticNonParty3 -X = 565 -Y = 460 +[SongSlotMachineTextLocalScore1] +Inheritance = SongTextLocalScore1 +X = 540 +Y = 275 -[SongSlotMachineTextNonParty3] -Inheritance = SongTextNonParty3 -X = 595 -Y = 462 +[SongSlotMachineTextLocalScore2] +Inheritance = SongTextLocalScore2 +X = 540 +Y = 295 -[SongSlotMachineStaticNonParty4] -Inheritance = SongStaticNonParty4 -X = 565 -Y = 480 +[SongSlotMachineTextLocalScore3] +Inheritance = SongTextLocalScore3 +X = 540 +Y = 315 -[SongSlotMachineTextNonParty4] -Inheritance = SongTextNonParty4 -X = 595 -Y = 482 +[SongSlotMachineTextUserLocalScore1] +Inheritance = SongTextUserLocalScore1 +X = 550 +Y = 275 -[SongSlotMachineStaticNonParty5] -Inheritance = SongStaticNonParty5 -X = 565 -Y = 500 +[SongSlotMachineTextUserLocalScore2] +Inheritance = SongTextUserLocalScore2 +X = 550 +Y = 295 -[SongSlotMachineTextNonParty5] -Inheritance = SongTextNonParty5 -X = 595 -Y = 502 +[SongSlotMachineTextUserLocalScore3] +Inheritance = SongTextUserLocalScore3 +X = 550 +Y = 315 -[SongSlotMachineTextMaxScore] -Inheritance = SongTextMaxScore -X = 290 -Y = 450 +#Online Scores: -[SongSlotMachineTextMediaScore] -Inheritance = SongTextMediaScore -X = 290 -Y = 490 +[SongSlotMachineTextOnlineScore1] +Inheritance = SongTextOnlineScore1 +X = 665 +Y = 275 -[SongSlotMachineTextMaxScore2] -Inheritance = SongTextMaxScore2 -X = 430 -Y = 450 +[SongSlotMachineTextOnlineScore2] +Inheritance = SongTextOnlineScore2 +X = 665 +Y = 295 -[SongSlotMachineTextMediaScore2] -Inheritance = SongTextMediaScore2 -X = 430 -Y = 490 +[SongSlotMachineTextOnlineScore3] +Inheritance = SongTextOnlineScore3 +X = 665 +Y = 315 -[SongSlotMachineTextScoreUser] -Inheritance = SongTextScoreUser -X = 430 -Y = 468 +[SongSlotMachineTextUserOnlineScore1] +Inheritance = SongTextUserOnlineScore1 +X = 675 +Y = 275 -[SongSlotMachineTextMaxScoreLocal] -Inheritance = SongTextMaxScoreLocal -X = 440 -Y = 450 +[SongSlotMachineTextUserOnlineScore2] +Inheritance = SongTextUserOnlineScore2 +X = 675 +Y = 295 -[SongSlotMachineTextMediaScoreLocal] -Inheritance = SongTextMediaScoreLocal -X = 440 -Y = 490 +[SongSlotMachineTextUserOnlineScore3] +Inheritance = SongTextUserOnlineScore3 +X = 675 +Y = 315 -[SongSlotMachineTextScoreUserLocal] -Inheritance = SongTextScoreUserLocal -X = 440 -Y = 468 +#Duet singers [SongSlotMachineStatic2PlayersDuetSingerP1] Inheritance = SongStatic2PlayersDuetSingerP1 -X = 295 -Y = 435 [SongSlotMachineStatic2PlayersDuetSingerP2] Inheritance = SongStatic2PlayersDuetSingerP2 -X = 295 -Y = 465 [SongSlotMachineStatic3PlayersDuetSingerP1] Inheritance = SongStatic3PlayersDuetSingerP1 -X = 295 -Y = 425 [SongSlotMachineStatic3PlayersDuetSingerP2] Inheritance = SongStatic3PlayersDuetSingerP2 -X = 295 -Y = 455 [SongSlotMachineStatic3PlayersDuetSingerP3] Inheritance = SongStatic3PlayersDuetSingerP3 -X = 295 -Y = 485 [SongSlotMachineStatic4PlayersDuetSingerP3] Inheritance = SongStatic4PlayersDuetSingerP3 -X = 305 -Y = 435 [SongSlotMachineStatic4PlayersDuetSingerP4] Inheritance = SongStatic4PlayersDuetSingerP4 -X = 305 -Y = 465 [SongSlotMachineStatic6PlayersDuetSingerP4] Inheritance = SongStatic6PlayersDuetSingerP4 -X = 305 -Y = 425 [SongSlotMachineStatic6PlayersDuetSingerP5] Inheritance = SongStatic6PlayersDuetSingerP5 -X = 305 -Y = 455 [SongSlotMachineStatic6PlayersDuetSingerP6] Inheritance = SongStatic6PlayersDuetSingerP6 -X = 305 -Y = 485 [SongSlotMachineText2PlayersDuetSingerP1] Inheritance = SongText2PlayersDuetSingerP1 -X = 372 -Y = 440 [SongSlotMachineText2PlayersDuetSingerP2] Inheritance = SongText2PlayersDuetSingerP2 -X = 372 -Y = 470 [SongSlotMachineText3PlayersDuetSingerP1] Inheritance = SongText3PlayersDuetSingerP1 -X = 372 -Y = 430 [SongSlotMachineText3PlayersDuetSingerP2] Inheritance = SongText3PlayersDuetSingerP2 -X = 372 -Y = 460 [SongSlotMachineText3PlayersDuetSingerP3] Inheritance = SongText3PlayersDuetSingerP3 -X = 372 -Y = 490 - -[SongSlotMachineTextNonParty6] -Inheritance = SongRouletteTextNonParty6 - -[SongSlotMachineStaticNonParty6] -Inheritance = SongRouletteStaticNonParty6 -X = 340 -Y = 545 -Reflection = 1 -ReflectionSpacing = 2 - -[SongSlotMachineTextNonParty7] -Inheritance = SongRouletteTextNonParty7 -X = 370 -Y = 548 -Reflection = 1 -ReflectionSpacing = 13 - -[SongSlotMachineStaticNonParty7] -Inheritance = SongRouletteStaticNonParty7 -X = 440 -Y = 545 -Reflection = 1 -ReflectionSpacing = 2 - -[SongSlotMachineTextNonParty8] -Inheritance = SongRouletteTextNonParty8 -X = 470 -Y = 548 -Reflection = 1 -ReflectionSpacing = 13 - -[SongSlotMachineStaticNonParty8] -Inheritance = SongRouletteStaticNonParty8 -X = 630 -Y = 545 -Reflection = 1 -ReflectionSpacing = 2 - -[SongSlotMachineTextNonParty9] -Inheritance = SongRouletteTextNonParty9 -X = 660 -Y = 548 -Reflection = 1 -ReflectionSpacing = 13 #and these are the ones for partymode # NAVBAR for party @@ -2775,159 +2708,138 @@ Y = 146 [SongSlideBackground] Tex = SongBG +#Dummy static +[SongSlideStaticNonParty1] + +#text title screen +[SongSlideTextNonParty1] +Inheritance = SongRouletteTextNonParty1 + [SongSlideCover] -X = 300 -Y = 120 -W = 200 +Inheritance = SongRouletteCover +X = 324 +Y = 80 +W = 150 H = 200 -Rows = 1 Cols = 11 -Padding = 60 -Reflections = 1 [SongSlideMainCover] -Inheritance = SongSlideCover -Reflection = 0 -Type = Transparent +Inheritance = SongRouletteMainCover [SongSlideEqualizer] Inheritance = SongEqualizer -Y = 500 +X = 40 +Y = 535 +Bands = 25 +Length = 20 +Reflection = 1 +ReflectionSpacing = 2 [SongSlideMedleyIcon] Inheritance = SongMedleyIcon +X = 435 +Y = 394 [SongSlideCalculatedMedleyIcon] Inheritance = SongCalculatedMedleyIcon +X = 435 +Y = 394 [SongSlideVideoIcon] Inheritance = SongVideoIcon +X = 345 +Y = 393 [SongSlideDuetIcon] Inheritance = SongDuetIcon +X = 435 +Y = 394 [SongSlideRapIcon] Inheritance = SongRapIcon +X = 315 +Y = 394 -[SongSlideStatic1] -X = 299 -Y = 320 -W = 202 -H = 190 -Z = 0.95 -Color = ColorLight -Tex = SongSelection2 -Type = Colorized +[SongSlideCreatorIcon] +Inheritance = SongCreatorIcon -[SongSlideStatic2] -W = 0 +[SongSlideFixerIcon] +Inheritance = SongFixerIcon + +[SongSlideUnvalidatedIcon] +Inheritance = SongUnvalidatedIcon + +[SongSlideStatic1] +Inheritance = SongRouletteStatic1 [SongSlideTextArtist] +Inheritance = SongRouletteTextArtist X = 400 -Y = 328 -W = 190 -Color = White -Font = 1 -Size = 24 -Align = 1 [SongSlideTextTitle] +Inheritance = SongRouletteTextTitle X = 400 -Y = 394 -W = 190 -Color = White -Font = 0 -Size = 24 -Align = 1 [SongSlideTextNumber] -X = 495 -Y = 480 -Z = 0.95 -Color = White -Size = 16 -Align = 2 +Inheritance = SongRouletteTextNumber [SongSlideTextYear] +Inheritance = SongRouletteTextYear X = 400 -Y = 477 -Z = 0.95 -Color = White -Size = 20 -Align = 1 - -########## LEGEND SLIDE ######### -[SongSlideStaticNonParty1] -Inheritance = SongCarouselStaticNonParty1 +[SongSlideTextCreator] +Inheritance = SongRouletteTextCreator -[SongSlideTextNonParty1] -Inheritance = SongCarouselTextNonParty1 +[SongSlideTextFixer] +Inheritance = SongRouletteTextFixer -[SongSlideStaticNonParty2] -Inheritance = SongCarouselStaticNonParty2 +[SongSlideTextMyScores] +Inheritance = SongTextMyScores -[SongSlideTextNonParty2] -Inheritance = SongCarouselTextNonParty2 +[SongSlideTextWebsite] +Inheritance = SongTextWebsite -[SongSlideStaticNonParty3] -Inheritance = SongCarouselStaticNonParty3 +#Local scores: -[SongSlideTextNonParty3] -Inheritance = SongCarouselTextNonParty3 +[SongSlideTextLocalScore1] +Inheritance = SongTextLocalScore1 -[SongSlideStaticNonParty4] -Inheritance = SongCarouselStaticNonParty4 +[SongSlideTextLocalScore2] +Inheritance = SongTextLocalScore2 -[SongSlideTextNonParty4] -Inheritance = SongCarouselTextNonParty4 +[SongSlideTextLocalScore3] +Inheritance = SongTextLocalScore3 -[SongSlideStaticNonParty5] -Inheritance = SongCarouselStaticNonParty5 +[SongSlideTextUserLocalScore1] +Inheritance = SongTextUserLocalScore1 -[SongSlideTextNonParty5] -Inheritance = SongCarouselTextNonParty5 +[SongSlideTextUserLocalScore2] +Inheritance = SongTextUserLocalScore2 -[SongSlideTextMaxScore] -Inheritance = SongTextMaxScore -X = 30 -Y = 500 +[SongSlideTextUserLocalScore3] +Inheritance = SongTextUserLocalScore3 -[SongSlideTextMediaScore] -Inheritance = SongTextMediaScore -X = 30 -Y = 540 +#Online Scores: -[SongSlideTextMaxScore2] -Inheritance = SongTextMaxScore2 -X = 170 -Y = 500 +[SongSlideTextOnlineScore1] +Inheritance = SongTextOnlineScore1 -[SongSlideTextMediaScore2] -Inheritance = SongTextMediaScore2 -X = 170 -Y = 540 +[SongSlideTextOnlineScore2] +Inheritance = SongTextOnlineScore2 -[SongSlideTextScoreUser] -Inheritance = SongTextScoreUser -X = 170 -Y = 518 +[SongSlideTextOnlineScore3] +Inheritance = SongTextOnlineScore3 -[SongSlideTextMaxScoreLocal] -Inheritance = SongTextMaxScoreLocal -X = 180 -Y = 500 +[SongSlideTextUserOnlineScore1] +Inheritance = SongTextUserOnlineScore1 -[SongSlideTextMediaScoreLocal] -Inheritance = SongTextMediaScoreLocal -X = 180 -Y = 540 +[SongSlideTextUserOnlineScore2] +Inheritance = SongTextUserOnlineScore2 -[SongSlideTextScoreUserLocal] -Inheritance = SongTextScoreUserLocal -X = 180 -Y = 518 +[SongSlideTextUserOnlineScore3] +Inheritance = SongTextUserOnlineScore3 +#Duet singers [SongSlideStatic2PlayersDuetSingerP1] Inheritance = SongStatic2PlayersDuetSingerP1 @@ -2973,27 +2885,6 @@ Inheritance = SongText3PlayersDuetSingerP2 [SongSlideText3PlayersDuetSingerP3] Inheritance = SongText3PlayersDuetSingerP3 -[SongSlideTextNonParty6] -Inheritance = SongRouletteTextNonParty6 - -[SongSlideStaticNonParty6] -Inheritance = SongRouletteStaticNonParty6 - -[SongSlideTextNonParty7] -Inheritance = SongRouletteTextNonParty7 - -[SongSlideStaticNonParty7] -Inheritance = SongRouletteStaticNonParty7 - -[SongSlideTextNonParty8] -Inheritance = SongRouletteTextNonParty8 - -[SongSlideStaticNonParty8] -Inheritance = SongRouletteStaticNonParty8 - -[SongSlideTextNonParty9] -Inheritance = SongRouletteTextNonParty9 - #and these are the ones for partymode [SongSlideStaticParty1] X = 40 @@ -3175,12 +3066,28 @@ Inheritance = SongRouletteStaticMedley3 [SongListBackground] Tex = SongBG +#Dummy static +[SongListStaticNonParty1] +X = 555 +Y = 0 +W = 245 +H = 600 +Z = 0.95 +Alpha = 0.75 +Color = ColorLight +Tex = SongSelection2 +Type = Colorized + +#text title screen +[SongListTextNonParty1] +Inheritance = SongRouletteTextNonParty1 + [SongListSelectSong] -X = 40 -Y = 90 -W = 490 -H = 80 +X = 30 +Y = 65 +W = 510 +H = 78 Z = 0.50 Padding = 2 DColor = GrayLightest @@ -3192,301 +3099,263 @@ Reflection = 0 ReflectionSpacing = 0 [SongListCover] -X = 44 -Y = 95 -W = 55 -H = 70 +X = 34 +Y = 70 +W = 50 +H = 68 Z = 0.95 SelectReflection = 0 SelectReflectionSpacing = 0 Cols = 1 -Rows = 5 +Rows = 6 Padding = 12 Reflections = 0 [SongListMainCover] -X = 555 -Y = 338 +X = 570 +Y = 65 W = 215 -H = 161 +H = 158 Type = Transparent [SongListEqualizer] Inheritance = SongEqualizer Visible = 0 -X = 750 -Y = 505 -Bands = 7 +X = 610 +Y = 538 +Bands = 25 Length = 15 -Reflection = 0 -ReflectionSpacing = 0 +Reflection = 1 +ReflectionSpacing = 2 [SongListMedleyIcon] Inheritance = SongMedleyIcon -X = 490 -Y = 122 +X = 509 +Y = 113 Z = 1 [SongListCalculatedMedleyIcon] Inheritance = SongCalculatedMedleyIcon -X = 490 -Y = 122 +X = 509 +Y = 113 Z = 1 [SongListVideoIcon] Inheritance = SongVideoIcon -X = 491 -Y = 96 +X = 510 +Y = 88 Z = 1 [SongListDuetIcon] Inheritance = SongDuetIcon -X = 490 -Y = 122 -W = 22 -H = 24 +X = 510 +Y = 113 Z = 1 [SongListRapIcon] Inheritance = SongRapIcon -X = 467 -Y = 100 -W = 18 -H = 22 +X = 470 +Y = 113 Z = 1 +[SongListCreatorIcon] +Inheritance = SongCreatorIcon +X = 580 +Y = 530 + +[SongListFixerIcon] +Inheritance = SongFixerIcon +X = 580 +Y = 555 + +[SongListUnvalidatedIcon] +Inheritance = SongUnvalidatedIcon + [SongListTextArtist] -X = 115 -Y = 100 -W = 440 -Color = White -Font = 1 -Size = 28 +Inheritance = SongRouletteTextArtist +X = 100 +Y = 73 +W = 390 +Align = 0 [SongListTextTitle] -X = 115 -Y = 130 -W = 330 -Color = White -Size = 26 +Inheritance = SongRouletteTextTitle +X = 100 +Y = 108 +W = 390 Align = 0 [SongListTextNumber] -Inheritance = SongSlideTextNumber -X = 522 -Y = 500 -Size = 20 +Inheritance = SongRouletteTextNumber +X = 30 +Y = 550 +Align = 0 [SongListTextYear] -Inheritance = SongSlideTextYear -X = 522 -Y = 148 -Size = 18 +Inheritance = SongRouletteTextYear +X = 527 +Y = 72 Align = 2 -########## LEGEND LIST ######### +[SongListTextCreator] +Inheritance = SongRouletteTextCreator +X = 600 +Y = 532 -[SongListStaticNonParty1] -Inheritance = SongStaticNonParty1 -X = 555 -Y = 216 -W = 215 -H = 119 +[SongListTextFixer] +Inheritance = SongRouletteTextFixer +X = 600 +Y = 556 -[SongListTextNonParty1] -Inheritance = SongTextNonParty1 -X = 661 -Y = 222 +[SongListTextMyScores] +Inheritance = SongTextMyScores +X = 610 +Y = 280 -[SongListStaticNonParty2] -Inheritance = SongStaticNonParty2 -X = 596 -Y = 250 +[SongListTextWebsite] +Inheritance = SongTextWebsite +X = 735 +Y = 280 -[SongListTextNonParty2] -Inheritance = SongTextNonParty2 -X = 625 -Y = 252 +#Local scores: -[SongListStaticNonParty3] -Inheritance = SongStaticNonParty3 +[SongListTextLocalScore1] +Inheritance = SongTextLocalScore1 X = 595 -Y = 270 - -[SongListTextNonParty3] -Inheritance = SongTextNonParty3 -X = 625 -Y = 272 +Y = 300 -[SongListStaticNonParty4] -Inheritance = SongStaticNonParty4 +[SongListTextLocalScore2] +Inheritance = SongTextLocalScore2 X = 595 -Y = 290 - -[SongListTextNonParty4] -Inheritance = SongTextNonParty4 -X = 625 -Y = 292 +Y = 320 -[SongListStaticNonParty5] -Inheritance = SongStaticNonParty5 +[SongListTextLocalScore3] +Inheritance = SongTextLocalScore3 X = 595 -Y = 310 +Y = 340 -[SongListTextNonParty5] -Inheritance = SongTextNonParty5 -X = 625 -Y = 312 +[SongListTextUserLocalScore1] +Inheritance = SongTextUserLocalScore1 +X = 605 +Y = 300 -[SongListTextMaxScore] -Inheritance = SongTextMaxScore -X = 40 -Y = 510 +[SongListTextUserLocalScore2] +Inheritance = SongTextUserLocalScore2 +X = 605 +Y = 320 -[SongListTextMediaScore] -Inheritance = SongTextMediaScore -X = 40 -Y = 550 +[SongListTextUserLocalScore3] +Inheritance = SongTextUserLocalScore3 +X = 605 +Y = 340 -[SongListTextMaxScore2] -Inheritance = SongTextMaxScore2 -X = 180 -Y = 510 +#Online Scores: -[SongListTextMediaScore2] -Inheritance = SongTextMediaScore2 -X = 180 -Y = 550 +[SongListTextOnlineScore1] +Inheritance = SongTextOnlineScore1 +X = 720 +Y = 300 -[SongListTextScoreUser] -Inheritance = SongTextScoreUser -X = 180 -Y = 528 +[SongListTextOnlineScore2] +Inheritance = SongTextOnlineScore2 +X = 720 +Y = 320 -[SongListTextMaxScoreLocal] -Inheritance = SongTextMaxScoreLocal -X = 190 -Y = 510 +[SongListTextOnlineScore3] +Inheritance = SongTextOnlineScore3 +X = 720 +Y = 340 -[SongListTextMediaScoreLocal] -Inheritance = SongTextMediaScoreLocal -X = 190 -Y = 550 +[SongListTextUserOnlineScore1] +Inheritance = SongTextUserOnlineScore1 +X = 730 +Y = 300 -[SongListTextScoreUserLocal] -Inheritance = SongTextScoreUserLocal -X = 190 -Y = 528 +[SongListTextUserOnlineScore2] +Inheritance = SongTextUserOnlineScore2 +X = 730 +Y = 320 + +[SongListTextUserOnlineScore3] +Inheritance = SongTextUserOnlineScore3 +X = 730 +Y = 340 +#Duet singers [SongListStatic2PlayersDuetSingerP1] Inheritance = SongStatic2PlayersDuetSingerP1 -X = 555 -Y = 115 -W = 194 +X = 600 +Y = 415 [SongListStatic2PlayersDuetSingerP2] Inheritance = SongStatic2PlayersDuetSingerP2 -X = 555 -Y = 145 -W = 194 +X = 600 +Y = 440 [SongListStatic3PlayersDuetSingerP1] Inheritance = SongStatic3PlayersDuetSingerP1 -X = 555 -Y = 110 -W = 194 +X = 600 +Y = 410 [SongListStatic3PlayersDuetSingerP2] Inheritance = SongStatic3PlayersDuetSingerP2 -X = 555 -Y = 140 -W = 194 +X = 600 +Y = 435 [SongListStatic3PlayersDuetSingerP3] Inheritance = SongStatic3PlayersDuetSingerP3 -X = 555 -Y = 170 -W = 194 +X = 600 +Y = 460 [SongListStatic4PlayersDuetSingerP3] Inheritance = SongStatic4PlayersDuetSingerP3 -X = 567 -Y = 115 -W = 194 +X = 612 +Y = 415 [SongListStatic4PlayersDuetSingerP4] Inheritance = SongStatic4PlayersDuetSingerP4 -X = 567 -Y = 145 -W = 194 +X = 612 +Y = 440 [SongListStatic6PlayersDuetSingerP4] Inheritance = SongStatic6PlayersDuetSingerP4 -X = 567 -Y = 110 -W = 200 +X = 612 +Y = 410 [SongListStatic6PlayersDuetSingerP5] Inheritance = SongStatic6PlayersDuetSingerP5 -X = 567 -Y = 140 -W = 200 +X = 612 +Y = 435 [SongListStatic6PlayersDuetSingerP6] Inheritance = SongStatic6PlayersDuetSingerP6 -X = 567 -Y = 170 -W = 200 +X = 612 +Y = 460 [SongListText2PlayersDuetSingerP1] Inheritance = SongText2PlayersDuetSingerP1 -X = 650 -Y = 120 +X = 675 +Y = 420 [SongListText2PlayersDuetSingerP2] Inheritance = SongText2PlayersDuetSingerP2 -X = 650 -Y = 150 +X = 675 +Y = 445 [SongListText3PlayersDuetSingerP1] Inheritance = SongText3PlayersDuetSingerP1 -X = 650 -Y = 115 +X = 675 +Y = 415 [SongListText3PlayersDuetSingerP2] Inheritance = SongText3PlayersDuetSingerP2 -X = 650 -Y = 145 +X = 675 +Y = 440 [SongListText3PlayersDuetSingerP3] Inheritance = SongText3PlayersDuetSingerP3 -X = 650 -Y = 175 - -[SongListTextNonParty6] -Inheritance = SongRouletteTextNonParty6 -X = 40 -Y = 12 - -[SongListStaticNonParty6] -Inheritance = SongRouletteStaticNonParty6 - -[SongListTextNonParty7] -Inheritance = SongRouletteTextNonParty7 -Reflection = 1 -ReflectionSpacing = 13 - -[SongListStaticNonParty7] -Inheritance = SongRouletteStaticNonParty7 - -[SongListTextNonParty8] -Inheritance = SongRouletteTextNonParty8 - -[SongListStaticNonParty8] -Inheritance = SongRouletteStaticNonParty8 - -[SongListTextNonParty9] -Inheritance = SongRouletteTextNonParty9 +X = 675 +Y = 465 #and these are the ones for partymode [SongListStaticParty1] @@ -3689,299 +3558,269 @@ Y = 185 [SongMosaicBackground] Tex = SongBG +#Dummy static +[SongMosaicStaticNonParty1] + +#text title screen +[SongMosaicTextNonParty1] +Inheritance = SongRouletteTextNonParty1 + [SongMosaicCover] -X = 45 -Y = 90 -W = 120 -H = 135 +X = 105 +Y = 70 +W = 100 +H = 125 ZoomThumbW = 125 ZoomThumbH = 140 -Rows = 3 +Rows = 4 Cols = 1 Padding = 4 Reflections = 0 [SongMosaicMainCover] -X = 180 -Y = 90 +X = 220 +Y = 70 W = 355 -H = 278 +H = 254 Type = Transparent [SongMosaicEqualizer] Inheritance = SongEqualizer -X = 15 -Y = 500 -PieceW = 5 -PieceH = 5 +X = 590 +Y = 322 +PieceW = 10 +PieceH = 10 Space = 1 -Length = 18 +Length = 40 +Bands = 18 [SongMosaicMedleyIcon] Inheritance = SongMedleyIcon -X = 500 -Y = 432 +X = 545 +Y = 412 [SongMosaicCalculatedMedleyIcon] Inheritance = SongCalculatedMedleyIcon -X = 500 -Y = 432 +X = 545 +Y = 412 [SongMosaicVideoIcon] Inheritance = SongVideoIcon -X = 502 -Y = 400 +X = 545 +Y = 380 [SongMosaicDuetIcon] Inheritance = SongDuetIcon -X = 500 -Y = 428 -W = 22 -H = 24 +X = 545 +Y = 408 [SongMosaicRapIcon] Inheritance = SongRapIcon -X = 500 -Y = 465 -W = 20 -H = 24 +X = 545 +Y = 530 + +[SongMosaicCreatorIcon] +Inheritance = SongCreatorIcon +X = 230 +Y = 530 + +[SongMosaicFixerIcon] +Inheritance = SongFixerIcon +X = 415 +Y = 450 + +[SongMosaicUnvalidatedIcon] +Inheritance = SongUnvalidatedIcon [SongMosaicStatic1] -X = 180 -Y = 370 +X = 220 +Y = 328 W = 355 -H = 132 +H = 254 Z = 0.9 Color = ColorLight Tex = JukeboxSongSelection Type = Colorized -Reflection = 1 +Reflection = 0 ReflectionSpacing = 2 [SongMosaicTextArtist] -X = 190 -Y = 380 +Inheritance = SongRouletteTextArtist +X = 230 +Y = 340 W = 300 -Color = White -Font = 1 -Size = 28 Align = 0 [SongMosaicTextTitle] -X = 190 -Y = 435 +Inheritance = SongRouletteTextTitle +X = 230 +Y = 390 W = 300 -Color = White -Size = 24 +Align = 0 [SongMosaicTextNumber] -Inheritance = SongSlideTextNumber -X = 141 -Y = 517 -Size = 18 -Align = 1 +Inheritance = SongRouletteTextNumber +X = 565 +Y = 555 [SongMosaicTextYear] -Inheritance = SongSlideTextYear -X = 530 -Y = 380 -Z = 1 -Size = 18 +Inheritance = SongRouletteTextYear +X = 565 +Y = 343 Align = 2 -########## LEGEND MOSAIC ######### - -[SongMosaicStaticNonParty1] -Inheritance = SongStaticNonParty1 -X = 555 -Y = 370 -W = 215 -H = 131 +[SongMosaicTextCreator] +Inheritance = SongRouletteTextCreator +X = 250 +Y = 532 -[SongMosaicTextNonParty1] -Inheritance = SongTextNonParty1 -X = 661 -Y = 376 +[SongMosaicTextFixer] +Inheritance = SongRouletteTextFixer +X = 435 +Y = 532 -[SongMosaicStaticNonParty2] -Inheritance = SongStaticNonParty2 -X = 596 -Y = 404 +[SongMosaicTextMyScores] +Inheritance = SongTextMyScores +Y = 440 -[SongMosaicTextNonParty2] -Inheritance = SongTextNonParty2 -X = 625 -Y = 406 +[SongMosaicTextWebsite] +Inheritance = SongTextWebsite +X = 460 +Y = 440 -[SongMosaicStaticNonParty3] -Inheritance = SongStaticNonParty3 -X = 595 -Y = 424 +#Local scores: -[SongMosaicTextNonParty3] -Inheritance = SongTextNonParty3 -X = 625 -Y = 426 +[SongMosaicTextLocalScore1] +Inheritance = SongTextLocalScore1 +Y = 470 -[SongMosaicStaticNonParty4] -Inheritance = SongStaticNonParty4 -X = 595 -Y = 444 +[SongMosaicTextLocalScore2] +Inheritance = SongTextLocalScore2 +Y = 490 -[SongMosaicTextNonParty4] -Inheritance = SongTextNonParty4 -X = 625 -Y = 446 +[SongMosaicTextLocalScore3] +Inheritance = SongTextLocalScore3 +Y = 510 -[SongMosaicStaticNonParty5] -Inheritance = SongStaticNonParty5 -X = 595 -Y = 464 +[SongMosaicTextUserLocalScore1] +Inheritance = SongTextUserLocalScore1 +Y = 470 -[SongMosaicTextNonParty5] -Inheritance = SongTextNonParty5 -X = 625 -Y = 466 +[SongMosaicTextUserLocalScore2] +Inheritance = SongTextUserLocalScore2 +Y = 490 -[SongMosaicTextMaxScore] -Inheritance = SongTextMaxScore -X = 565 -Y = 280 +[SongMosaicTextUserLocalScore3] +Inheritance = SongTextUserLocalScore3 +Y = 510 -[SongMosaicTextMediaScore] -Inheritance = SongTextMediaScore -X = 565 -Y = 320 +#Online Scores: -[SongMosaicTextMaxScore2] -Inheritance = SongTextMaxScore2 -X = 705 -Y = 280 +[SongMosaicTextOnlineScore1] +Inheritance = SongTextOnlineScore1 +X = 450 +Y = 470 -[SongMosaicTextMediaScore2] -Inheritance = SongTextMediaScore2 -X = 705 -Y = 320 +[SongMosaicTextOnlineScore2] +Inheritance = SongTextOnlineScore2 +X = 450 +Y = 490 -[SongMosaicTextScoreUser] -Inheritance = SongTextScoreUser -X = 705 -Y = 298 +[SongMosaicTextOnlineScore3] +Inheritance = SongTextOnlineScore3 +X = 450 +Y = 510 -[SongMosaicTextMaxScoreLocal] -Inheritance = SongTextMaxScoreLocal -X = 715 -Y = 280 +[SongMosaicTextUserOnlineScore1] +Inheritance = SongTextUserOnlineScore1 +X = 460 +Y = 470 -[SongMosaicTextMediaScoreLocal] -Inheritance = SongTextMediaScoreLocal -X = 715 -Y = 320 +[SongMosaicTextUserOnlineScore2] +Inheritance = SongTextUserOnlineScore2 +X = 460 +Y = 490 -[SongMosaicTextScoreUserLocal] -Inheritance = SongTextScoreUserLocal -X = 715 -Y = 298 +[SongMosaicTextUserOnlineScore3] +Inheritance = SongTextUserOnlineScore3 +X = 460 +Y = 510 +#Duet singers [SongMosaicStatic2PlayersDuetSingerP1] Inheritance = SongStatic2PlayersDuetSingerP1 -X = 565 -Y = 135 +X = 615 +Y = 440 [SongMosaicStatic2PlayersDuetSingerP2] Inheritance = SongStatic2PlayersDuetSingerP2 -X = 565 -Y = 165 +X = 615 +Y = 465 [SongMosaicStatic3PlayersDuetSingerP1] Inheritance = SongStatic3PlayersDuetSingerP1 -X = 565 -Y = 120 +X = 615 +Y = 430 [SongMosaicStatic3PlayersDuetSingerP2] Inheritance = SongStatic3PlayersDuetSingerP2 -X = 565 -Y = 150 +X = 615 +Y = 455 [SongMosaicStatic3PlayersDuetSingerP3] Inheritance = SongStatic3PlayersDuetSingerP3 -X = 565 -Y = 180 +X = 615 +Y = 480 [SongMosaicStatic4PlayersDuetSingerP3] Inheritance = SongStatic4PlayersDuetSingerP3 -X = 575 -Y = 135 +X = 625 +Y = 440 [SongMosaicStatic4PlayersDuetSingerP4] Inheritance = SongStatic4PlayersDuetSingerP4 -X = 575 -Y = 165 +X = 625 +Y = 465 [SongMosaicStatic6PlayersDuetSingerP4] Inheritance = SongStatic6PlayersDuetSingerP4 -X = 575 -Y = 120 +X = 625 +Y = 430 [SongMosaicStatic6PlayersDuetSingerP5] Inheritance = SongStatic6PlayersDuetSingerP5 -X = 575 -Y = 150 +X = 625 +Y = 455 [SongMosaicStatic6PlayersDuetSingerP6] Inheritance = SongStatic6PlayersDuetSingerP6 -X = 575 -Y = 180 +X = 625 +Y = 480 [SongMosaicText2PlayersDuetSingerP1] Inheritance = SongText2PlayersDuetSingerP1 -X = 642 -Y = 140 +X = 692 +Y = 445 [SongMosaicText2PlayersDuetSingerP2] Inheritance = SongText2PlayersDuetSingerP2 -X = 642 -Y = 170 +X = 692 +Y = 470 [SongMosaicText3PlayersDuetSingerP1] Inheritance = SongText3PlayersDuetSingerP1 -X = 642 -Y = 125 +X = 692 +Y = 435 [SongMosaicText3PlayersDuetSingerP2] Inheritance = SongText3PlayersDuetSingerP2 -X = 642 -Y = 155 +X = 692 +Y = 460 [SongMosaicText3PlayersDuetSingerP3] Inheritance = SongText3PlayersDuetSingerP3 -X = 642 -Y = 185 - -[SongMosaicTextNonParty6] -Inheritance = SongRouletteTextNonParty6 -X = 40 -Y = 12 - -[SongMosaicStaticNonParty6] -Inheritance = SongRouletteStaticNonParty6 - -[SongMosaicTextNonParty7] -Inheritance = SongRouletteTextNonParty7 -Reflection = 1 -ReflectionSpacing = 13 - -[SongMosaicStaticNonParty7] -Inheritance = SongRouletteStaticNonParty7 - -[SongMosaicTextNonParty8] -Inheritance = SongRouletteTextNonParty8 - -[SongMosaicStaticNonParty8] -Inheritance = SongRouletteStaticNonParty8 - -[SongMosaicTextNonParty9] -Inheritance = SongRouletteTextNonParty9 +X = 692 +Y = 485 #and these are the ones for partymode [SongMosaicStaticParty1] @@ -4388,7 +4227,7 @@ Y = 279 [SingP1ThreePStatic] Inheritance = SingP1TwoPStatic X = 16 -Y = 57 +Y = 43 #Z = 1 ; [SingP1ThreePText] @@ -4400,22 +4239,22 @@ Y = 57 [SingP1ThreePStatic2] Inheritance = SingP1TwoPStatic2 X = 75 -Y = 61 +Y = 45 [SingP1ThreePTextScore] Inheritance = SingP1TwoPTextScore X = 93 -Y = 63 +Y = 49 [SingP1ThreePSingBar] Inheritance = SingP1TwoPSingBar X = 75 -Y = 95 +Y = 80 [SingP1ThreePAvatar] Inheritance = SingP1TwoPAvatar X = 21 -Y = 63 +Y = 48 #Player Two [SingP2MStatic] @@ -4495,7 +4334,7 @@ Align = 1 [SingP1FourPStatic] Inheritance = SingP1ThreePStatic X = 20 -Y = 54 +Y = 40 W = 40 H = 54 @@ -4520,7 +4359,7 @@ X = 80 [SingP1FourPAvatar] Inheritance = SingP1ThreePAvatar X = 24 -Y = 59 +Y = 45 W = 32 H = 43 @@ -4608,11 +4447,7 @@ X = 624 # SIX P L A Y E R M O D E # # # # # # # # # # # # # # # # # # # # #Player One [SingP1SixPStatic] -Inheritance = SingP1ThreePStatic -X = 19 -Y = 98 -W = 34 -H = 46 +Inheritance = SingP1FourPStatic ; [SingP1SixPText] ; Inheritance = SingP1Text @@ -4621,31 +4456,26 @@ H = 46 ; Size = 18 [SingP1SixPAvatar] -Inheritance = SingP1ThreePAvatar -X = 23 -Y = 103 -W = 26 -H = 36 +Inheritance = SingP1FourPAvatar [SingP1SixPStatic2] -Inheritance = SingP1ThreePStatic2 -X = 20 -Y = 40 +Inheritance = SingP1FourPStatic2 +X = 60 +W = 80 [SingP1SixPTextScore] -Inheritance = SingP1ThreePTextScore -X = 38 -Y = 42 +Inheritance = SingP1FourPTextScore +X = 70 [SingP1SixPSingBar] -Inheritance = SingP1ThreePSingBar -X = 20 -Y = 76 +Inheritance = SingP1FourPSingBar +X = 60 +W = 80 #Player Two [SingP2SixPStatic] Inheritance = SingP1SixPStatic -Y = 225 +X = 150 Color = P2Dark ; [SingP2SixPText] @@ -4653,26 +4483,26 @@ Color = P2Dark ; Y = 227 [SingP2SixPAvatar] -Inheritance = SingP1ThreePAvatar -Y = 230 +Inheritance = SingP1SixPAvatar +X = 154 [SingP2SixPStatic2] Inheritance = SingP1SixPStatic2 -X = 150 +X = 190 Color = P2Dark [SingP2SixPTextScore] Inheritance = SingP1SixPTextScore -X = 168 +X = 200 [SingP2SixPSingBar] Inheritance = SingP1SixPSingBar -X = 150 +X = 190 #Player Three [SingP3SixPStatic] Inheritance = SingP1SixPStatic -Y = 350 +X = 280 Color = P3Dark ; [SingP3SixPText] @@ -4680,27 +4510,26 @@ Color = P3Dark ; Y = 352 [SingP3SixPAvatar] -Inheritance = SingP1ThreePAvatar -Y = 355 +Inheritance = SingP1SixPAvatar +X = 284 [SingP3SixPStatic2] Inheritance = SingP1SixPStatic2 -X = 280 +X = 320 Color = P3Dark [SingP3SixPTextScore] Inheritance = SingP1SixPTextScore -X = 298 +X = 330 [SingP3SixPSingBar] Inheritance = SingP1SixPSingBar -X = 280 +X = 320 #Player Four [SingP4SixPStatic] Inheritance = SingP1SixPStatic -X = 389 -Y = 98 +X = 410 Color = P4Dark ; [SingP4SixPText] @@ -4709,27 +4538,26 @@ Color = P4Dark ; Y = 100 [SingP4SixPAvatar] -Inheritance = SingP1ThreePAvatar -X = 393 -Y = 103 +Inheritance = SingP1SixPAvatar +X = 414 [SingP4SixPStatic2] Inheritance = SingP1SixPStatic2 -X = 410 +X = 450 Color = P4Dark [SingP4SixPTextScore] Inheritance = SingP1SixPTextScore -X = 428 +X = 460 [SingP4SixPSingBar] Inheritance = SingP1SixPSingBar -X = 410 +X = 450 #Player Five [SingP5SixPStatic] Inheritance = SingP4SixPStatic -Y = 225 +X = 540 Color = P5Dark ; [SingP5SixPText] @@ -4737,26 +4565,26 @@ Color = P5Dark ; Y = 227 [SingP5SixPAvatar] -Inheritance = SingP4SixPAvatar -Y = 230 +Inheritance = SingP1SixPAvatar +X = 544 [SingP5SixPStatic2] Inheritance = SingP1SixPStatic2 -X = 540 +X = 580 Color = P5Dark [SingP5SixPTextScore] Inheritance = SingP1SixPTextScore -X = 558 +X = 590 [SingP5SixPSingBar] Inheritance = SingP1SixPSingBar -X = 540 +X = 580 #Player Six [SingP6SixPStatic] Inheritance = SingP4SixPStatic -Y = 350 +X = 670 Color = P6Dark ; [SingP6SixPText] @@ -4764,21 +4592,21 @@ Color = P6Dark ; Y = 352 [SingP6SixPAvatar] -Inheritance = SingP4SixPAvatar -Y = 355 +Inheritance = SingP1SixPAvatar +X = 674 [SingP6SixPStatic2] Inheritance = SingP1SixPStatic2 -X = 670 +X = 710 Color = P6Dark [SingP6SixPTextScore] Inheritance = SingP1SixPTextScore -X = 688 +X = 720 [SingP6SixPSingBar] Inheritance = SingP1SixPSingBar -X = 670 +X = 710 ################################## ########## Duet ########## @@ -5219,7 +5047,7 @@ Y = 285 [SingP1ThreePOscilloscope] Inheritance = SingP1Oscilloscope X = 15 -Y = 15 +Y = 5 W = 160 [SingP2MOscilloscope] @@ -5250,7 +5078,7 @@ Y = 360 [SingP1FourPOscilloscope] Inheritance = SingP1Oscilloscope X = 22 -Y = 25 +Y = 5 W = 157 [SingP2FourPOscilloscope] @@ -5268,28 +5096,28 @@ X = 622 # SIX P L A Y E R M O D E # # # # # # # # # # # # # # # # # # # # [SingP1SixPOscilloscope] Inheritance = SingP1Oscilloscope -X = 20 -Y = 8 +X = 30 +Y = 5 [SingP2SixPOscilloscope] Inheritance = SingP1SixPOscilloscope -X = 150 +X = 160 [SingP3SixPOscilloscope] Inheritance = SingP1SixPOscilloscope -X = 280 +X = 290 [SingP4SixPOscilloscope] Inheritance = SingP1SixPOscilloscope -X = 410 +X = 420 [SingP5SixPOscilloscope] Inheritance = SingP1SixPOscilloscope -X = 540 +X = 550 [SingP6SixPOscilloscope] Inheritance = SingP1SixPOscilloscope -X = 670 +X = 680 # FOUR DUET P L A Y E R M O D E # # # # # # # # # # # # # # # # # # # # [SingP1DuetFourPOscilloscope] @@ -6273,6 +6101,7 @@ X = 315 Y = 160 H = 55 W = 55 +Type = Transparent [ScoreFourPTextScore1] Inheritance = ScoreTextScore1 @@ -6403,6 +6232,7 @@ Y = 115 W = 36 H = 49 Z = 1 +Type = Transparent [ScoreFourPPlayer1Static7] Inheritance = ScorePlayer1Static5 @@ -6829,6 +6659,7 @@ Y = 115 W = 36 H = 49 Z = 1 +Type = Transparent [ScoreSixPPlayer1Static5] Inheritance = ScorePlayer1Static5 @@ -11646,7 +11477,7 @@ Y = 10 Font = 0 Size = 30 Align = 1 -Text = SING_OPTIONS_EXIT +Text = C_BACK Color = White [StatMainTextOverview] @@ -11702,7 +11533,7 @@ Y = 10 Font = 0 Size = 30 Align = 1 -Text = STAT_NEXT +Text = C_NEXT Color = White [StatDetailButtonPrev] @@ -11765,7 +11596,7 @@ Y = 10 Font = 0 Size = 30 Align = 1 -Text = SING_OPTIONS_EXIT +Text = C_BACK Color = White [StatDetailTextDescription] @@ -11931,7 +11762,7 @@ Tex = Optionsbuttongame Inheritance = OptionsButtonGameText X = 35 Y = 80 -Text = SING_OPTIONS_GAME +Text = C_GAME [OptionsButtonGraphics] Inheritance = OptionsButton @@ -11943,7 +11774,7 @@ Tex = Optionsbuttongraphics Inheritance = OptionsButtonGameText X = 40 Y = 80 -Text = SING_OPTIONS_GRAPHICS +Text = C_GRAPHICS [OptionsButtonSound] Inheritance = OptionsButton @@ -11958,7 +11789,7 @@ SelectH = 60 Inheritance = OptionsButtonGameText X = 30 Y = 80 -Text = SING_OPTIONS_SOUND +Text = C_SOUND [OptionsButtonLyrics] Inheritance = OptionsButton @@ -11973,7 +11804,7 @@ SelectH = 65 Inheritance = OptionsButtonGameText X = 35 Y = 80 -Text = SING_OPTIONS_LYRICS +Text = C_LYRICS [OptionsButtonThemes] Inheritance = OptionsButton @@ -11988,7 +11819,7 @@ SelectH = 75 Inheritance = OptionsButtonGameText X = 35 Y = 80 -Text = SING_OPTIONS_THEMES +Text = C_THEMES [OptionsButtonMicrophones] Inheritance = OptionsButton @@ -12003,7 +11834,7 @@ SelectH = 65 Inheritance = OptionsButtonGameText X = 40 Y = 80 -Text = SING_OPTIONS_MICROPHONES +Text = C_MICROPHONES [OptionsButtonAdvanced] Inheritance = OptionsButton @@ -12018,7 +11849,7 @@ SelectH = 67 Inheritance = OptionsButtonGameText X = 32 Y = 80 -Text = SING_OPTIONS_ADVANCED +Text = C_ADVANCED [OptionsButtonNetwork] Inheritance = OptionsButton @@ -12033,7 +11864,7 @@ SelectH = 67 Inheritance = OptionsButtonGameText X = 31 Y = 80 -Text = SING_OPTIONS_NETWORK +Text = C_INTERNET [OptionsButtonWebcam] Inheritance = OptionsButton @@ -12045,11 +11876,23 @@ Tex = Optionsbuttonwebcam Inheritance = OptionsButtonGameText X = 35 Y = 80 -Text = SING_OPTIONS_WEBCAM +Text = C_WEBCAM + +[OptionsButtonProfiles] +Inheritance = OptionsButton +X = 260 +Y = 425 +Tex = Optionsbuttonprofiles + +[OptionsButtonProfilesText1] +Inheritance = OptionsButtonGameText +X = 35 +Y = 80 +Text = C_PROFILES [OptionsButtonExit] Inheritance = OptionsButton -X = 250 +X = 420 Y = 425 W = 70 H = 80 @@ -12057,9 +11900,10 @@ Tex = Optionsbuttonback [OptionsButtonExitText1] Inheritance = OptionsButtonGameText -X = 50 +X = 40 Y = 80 -Text = SING_OPTIONS_EXIT +Text = C_BACK + [OptionsButtonExit2] X = 70 @@ -12078,7 +11922,7 @@ Y = 5 Font = 0 Size = 30 Align = 1 -Text = SING_OPTIONS_EXIT +Text = C_BACK Color = White [OptionsSelectSlide] @@ -12121,7 +11965,7 @@ X = 125 Y = 35 Color = White Size = 45 -Text = SING_OPTIONS_GAME +Text = C_GAME #[OptionsGameText2] #X = 50 @@ -12171,7 +12015,7 @@ Y = 355 [OptionsGameSelectFindUnsetMedley] Inheritance = OptionsGameSelectSlideLanguage -Text = SING_SONG_SELECTION_LEGEND_MEDLEYC +Text = C_MEDLEYC Y = 400 [OptionsGameSelectJoypad] @@ -12206,7 +12050,7 @@ X = 120 Y = 35 Color = White Size = 45 -Text = SING_OPTIONS_GRAPHICS +Text = C_GRAPHICS #[OptionsGraphicsText2] #X = 65 @@ -12279,7 +12123,7 @@ X = 110 Y = 35 Color = White Size = 45 -Text = SING_OPTIONS_SOUND +Text = C_SOUND [OptionsSoundSelectVoicePassthrough] Inheritance = OptionsSelectSlide @@ -12343,7 +12187,7 @@ X = 100 Y = 35 Color = White Size = 45 -Text = SING_OPTIONS_LYRICS +Text = C_LYRICS [OptionsLyricsText5] X = 440 @@ -12492,7 +12336,7 @@ X = 120 Y = 40 Color = White Size = 45 -Text = SING_OPTIONS_THEMES +Text = C_THEMES [OptionsThemesText5] X = 440 @@ -12546,7 +12390,7 @@ X = 110 Y = 40 Color = White Size = 45 -Text = SING_OPTIONS_MICROPHONES +Text = C_MICROPHONES [OptionsMicrophonesSelectSlideCard] Inheritance = OptionsSelectSlide @@ -12602,7 +12446,7 @@ X = 100 Y = 40 Color = White Size = 45 -Text = SING_OPTIONS_ADVANCED +Text = C_ADVANCED [OptionsAdvancedSelectDebug] Inheritance = OptionsSelectSlide @@ -12666,7 +12510,7 @@ X = 100 Y = 40 Color = White Size = 45 -Text = SING_OPTIONS_NETWORK +Text = C_NETWORK [OptionsNetworkStatic5] X = 400 @@ -12818,7 +12662,7 @@ X = 115 Y = 40 Color = White Size = 45 -Text = SING_OPTIONS_WEBCAM +Text = C_WEBCAM [OptionsWebcamText2] X = 90 @@ -12897,6 +12741,37 @@ Y = 500 [OptionsWebcamButtonExitText1] Inheritance = OptionsButtonExit2Text + +[OptionsProfiles] +Texts = 2 + +[OptionsProfilesBackground] +Tex = OptionsBG + +[OptionsProfilesStatic1] +X = 30 +Y = 30 +W = 75 +H = 70 +Color = White +Tex = Optionsbuttonprofiles +Type = Transparent + +[OptionsProfilesText1] +X = 115 +Y = 40 +Color = White +Size = 45 +Text = C_PROFILES + +[OptionsProfilesButtonExit] +Inheritance = OptionsButtonExit2 +Y = 500 + +[OptionsProfilesButtonExitText1] +Inheritance = OptionsButtonExit2Text + + # This is part of option network [InsertUserPopup] @@ -13077,7 +12952,7 @@ Y = 10 Font = 0 Size = 30 Align = 1 -Text = SING_OPTIONS_EXIT +Text = C_BACK Color = White [AboutMainButtonDevelopers] @@ -13156,7 +13031,7 @@ Y = 10 Font = 0 Size = 30 Align = 1 -Text = SING_OPTIONS_EXIT +Text = C_BACK Color = White [DevelopersTextOverview] diff --git a/game/themes/Party.ini b/game/themes/Neon.ini similarity index 98% rename from game/themes/Party.ini rename to game/themes/Neon.ini index 13cd2d8a..d08f814e 100644 --- a/game/themes/Party.ini +++ b/game/themes/Neon.ini @@ -8,9 +8,9 @@ ################################### [Theme] -Version = 19.12 +Version = 20.12 Creator = Daniel20 -DefaultSkin = Basic Violet +DefaultSkin = Static Violet [Main] [MainBackground] diff --git a/game/themes/common/Basic Blue.ini b/game/themes/common/Basic Blue.ini deleted file mode 100644 index bd46a123..00000000 --- a/game/themes/common/Basic Blue.ini +++ /dev/null @@ -1,25 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -############### -[Skin] -Theme=Party -Name= Basic Blue -Color=Blue - -[Textures] -TitleBG = [bg-main]blue.jpg -MainBG = [bg-main]blue.jpg -SongBG = [bg-main]blue.jpg -ScoreScreenBG = [bg-main]blue.jpg -Top5BG = [bg-main]blue.jpg -OptionsBG = [bg-main]blue.jpg -PartyBG = [bg-main]blue.jpg diff --git a/game/themes/common/Basic Red.ini b/game/themes/common/Basic Red.ini deleted file mode 100644 index 1cc9803b..00000000 --- a/game/themes/common/Basic Red.ini +++ /dev/null @@ -1,25 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -############### -[Skin] -Theme=Party -Name= Basic Red -Color=Red - -[Textures] -TitleBG = [bg-main]red.jpg -MainBG = [bg-main]red.jpg -SongBG = [bg-main]red.jpg -ScoreScreenBG = [bg-main]red.jpg -Top5BG = [bg-main]red.jpg -OptionsBG = [bg-main]red.jpg -PartyBG = [bg-main]red.jpg diff --git a/game/themes/common/Basic Violet.ini b/game/themes/common/Basic Violet.ini index f365ee2a..a5dcc626 100644 --- a/game/themes/common/Basic Violet.ini +++ b/game/themes/common/Basic Violet.ini @@ -11,7 +11,7 @@ ############### [Skin] -Theme=Party +Theme=Argon Name= Basic Violet Color=Violet @@ -19,7 +19,6 @@ Color=Violet /** * Interface */ -interface_selectbg_search = [interface]selectbg_search.png interface_dialog_background = [interface]dialog_background.png interface_dialog_background2 = [interface]dialog_background2.png interface_dialog_backgroundtop = [interface]dialog_backgroundtop.png @@ -30,16 +29,14 @@ Cursor_Pressed = [interface]cursor_pressed.png /** * Icons */ -icon_song_menu = [icon]song_menu.png -icon_song_search = [icon]song_search.png -icon_song_video = [icon]song_video.png -icon_song_medley = [icon]song_medley.png -icon_song_calcmedley = [icon]song_calcmedley.png -icon_song_duet = [icon]song_duet.png -icon_song_rap = [icon]song_rap.png - -loadicon = [load]logo.png -loadbaricon = [load]bar.png +icon_song_search = [icon]song_search.png +icon_song_video = [icon]song_video.png +icon_song_medley = [icon]song_medley.png +icon_song_duet = [icon]song_duet.png +icon_song_rap = [icon]song_rap.png +icon_song_createdby = [icon]song_createdby.png +icon_song_fixedby = [icon]song_fixedby.png +icon_song_unvalidated = [icon]song_unvalidated.png # # # M A I N # # # ButtonSolo = [main]buttonsolo.png @@ -82,6 +79,8 @@ SongDuetSinger = [song]duetsinger.png SongDuetSinger2 = [song]duetsinger2.png SongDuetSinger3 = [song]duetsinger3.png +Menubg = [menu]bg.png + # # # S I N G # # # #the bar where the lyrics reside LyricBar = [sing]textBar.png @@ -162,13 +161,10 @@ Optionsbuttonmicrophones = [Options]buttonmicrophones.png Optionsbuttonadvanced = [Options]buttonadvanced.png Optionsbuttonnetwork = [Options]buttonnetwork.png Optionsbuttonwebcam = [Options]buttonwebcam.png -Optionsbuttonjukebox = [Options]buttonjukebox.png +Optionsbuttonprofiles = [Options]buttonprofiles.png Optionsbuttonback = [Options]buttonback.png # # # M A I N P A R T Y # # # -ClassicButton =[MainParty]ClassicButton.png -ClassicFreeButton =[MainParty]ClassicFreeButton.png -ChallengeButton =[MainParty]ChallengeButton.png TournamentButton =[tournament]trophy.png # # # P A R T Y # # # @@ -215,8 +211,6 @@ ButtonDel = [button]del.png SongMenuBG = [menu]songMenuBg.png SongMenuSelectBG = [menu]songMenuSelectBg.png -PopUpBG = [menu]popUpBG.png - # # # N O T E S # # # # sung notes - colorized with playercolors @@ -249,7 +243,7 @@ NotePerfectStar = [effect]perfectNoteStar.png # # # dirty helpers # # # -Rectangle = [helper]rectangle.png +Rectangle = [button]rectangle.png ButtonFade = [helper]buttonFade.png BGFade = [special]bg_fade.png @@ -293,7 +287,7 @@ WhiteFade = [color]white-fade.png BlackFade = [color]black-fade.png Pointer = [color]pointer.png -# # # N A M E # # # +# # # P L A Y E R S E L E C T I O N # # # AvatarFrame = [name]frame.png CurrentPlayer = [name]player.png SelectFrame = [name]select.png @@ -314,3 +308,7 @@ AboutBG = [About]helperbg2.png # # # D E V E L O P E R S # # # Dhelperbg = [Developers]helperbg.png + +# # # C O M M O N # # # +BlackBG = [common]blackbg.png + diff --git a/game/themes/common/Hearts.ini b/game/themes/common/Hearts.ini deleted file mode 100644 index 68919ec5..00000000 --- a/game/themes/common/Hearts.ini +++ /dev/null @@ -1,27 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -#Video credits to: AA VFX https://www.youtube.com/watch?v=biPycuqGBRc - -############### -[Skin] -Theme=Party -Name= Hearts -Color=Pink - -[Textures] -TitleBG = [bg-main]love.webm -MainBG = [bg-main]love.webm -SongBG = [bg-main]love.webm -ScoreScreenBG = [bg-main]love.webm -Top5BG = [bg-main]love.webm -OptionsBG = [bg-main]love.webm -PartyBG = [bg-main]love.webm diff --git a/game/themes/common/Heat.ini b/game/themes/common/Heat.ini deleted file mode 100644 index a92b7bfc..00000000 --- a/game/themes/common/Heat.ini +++ /dev/null @@ -1,27 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -#Video credits to: AA VFX https://www.youtube.com/watch?v=X36DOTEzjHw - -############### -[Skin] -Theme=Party -Name= Heat -Color=Red - -[Textures] -TitleBG = [bg-main]magma.webm -MainBG = [bg-main]magma.webm -SongBG = [bg-main]magma.webm -ScoreScreenBG = [bg-main]magma.webm -Top5BG = [bg-main]magma.webm -OptionsBG = [bg-main]magma.webm -PartyBG = [bg-main]magma.webm diff --git a/game/themes/common/Lines.ini b/game/themes/common/Lines.ini deleted file mode 100644 index c580206b..00000000 --- a/game/themes/common/Lines.ini +++ /dev/null @@ -1,27 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -#Video credits to: AA VFX https://www.youtube.com/watch?v=53pUo71jr8w - -############### -[Skin] -Theme=Fantasy -Name= Lines -Color=Pink - -[Textures] -TitleBG = [bg-main]lines.webm -MainBG = [bg-main]lines.webm -SongBG = [bg-main]lines.webm -ScoreScreenBG = [bg-main]lines.webm -Top5BG = [bg-main]lines.webm -OptionsBG = [bg-main]lines.webm -PartyBG = [bg-main]lines.webm diff --git a/game/themes/common/Love.ini b/game/themes/common/Love.ini deleted file mode 100644 index 3b6d7308..00000000 --- a/game/themes/common/Love.ini +++ /dev/null @@ -1,27 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -#Video credits to: AA VFX https://www.youtube.com/watch?v=biPycuqGBRc - -############### -[Skin] -Theme=Fantasy -Name= Love -Color=Pink - -[Textures] -TitleBG = [bg-main]love.webm -MainBG = [bg-main]love.webm -SongBG = [bg-main]love.webm -ScoreScreenBG = [bg-main]love.webm -Top5BG = [bg-main]love.webm -OptionsBG = [bg-main]love.webm -PartyBG = [bg-main]love.webm diff --git a/game/themes/common/Magma.ini b/game/themes/common/Magma.ini deleted file mode 100644 index b7cf8c96..00000000 --- a/game/themes/common/Magma.ini +++ /dev/null @@ -1,27 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -#Video credits to: AA VFX https://www.youtube.com/watch?v=X36DOTEzjHw - -############### -[Skin] -Theme=Fantasy -Name= Magma -Color=Red - -[Textures] -TitleBG = [bg-main]magma.webm -MainBG = [bg-main]magma.webm -SongBG = [bg-main]magma.webm -ScoreScreenBG = [bg-main]magma.webm -Top5BG = [bg-main]magma.webm -OptionsBG = [bg-main]magma.webm -PartyBG = [bg-main]magma.webm diff --git a/game/themes/common/Space.ini b/game/themes/common/Space.ini deleted file mode 100644 index a11fadd9..00000000 --- a/game/themes/common/Space.ini +++ /dev/null @@ -1,27 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -#Video credits to: AA VFX https://www.youtube.com/watch?v=S3La-3bUjXk - -############### -[Skin] -Theme=Fantasy -Name= Space -Color=Blue - -[Textures] -TitleBG = [bg-main]space.webm -MainBG = [bg-main]space.webm -SongBG = [bg-main]space.webm -ScoreScreenBG = [bg-main]space.webm -Top5BG = [bg-main]space.webm -OptionsBG = [bg-main]space.webm -PartyBG = [bg-main]space.webm diff --git a/game/themes/common/Static Blue.ini b/game/themes/common/Static Blue.ini deleted file mode 100644 index caede7fe..00000000 --- a/game/themes/common/Static Blue.ini +++ /dev/null @@ -1,25 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -############### -[Skin] -Theme=Fantasy -Name= Static Blue -Color=Blue - -[Textures] -TitleBG = [bg-main]blue.jpg -MainBG = [bg-main]blue.jpg -SongBG = [bg-main]blue.jpg -ScoreScreenBG = [bg-main]blue.jpg -Top5BG = [bg-main]blue.jpg -OptionsBG = [bg-main]blue.jpg -PartyBG = [bg-main]blue.jpg diff --git a/game/themes/common/Static Red.ini b/game/themes/common/Static Red.ini deleted file mode 100644 index a3e5458d..00000000 --- a/game/themes/common/Static Red.ini +++ /dev/null @@ -1,25 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -############### -[Skin] -Theme=Fantasy -Name= Static Red -Color=Red - -[Textures] -TitleBG = [bg-main]red.jpg -MainBG = [bg-main]red.jpg -SongBG = [bg-main]red.jpg -ScoreScreenBG = [bg-main]red.jpg -Top5BG = [bg-main]red.jpg -OptionsBG = [bg-main]red.jpg -PartyBG = [bg-main]red.jpg diff --git a/game/themes/common/Static Violet.ini b/game/themes/common/Static Violet.ini index a892b0c8..244c0301 100644 --- a/game/themes/common/Static Violet.ini +++ b/game/themes/common/Static Violet.ini @@ -9,308 +9,11 @@ # under Creative Common license # ################################### -############### [Skin] -Theme=Fantasy +Theme=Neon Name= Static Violet Color=Violet -[Textures] -/** - * Interface - */ -interface_selectbg_search = [interface]selectbg_search.png -interface_dialog_background = [interface]dialog_background.png -interface_dialog_background2 = [interface]dialog_background2.png -interface_dialog_backgroundtop = [interface]dialog_backgroundtop.png - -Cursor = [interface]cursor.png -Cursor_Pressed = [interface]cursor_pressed.png - -/** - * Icons - */ -icon_song_menu = [icon]song_menu.png -icon_song_search = [icon]song_search.png -icon_song_video = [icon]song_video.png -icon_song_medley = [icon]song_medley.png -icon_song_calcmedley = [icon]song_calcmedley.png -icon_song_duet = [icon]song_duet.png -icon_song_rap = [icon]song_rap.png - -loadicon = [load]logo.png -loadbaricon = [load]bar.png - -# # # M A I N # # # -ButtonSolo = [main]buttonsolo.png -ButtonAbout = [main]buttonabout.png -ButtonParty = [main]buttonparty.png -ButtonStats = [main]buttonstats.png -ButtonJukebox = [main]buttonjukebox.png -ButtonOption = [main]buttonoption.png -ButtonExit = [main]buttonexit.png -Button2 = [main]button2.png -Button = [main]button.png -ButtonF = [main]buttonf.jpg -MainBar = [main]mainBar.png -SelectBG = [main]selectbg.png - -Select_ArrowLeft = [interface]select_arrow_left.png -Select_ArrowRight = [interface]select_arrow_right.png - -#Backgrounds -LoadingBG = [bg-load]basic.jpg -TitleBG = [bg-main]violet.jpg -MainBG = [bg-main]violet.jpg -SongBG = [bg-main]violet.jpg -ScoreScreenBG = [bg-main]violet.jpg -Top5BG = [bg-main]violet.jpg -OptionsBG = [bg-main]violet.jpg -PartyBG = [bg-main]violet.jpg - -# # # S O N G S E L E C E T # # # -SongSelection1up = [main]songSelection1up.png -SongSelection1dn = [main]songSelection1dn.png -SongSelection1 = [main]songSelection1.png -SongSelection2 = [main]songSelection2.png -SongSelection3 = [main]songSelection3.png -SongSelection4 = [main]songSelection4.png -SongSelection5 = [main]songSelection5.png -SongCover = ../../covers/Common/NoCover.jpg -SongMessage = [song]message.png -SongDuetSinger = [song]duetsinger.png -SongDuetSinger2 = [song]duetsinger2.png -SongDuetSinger3 = [song]duetsinger3.png - -# # # S I N G # # # -#the bar where the lyrics reside -LyricBar = [sing]textBar.png -LyricBarDuet = [sing]textBar.png - -#this one slides in, to tell you that singing starts immediately -LyricHelpBar = [sing]lyricsHelpBar.png - -#the bar behind the timestuff -TimeBar1 = [sing]timeBarBG.png - -#the time progress bar (not skinned in this theme :P ) -TimeBar = [sing]timeBar.jpg - -#linebonus, the thing that pop ups at the score -LineBonusBack = [sing]lineBonusPopUp.png - -#Singbar (the thing beneath the scores) -SingBarBack = [sing]singBarBack.png -SingBarBar = [sing]singBarBar.png -SingBarFront = [sing]singBarFront.png - -#Background for scores -ScoreBG = [sing]scoreBg.png - -#Background for the P1, P2 and so on -P = [sing]p.png - -#Pointer for lyrics -Ball = [sing]LyricsBall.png - -#song name for medley mode -SongName = [sing]SongName.png - - -# # # S C O R E / T O P 5 # # # -ScoreBox = [score]box.png -ScoreGlassBox = [score]glass_box.png -ScoreLevel = [score]level.png -ScoreLevelRound = [score]levelRound.png - -ScoreLevel_Dark = [score]level_dark.png -ScoreLevel_Dark_Round = [score]level_dark_round.png - -ScoreLevel_Light = [score]level_light.png -ScoreLevel_Light_Round = [score]level_light_round.png - -ScoreLevel_Lightest = [score]level_lightest.png -ScoreLevel_Lightest_Round = [score]level_lightest_round.png - -ButtonSendScore = [score]buttonsendscore.png - -# Boxes near the text, that show what color is for which bar -ScoreBar_box_lightest = [score]bar_box_lightest.png -ScoreBar_box_light = [score]bar_box_light.png -ScoreBar_box_dark = [score]bar_box_dark.png - -ScoreEndCap = [score]endcap.png -ScoreLine = [score]line.png -PlayerNumberBox = [main]playerNumberBox.png - -Rating_0 = [score]rating_0.png -Rating_1 = [score]rating_1.png -Rating_2 = [score]rating_2.png -Rating_3 = [score]rating_3.png -Rating_4 = [score]rating_4.png -Rating_5 = [score]rating_5.png -Rating_6 = [score]rating_6.png -Rating_7 = [score]rating_7.png - -# # # O P T I O N S # # # -Optionsbuttongame = [Options]buttongame.png -Optionsbuttongraphics = [Options]buttongraphics.png -Optionsbuttonsound = [Options]buttonsound.png -Optionsbuttonlyrics = [Options]buttonlyrics.png -Optionsbuttondesign = [Options]buttondesign.png -Optionsbuttonmicrophones = [Options]buttonmicrophones.png -Optionsbuttonadvanced = [Options]buttonadvanced.png -Optionsbuttonnetwork = [Options]buttonnetwork.png -Optionsbuttonwebcam = [Options]buttonwebcam.png -Optionsbuttonjukebox = [Options]buttonjukebox.png -Optionsbuttonback = [Options]buttonback.png - -# # # M A I N P A R T Y # # # -ClassicButton =[MainParty]ClassicButton.png -ClassicFreeButton =[MainParty]ClassicFreeButton.png -ChallengeButton =[MainParty]ChallengeButton.png -TournamentButton =[tournament]trophy.png - -# # # P A R T Y # # # -Joker =[party]Joker.png -PartyPlayerButton =[party]playerButton.png -PartyTeamButton1 =[party]roundTeamButton.png -PartyTeamButton2 =[party]playerTeamButton.png -PartyTeamButton3 =[party]winTeamButton1.png -PartyTeamButton4 =[party]winTeamButton2.png -PartyTeamButton5 =[party]winTeamButton3.png -PartyRoundBG1 =[party]roundBG1.png -PartyRoundBG2 =[party]roundBG2.png -PartyRoundBG3 =[party]roundBG3.png -PartyRoundBG4 =[party]roundBG4.png -HDL_Pointer =[party]pointer.png -PartyTeamPoints =[party]teamPoints.png -PartyScoreDeco =[party]scoreDecoration.png -PartyScoreBG1 =[party]scoreBG1.png -PartyScoreBG2 =[party]scoreBG2.png -PartyWinDeco1 =[party]winDecoration.png -PartyWinDeco2 =[party]winDecoration.png -PartyWinDeco3 =[party]winDecoration.png -PartyPlayerSelectBG = [party]playerselectbg.png -PartyTrophy =[tournament]trophy.png -PartyWinner =[tournament]winner.png - -# # # S T A T S # # # -StatInfoBG1 = [stat]InfoBG1.png -StatInfoBG2 = [stat]InfoBG2.png - -# # # N A V I # # # -ButtonP = [button]p.png -ButtonM = [button]m.png -ButtonJ = [button]j.png -ButtonC = [button]c.png -ButtonAlt = [button]alt.png -ButtonAZ = [button]az.png -ButtonEnter = [button]enter.png -ButtonNavi = [button]navi.png -ButtonEsc = [button]esc.png -Button13 = [button]13.png -ButtonIns = [button]ins.png -ButtonDel = [button]del.png - -SongMenuBG = [menu]songMenuBg.png -SongMenuSelectBG = [menu]songMenuSelectBg.png -PopUpBG = [menu]popUpBG.png - - -# # # N O T E S # # # -# sung notes - colorized with playercolors -GrayLeft = [sing]notesLeft.png -GrayMid = [sing]notesMid.png -GrayRight = [sing]notesRight.png -# unsung notes - colorized with playercolors -NotePlainLeft = [sing]notesPlainLeft.png -NotePlainMid = [sing]notesPlainMid.png -NotePlainRight = [sing]notesPlainRight.png -# the glow around unsung/sung notes - colorized with playercolors -NoteBGLeft = [sing]notesBgLeft.png -NoteBGMid = [sing]notesBgMid.png -NoteBGRight = [sing]notesBgRight.png -Pause = [sing]pause.png - -GrayLeftRap = [rap]notesLeft.png -GrayMidRap = [rap]notesMid.png -GrayRightRap = [rap]notesRight.png -NotePlainLeftRap = [rap]notesPlainLeft.png -NotePlainMidRap = [rap]notesPlainMid.png -NotePlainRightRap = [rap]notesPlainRight.png -NoteBGLeftRap = [rap]notesBgLeft.png -NoteBGMidRap = [rap]notesBgMid.png -NoteBGRightRap = [rap]notesBgRight.png - -# # # E F F E C T S # # # -NoteStar = [effect]goldenNoteStar.png -NotePerfectStar = [effect]perfectNoteStar.png - - -# # # dirty helpers # # # -Rectangle = [helper]rectangle.png -ButtonFade = [helper]buttonFade.png -BGFade = [special]bg_fade.png - - -# # # DOWNLOAD SCORE # # # -ProgressBar = [sing]timeBar.jpg - -# # # J U K E B O X # # # -JukeboxTimeBar1 = [jukebox]timeBarBG.png -JukeboxTimeBar = [jukebox]timeBar.jpg -JukeboxSong = [jukebox]song.png -JukeboxSongBackground = [jukebox]title.png -JukeboxSongListBackground = [jukebox]songlist.png -JukeboxSongbartopBackground= [jukebox]bartop.png -JukeboxSongOptionsBackground = [jukebox]songoptions.png -JukeboxLyric = [jukebox]lyric.png -JukeboxRandom = [jukebox]random.png -JukeboxRepeat = [jukebox]repeat.png -JukeboxCurrentSongBackground = [jukebox]currentsong.png -JukeboxSongListUp = [jukebox]songlistup.png -JukeboxSongListDown = [jukebox]songlistdown.png -JukeboxOptions = [jukebox]options.png -JukeboxClose = [jukebox]close.png -JukeboxFix = [jukebox]pin.png -JukeboxSongMenuTimeBar = [jukebox]timeBarSongMenuBG.png -JukeboxSongMenuPlayPause = [jukebox]songmenuplaypause.png -JukeboxSongMenuNext = [jukebox]songmenunext.png -JukeboxSongMenuPrevious = [jukebox]songmenuprevious.png -JukeboxSongMenuPlaylist = [jukebox]songmenuplaylist.png -JukeboxSongSelection = [jukebox]songSelection.png -JukeboxField = [jukebox]fieldbg.png -JukeboxButton = [jukebox]mainBar.png -JukeboxSelect = [jukebox]selectbg.png - -# # # COLOR PICKER # # # -PickerBG = [color]pickerbg.png -Picker = [color]picker.jpg -Hue = [color]hue.png -HueBar = [color]hue-bar.png -WhiteFade = [color]white-fade.png -BlackFade = [color]black-fade.png -Pointer = [color]pointer.png - -# # # N A M E # # # -AvatarFrame = [name]frame.png -CurrentPlayer = [name]player.png -SelectFrame = [name]select.png -AvatarFrame2 = [score]frame.png - -# # # NO AVATARS # # # -NoAvatar_P1 = [name]noavatar.png -NoAvatar_P2 = [name]noavatar.png -NoAvatar_P3 = [name]noavatar.png -NoAvatar_P4 = [name]noavatar.png -NoAvatar_P5 = [name]noavatar.png -NoAvatar_P6 = [name]noavatar.png - -# # # A B O U T # # # -LogoWeb = [About]logo_web.png -LogoDeluxe = [About]logo_deluxe.png -AboutBG = [About]helperbg2.png - -# # # D E V E L O P E R S # # # -Dhelperbg = [Developers]helperbg.png +####################### +#-- WORK IN PROGRESS -- +####################### \ No newline at end of file diff --git a/game/themes/common/Universe.ini b/game/themes/common/Universe.ini deleted file mode 100644 index edc08632..00000000 --- a/game/themes/common/Universe.ini +++ /dev/null @@ -1,318 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -#Video credits to: AA VFX https://www.youtube.com/watch?v=S3La-3bUjXk - -############### -[Skin] -Theme=Party -Name= Universe -Color=Blue - -[Textures] -/** - * Interface - */ -interface_selectbg_search = [interface]selectbg_search.png -interface_dialog_background = [interface]dialog_background.png -interface_dialog_background2 = [interface]dialog_background2.png -interface_dialog_backgroundtop = [interface]dialog_backgroundtop.png - -Cursor = [interface]cursor.png -Cursor_Pressed = [interface]cursor_pressed.png - -/** - * Icons - */ -icon_song_menu = [icon]song_menu.png -icon_song_search = [icon]song_search.png -icon_song_video = [icon]song_video.png -icon_song_medley = [icon]song_medley.png -icon_song_calcmedley = [icon]song_calcmedley.png -icon_song_duet = [icon]song_duet.png -icon_song_rap = [icon]song_rap.png - -loadicon = [load]logo.png -loadbaricon = [load]bar.png - -# # # M A I N # # # -ButtonSolo = [main]buttonsolo.png -ButtonAbout = [main]buttonabout.png -ButtonParty = [main]buttonparty.png -ButtonStats = [main]buttonstats.png -ButtonJukebox = [main]buttonjukebox.png -ButtonOption = [main]buttonoption.png -ButtonExit = [main]buttonexit.png -Button2 = [main]button2.png -Button = [main]button.png -ButtonF = [main]buttonf.jpg -MainBar = [main]mainBar.png -SelectBG = [main]selectbg.png - -Select_ArrowLeft = [interface]select_arrow_left.png -Select_ArrowRight = [interface]select_arrow_right.png - -#Backgrounds -LoadingBG = [bg-load]basic.jpg -TitleBG = [bg-main]space.webm -MainBG = [bg-main]space.webm -SongBG = [bg-main]space.webm -ScoreScreenBG = [bg-main]space.webm -Top5BG = [bg-main]space.webm -OptionsBG = [bg-main]space.webm -PartyBG = [bg-main]space.webm - -# # # S O N G S E L E C E T # # # -SongSelection1up = [main]songSelection1up.png -SongSelection1dn = [main]songSelection1dn.png -SongSelection1 = [main]songSelection1.png -SongSelection2 = [main]songSelection2.png -SongSelection3 = [main]songSelection3.png -SongSelection4 = [main]songSelection4.png -SongSelection5 = [main]songSelection5.png -SongCover = ../../covers/Common/NoCover.jpg -SongMessage = [song]message.png -SongDuetSinger = [song]duetsinger.png -SongDuetSinger2 = [song]duetsinger2.png -SongDuetSinger3 = [song]duetsinger3.png - -# # # S I N G # # # -#the bar where the lyrics reside -LyricBar = [sing]textBar.png -LyricBarDuet = [sing]textBar.png - -#this one slides in, to tell you that singing starts immediately -LyricHelpBar = [sing]lyricsHelpBar.png - -#the bar behind the timestuff -TimeBar1 = [sing]timeBarBG.png - -#the time progress bar (not skinned in this theme :P ) -TimeBar = [sing]timeBar.jpg - -#linebonus, the thing that pop ups at the score -LineBonusBack = [sing]lineBonusPopUp.png - -#Singbar (the thing beneath the scores) -SingBarBack = [sing]singBarBack.png -SingBarBar = [sing]singBarBar.png -SingBarFront = [sing]singBarFront.png - -#Background for scores -ScoreBG = [sing]scoreBg.png - -#Background for the P1, P2 and so on -P = [sing]p.png - -#Pointer for lyrics -Ball = [sing]LyricsBall.png - -#song name for medley mode -SongName = [sing]SongName.png - - -# # # S C O R E / T O P 5 # # # -ScoreBox = [score]box.png -ScoreGlassBox = [score]glass_box.png -ScoreLevel = [score]level.png -ScoreLevelRound = [score]levelRound.png - -ScoreLevel_Dark = [score]level_dark.png -ScoreLevel_Dark_Round = [score]level_dark_round.png - -ScoreLevel_Light = [score]level_light.png -ScoreLevel_Light_Round = [score]level_light_round.png - -ScoreLevel_Lightest = [score]level_lightest.png -ScoreLevel_Lightest_Round = [score]level_lightest_round.png - -ButtonSendScore = [score]buttonsendscore.png - -# Boxes near the text, that show what color is for which bar -ScoreBar_box_lightest = [score]bar_box_lightest.png -ScoreBar_box_light = [score]bar_box_light.png -ScoreBar_box_dark = [score]bar_box_dark.png - -ScoreEndCap = [score]endcap.png -ScoreLine = [score]line.png -PlayerNumberBox = [main]playerNumberBox.png - -Rating_0 = [score]rating_0.png -Rating_1 = [score]rating_1.png -Rating_2 = [score]rating_2.png -Rating_3 = [score]rating_3.png -Rating_4 = [score]rating_4.png -Rating_5 = [score]rating_5.png -Rating_6 = [score]rating_6.png -Rating_7 = [score]rating_7.png - -# # # O P T I O N S # # # -Optionsbuttongame = [Options]buttongame.png -Optionsbuttongraphics = [Options]buttongraphics.png -Optionsbuttonsound = [Options]buttonsound.png -Optionsbuttonlyrics = [Options]buttonlyrics.png -Optionsbuttondesign = [Options]buttondesign.png -Optionsbuttonmicrophones = [Options]buttonmicrophones.png -Optionsbuttonadvanced = [Options]buttonadvanced.png -Optionsbuttonnetwork = [Options]buttonnetwork.png -Optionsbuttonwebcam = [Options]buttonwebcam.png -Optionsbuttonjukebox = [Options]buttonjukebox.png -Optionsbuttonback = [Options]buttonback.png - -# # # M A I N P A R T Y # # # -ClassicButton =[MainParty]ClassicButton.png -ClassicFreeButton =[MainParty]ClassicFreeButton.png -ChallengeButton =[MainParty]ChallengeButton.png -TournamentButton =[tournament]trophy.png - -# # # P A R T Y # # # -Joker =[party]Joker.png -PartyPlayerButton =[party]playerButton.png -PartyTeamButton1 =[party]roundTeamButton.png -PartyTeamButton2 =[party]playerTeamButton.png -PartyTeamButton3 =[party]winTeamButton1.png -PartyTeamButton4 =[party]winTeamButton2.png -PartyTeamButton5 =[party]winTeamButton3.png -PartyRoundBG1 =[party]roundBG1.png -PartyRoundBG2 =[party]roundBG2.png -PartyRoundBG3 =[party]roundBG3.png -PartyRoundBG4 =[party]roundBG4.png -HDL_Pointer =[party]pointer.png -PartyTeamPoints =[party]teamPoints.png -PartyScoreDeco =[party]scoreDecoration.png -PartyScoreBG1 =[party]scoreBG1.png -PartyScoreBG2 =[party]scoreBG2.png -PartyWinDeco1 =[party]winDecoration.png -PartyWinDeco2 =[party]winDecoration.png -PartyWinDeco3 =[party]winDecoration.png -PartyPlayerSelectBG = [party]playerselectbg.png -PartyTrophy =[tournament]trophy.png -PartyWinner =[tournament]winner.png - -# # # S T A T S # # # -StatInfoBG1 = [stat]InfoBG1.png -StatInfoBG2 = [stat]InfoBG2.png - -# # # N A V I # # # -ButtonP = [button]p.png -ButtonM = [button]m.png -ButtonJ = [button]j.png -ButtonC = [button]c.png -ButtonAlt = [button]alt.png -ButtonAZ = [button]az.png -ButtonEnter = [button]enter.png -ButtonNavi = [button]navi.png -ButtonEsc = [button]esc.png -Button13 = [button]13.png -ButtonIns = [button]ins.png -ButtonDel = [button]del.png - -SongMenuBG = [menu]songMenuBg.png -SongMenuSelectBG = [menu]songMenuSelectBg.png -PopUpBG = [menu]popUpBG.png - - -# # # N O T E S # # # -# sung notes - colorized with playercolors -GrayLeft = [sing]notesLeft.png -GrayMid = [sing]notesMid.png -GrayRight = [sing]notesRight.png -# unsung notes - colorized with playercolors -NotePlainLeft = [sing]notesPlainLeft.png -NotePlainMid = [sing]notesPlainMid.png -NotePlainRight = [sing]notesPlainRight.png -# the glow around unsung/sung notes - colorized with playercolors -NoteBGLeft = [sing]notesBgLeft.png -NoteBGMid = [sing]notesBgMid.png -NoteBGRight = [sing]notesBgRight.png -Pause = [sing]pause.png - -GrayLeftRap = [rap]notesLeft.png -GrayMidRap = [rap]notesMid.png -GrayRightRap = [rap]notesRight.png -NotePlainLeftRap = [rap]notesPlainLeft.png -NotePlainMidRap = [rap]notesPlainMid.png -NotePlainRightRap = [rap]notesPlainRight.png -NoteBGLeftRap = [rap]notesBgLeft.png -NoteBGMidRap = [rap]notesBgMid.png -NoteBGRightRap = [rap]notesBgRight.png - -# # # E F F E C T S # # # -NoteStar = [effect]goldenNoteStar.png -NotePerfectStar = [effect]perfectNoteStar.png - - -# # # dirty helpers # # # -Rectangle = [helper]rectangle.png -ButtonFade = [helper]buttonFade.png -BGFade = [special]bg_fade.png - - -# # # DOWNLOAD SCORE # # # -ProgressBar = [sing]timeBar.jpg - -# # # J U K E B O X # # # -JukeboxTimeBar1 = [jukebox]timeBarBG.png -JukeboxTimeBar = [jukebox]timeBar.jpg -JukeboxSong = [jukebox]song.png -JukeboxSongBackground = [jukebox]title.png -JukeboxSongListBackground = [jukebox]songlist.png -JukeboxSongbartopBackground= [jukebox]bartop.png -JukeboxSongOptionsBackground = [jukebox]songoptions.png -JukeboxLyric = [jukebox]lyric.png -JukeboxRandom = [jukebox]random.png -JukeboxRepeat = [jukebox]repeat.png -JukeboxCurrentSongBackground = [jukebox]currentsong.png -JukeboxSongListUp = [jukebox]songlistup.png -JukeboxSongListDown = [jukebox]songlistdown.png -JukeboxOptions = [jukebox]options.png -JukeboxClose = [jukebox]close.png -JukeboxFix = [jukebox]pin.png -JukeboxSongMenuTimeBar = [jukebox]timeBarSongMenuBG.png -JukeboxSongMenuPlayPause = [jukebox]songmenuplaypause.png -JukeboxSongMenuNext = [jukebox]songmenunext.png -JukeboxSongMenuPrevious = [jukebox]songmenuprevious.png -JukeboxSongMenuPlaylist = [jukebox]songmenuplaylist.png -JukeboxSongSelection = [jukebox]songSelection.png -JukeboxField = [jukebox]fieldbg.png -JukeboxButton = [jukebox]mainBar.png -JukeboxSelect = [jukebox]selectbg.png - -# # # COLOR PICKER # # # -PickerBG = [color]pickerbg.png -Picker = [color]picker.jpg -Hue = [color]hue.png -HueBar = [color]hue-bar.png -WhiteFade = [color]white-fade.png -BlackFade = [color]black-fade.png -Pointer = [color]pointer.png - -# # # N A M E # # # -AvatarFrame = [name]frame.png -CurrentPlayer = [name]player.png -SelectFrame = [name]select.png -AvatarFrame2 = [score]frame.png - -# # # NO AVATARS # # # -NoAvatar_P1 = [name]noavatar.png -NoAvatar_P2 = [name]noavatar.png -NoAvatar_P3 = [name]noavatar.png -NoAvatar_P4 = [name]noavatar.png -NoAvatar_P5 = [name]noavatar.png -NoAvatar_P6 = [name]noavatar.png - -# # # A B O U T # # # -LogoWeb = [About]logo_web.png -LogoDeluxe = [About]logo_deluxe.png -AboutBG = [About]helperbg2.png - -# # # D E V E L O P E R S # # # -Dhelperbg = [Developers]helperbg.png diff --git a/game/themes/common/Waves.ini b/game/themes/common/Waves.ini deleted file mode 100644 index 3e7f854d..00000000 --- a/game/themes/common/Waves.ini +++ /dev/null @@ -1,318 +0,0 @@ -################################### -# theme developed by Daniel20 # -# for https:\\ultrastar-es.org # -# visit us to get songs, plugins, # -# themes and more... # -# # -# *some icons belongs to # -# https://www.iconfinder.com/ # -# under Creative Common license # -################################### - -#Video credits to: AA VFX https://www.youtube.com/watch?v=53pUo71jr8w - -############### -[Skin] -Theme=Party -Name= Waves -Color=Pink - -[Textures] -/** - * Interface - */ -interface_selectbg_search = [interface]selectbg_search.png -interface_dialog_background = [interface]dialog_background.png -interface_dialog_background2 = [interface]dialog_background2.png -interface_dialog_backgroundtop = [interface]dialog_backgroundtop.png - -Cursor = [interface]cursor.png -Cursor_Pressed = [interface]cursor_pressed.png - -/** - * Icons - */ -icon_song_menu = [icon]song_menu.png -icon_song_search = [icon]song_search.png -icon_song_video = [icon]song_video.png -icon_song_medley = [icon]song_medley.png -icon_song_calcmedley = [icon]song_calcmedley.png -icon_song_duet = [icon]song_duet.png -icon_song_rap = [icon]song_rap.png - -loadicon = [load]logo.png -loadbaricon = [load]bar.png - -# # # M A I N # # # -ButtonSolo = [main]buttonsolo.png -ButtonAbout = [main]buttonabout.png -ButtonParty = [main]buttonparty.png -ButtonStats = [main]buttonstats.png -ButtonJukebox = [main]buttonjukebox.png -ButtonOption = [main]buttonoption.png -ButtonExit = [main]buttonexit.png -Button2 = [main]button2.png -Button = [main]button.png -ButtonF = [main]buttonf.jpg -MainBar = [main]mainBar.png -SelectBG = [main]selectbg.png - -Select_ArrowLeft = [interface]select_arrow_left.png -Select_ArrowRight = [interface]select_arrow_right.png - -#Backgrounds -LoadingBG = [bg-load]basic.jpg -TitleBG = [bg-main]lines.webm -MainBG = [bg-main]lines.webm -SongBG = [bg-main]lines.webm -ScoreScreenBG = [bg-main]lines.webm -Top5BG = [bg-main]lines.webm -OptionsBG = [bg-main]lines.webm -PartyBG = [bg-main]lines.webm - -# # # S O N G S E L E C E T # # # -SongSelection1up = [main]songSelection1up.png -SongSelection1dn = [main]songSelection1dn.png -SongSelection1 = [main]songSelection1.png -SongSelection2 = [main]songSelection2.png -SongSelection3 = [main]songSelection3.png -SongSelection4 = [main]songSelection4.png -SongSelection5 = [main]songSelection5.png -SongCover = ../../covers/Common/NoCover.jpg -SongMessage = [song]message.png -SongDuetSinger = [song]duetsinger.png -SongDuetSinger2 = [song]duetsinger2.png -SongDuetSinger3 = [song]duetsinger3.png - -# # # S I N G # # # -#the bar where the lyrics reside -LyricBar = [sing]textBar.png -LyricBarDuet = [sing]textBar.png - -#this one slides in, to tell you that singing starts immediately -LyricHelpBar = [sing]lyricsHelpBar.png - -#the bar behind the timestuff -TimeBar1 = [sing]timeBarBG.png - -#the time progress bar (not skinned in this theme :P ) -TimeBar = [sing]timeBar.jpg - -#linebonus, the thing that pop ups at the score -LineBonusBack = [sing]lineBonusPopUp.png - -#Singbar (the thing beneath the scores) -SingBarBack = [sing]singBarBack.png -SingBarBar = [sing]singBarBar.png -SingBarFront = [sing]singBarFront.png - -#Background for scores -ScoreBG = [sing]scoreBg.png - -#Background for the P1, P2 and so on -P = [sing]p.png - -#Pointer for lyrics -Ball = [sing]LyricsBall.png - -#song name for medley mode -SongName = [sing]SongName.png - - -# # # S C O R E / T O P 5 # # # -ScoreBox = [score]box.png -ScoreGlassBox = [score]glass_box.png -ScoreLevel = [score]level.png -ScoreLevelRound = [score]levelRound.png - -ScoreLevel_Dark = [score]level_dark.png -ScoreLevel_Dark_Round = [score]level_dark_round.png - -ScoreLevel_Light = [score]level_light.png -ScoreLevel_Light_Round = [score]level_light_round.png - -ScoreLevel_Lightest = [score]level_lightest.png -ScoreLevel_Lightest_Round = [score]level_lightest_round.png - -ButtonSendScore = [score]buttonsendscore.png - -# Boxes near the text, that show what color is for which bar -ScoreBar_box_lightest = [score]bar_box_lightest.png -ScoreBar_box_light = [score]bar_box_light.png -ScoreBar_box_dark = [score]bar_box_dark.png - -ScoreEndCap = [score]endcap.png -ScoreLine = [score]line.png -PlayerNumberBox = [main]playerNumberBox.png - -Rating_0 = [score]rating_0.png -Rating_1 = [score]rating_1.png -Rating_2 = [score]rating_2.png -Rating_3 = [score]rating_3.png -Rating_4 = [score]rating_4.png -Rating_5 = [score]rating_5.png -Rating_6 = [score]rating_6.png -Rating_7 = [score]rating_7.png - -# # # O P T I O N S # # # -Optionsbuttongame = [Options]buttongame.png -Optionsbuttongraphics = [Options]buttongraphics.png -Optionsbuttonsound = [Options]buttonsound.png -Optionsbuttonlyrics = [Options]buttonlyrics.png -Optionsbuttondesign = [Options]buttondesign.png -Optionsbuttonmicrophones = [Options]buttonmicrophones.png -Optionsbuttonadvanced = [Options]buttonadvanced.png -Optionsbuttonnetwork = [Options]buttonnetwork.png -Optionsbuttonwebcam = [Options]buttonwebcam.png -Optionsbuttonjukebox = [Options]buttonjukebox.png -Optionsbuttonback = [Options]buttonback.png - -# # # M A I N P A R T Y # # # -ClassicButton =[MainParty]ClassicButton.png -ClassicFreeButton =[MainParty]ClassicFreeButton.png -ChallengeButton =[MainParty]ChallengeButton.png -TournamentButton =[tournament]trophy.png - -# # # P A R T Y # # # -Joker =[party]Joker.png -PartyPlayerButton =[party]playerButton.png -PartyTeamButton1 =[party]roundTeamButton.png -PartyTeamButton2 =[party]playerTeamButton.png -PartyTeamButton3 =[party]winTeamButton1.png -PartyTeamButton4 =[party]winTeamButton2.png -PartyTeamButton5 =[party]winTeamButton3.png -PartyRoundBG1 =[party]roundBG1.png -PartyRoundBG2 =[party]roundBG2.png -PartyRoundBG3 =[party]roundBG3.png -PartyRoundBG4 =[party]roundBG4.png -HDL_Pointer =[party]pointer.png -PartyTeamPoints =[party]teamPoints.png -PartyScoreDeco =[party]scoreDecoration.png -PartyScoreBG1 =[party]scoreBG1.png -PartyScoreBG2 =[party]scoreBG2.png -PartyWinDeco1 =[party]winDecoration.png -PartyWinDeco2 =[party]winDecoration.png -PartyWinDeco3 =[party]winDecoration.png -PartyPlayerSelectBG = [party]playerselectbg.png -PartyTrophy =[tournament]trophy.png -PartyWinner =[tournament]winner.png - -# # # S T A T S # # # -StatInfoBG1 = [stat]InfoBG1.png -StatInfoBG2 = [stat]InfoBG2.png - -# # # N A V I # # # -ButtonP = [button]p.png -ButtonM = [button]m.png -ButtonJ = [button]j.png -ButtonC = [button]c.png -ButtonAlt = [button]alt.png -ButtonAZ = [button]az.png -ButtonEnter = [button]enter.png -ButtonNavi = [button]navi.png -ButtonEsc = [button]esc.png -Button13 = [button]13.png -ButtonIns = [button]ins.png -ButtonDel = [button]del.png - -SongMenuBG = [menu]songMenuBg.png -SongMenuSelectBG = [menu]songMenuSelectBg.png -PopUpBG = [menu]popUpBG.png - - -# # # N O T E S # # # -# sung notes - colorized with playercolors -GrayLeft = [sing]notesLeft.png -GrayMid = [sing]notesMid.png -GrayRight = [sing]notesRight.png -# unsung notes - colorized with playercolors -NotePlainLeft = [sing]notesPlainLeft.png -NotePlainMid = [sing]notesPlainMid.png -NotePlainRight = [sing]notesPlainRight.png -# the glow around unsung/sung notes - colorized with playercolors -NoteBGLeft = [sing]notesBgLeft.png -NoteBGMid = [sing]notesBgMid.png -NoteBGRight = [sing]notesBgRight.png -Pause = [sing]pause.png - -GrayLeftRap = [rap]notesLeft.png -GrayMidRap = [rap]notesMid.png -GrayRightRap = [rap]notesRight.png -NotePlainLeftRap = [rap]notesPlainLeft.png -NotePlainMidRap = [rap]notesPlainMid.png -NotePlainRightRap = [rap]notesPlainRight.png -NoteBGLeftRap = [rap]notesBgLeft.png -NoteBGMidRap = [rap]notesBgMid.png -NoteBGRightRap = [rap]notesBgRight.png - -# # # E F F E C T S # # # -NoteStar = [effect]goldenNoteStar.png -NotePerfectStar = [effect]perfectNoteStar.png - - -# # # dirty helpers # # # -Rectangle = [helper]rectangle.png -ButtonFade = [helper]buttonFade.png -BGFade = [special]bg_fade.png - - -# # # DOWNLOAD SCORE # # # -ProgressBar = [sing]timeBar.jpg - -# # # J U K E B O X # # # -JukeboxTimeBar1 = [jukebox]timeBarBG.png -JukeboxTimeBar = [jukebox]timeBar.jpg -JukeboxSong = [jukebox]song.png -JukeboxSongBackground = [jukebox]title.png -JukeboxSongListBackground = [jukebox]songlist.png -JukeboxSongbartopBackground= [jukebox]bartop.png -JukeboxSongOptionsBackground = [jukebox]songoptions.png -JukeboxLyric = [jukebox]lyric.png -JukeboxRandom = [jukebox]random.png -JukeboxRepeat = [jukebox]repeat.png -JukeboxCurrentSongBackground = [jukebox]currentsong.png -JukeboxSongListUp = [jukebox]songlistup.png -JukeboxSongListDown = [jukebox]songlistdown.png -JukeboxOptions = [jukebox]options.png -JukeboxClose = [jukebox]close.png -JukeboxFix = [jukebox]pin.png -JukeboxSongMenuTimeBar = [jukebox]timeBarSongMenuBG.png -JukeboxSongMenuPlayPause = [jukebox]songmenuplaypause.png -JukeboxSongMenuNext = [jukebox]songmenunext.png -JukeboxSongMenuPrevious = [jukebox]songmenuprevious.png -JukeboxSongMenuPlaylist = [jukebox]songmenuplaylist.png -JukeboxSongSelection = [jukebox]songSelection.png -JukeboxField = [jukebox]fieldbg.png -JukeboxButton = [jukebox]mainBar.png -JukeboxSelect = [jukebox]selectbg.png - -# # # COLOR PICKER # # # -PickerBG = [color]pickerbg.png -Picker = [color]picker.jpg -Hue = [color]hue.png -HueBar = [color]hue-bar.png -WhiteFade = [color]white-fade.png -BlackFade = [color]black-fade.png -Pointer = [color]pointer.png - -# # # N A M E # # # -AvatarFrame = [name]frame.png -CurrentPlayer = [name]player.png -SelectFrame = [name]select.png -AvatarFrame2 = [score]frame.png - -# # # NO AVATARS # # # -NoAvatar_P1 = [name]noavatar.png -NoAvatar_P2 = [name]noavatar.png -NoAvatar_P3 = [name]noavatar.png -NoAvatar_P4 = [name]noavatar.png -NoAvatar_P5 = [name]noavatar.png -NoAvatar_P6 = [name]noavatar.png - -# # # A B O U T # # # -LogoWeb = [About]logo_web.png -LogoDeluxe = [About]logo_deluxe.png -AboutBG = [About]helperbg2.png - -# # # D E V E L O P E R S # # # -Dhelperbg = [Developers]helperbg.png diff --git a/game/themes/common/[About]helperbg2.png b/game/themes/common/[About]helperbg2.png index ba6f4918..d39cfa47 100644 Binary files a/game/themes/common/[About]helperbg2.png and b/game/themes/common/[About]helperbg2.png differ diff --git a/game/themes/common/[About]logo_web.png b/game/themes/common/[About]logo_web.png index 34cf75d6..6a93f995 100644 Binary files a/game/themes/common/[About]logo_web.png and b/game/themes/common/[About]logo_web.png differ diff --git a/game/themes/common/[Developers]helperbg.png b/game/themes/common/[Developers]helperbg.png index 88785b99..01300085 100644 Binary files a/game/themes/common/[Developers]helperbg.png and b/game/themes/common/[Developers]helperbg.png differ diff --git a/game/themes/common/[Options]buttonadvanced.png b/game/themes/common/[Options]buttonadvanced.png index 3f48003f..704daec1 100644 Binary files a/game/themes/common/[Options]buttonadvanced.png and b/game/themes/common/[Options]buttonadvanced.png differ diff --git a/game/themes/common/[Options]buttonback.png b/game/themes/common/[Options]buttonback.png index dfce0287..11aa0168 100644 Binary files a/game/themes/common/[Options]buttonback.png and b/game/themes/common/[Options]buttonback.png differ diff --git a/game/themes/common/[Options]buttondesign.png b/game/themes/common/[Options]buttondesign.png index 8dc69a7b..9a42c36a 100644 Binary files a/game/themes/common/[Options]buttondesign.png and b/game/themes/common/[Options]buttondesign.png differ diff --git a/game/themes/common/[Options]buttongame.png b/game/themes/common/[Options]buttongame.png index 484eb69f..58fc4876 100644 Binary files a/game/themes/common/[Options]buttongame.png and b/game/themes/common/[Options]buttongame.png differ diff --git a/game/themes/common/[Options]buttongraphics.png b/game/themes/common/[Options]buttongraphics.png index 2a02c926..ca2db54a 100644 Binary files a/game/themes/common/[Options]buttongraphics.png and b/game/themes/common/[Options]buttongraphics.png differ diff --git a/game/themes/common/[Options]buttonjukebox.png b/game/themes/common/[Options]buttonjukebox.png index 8b8cd3ff..5128a98d 100644 Binary files a/game/themes/common/[Options]buttonjukebox.png and b/game/themes/common/[Options]buttonjukebox.png differ diff --git a/game/themes/common/[Options]buttonlyrics.png b/game/themes/common/[Options]buttonlyrics.png index 94449410..f329dc0a 100644 Binary files a/game/themes/common/[Options]buttonlyrics.png and b/game/themes/common/[Options]buttonlyrics.png differ diff --git a/game/themes/common/[Options]buttonmicrophones.png b/game/themes/common/[Options]buttonmicrophones.png index 98fdab69..610056b7 100644 Binary files a/game/themes/common/[Options]buttonmicrophones.png and b/game/themes/common/[Options]buttonmicrophones.png differ diff --git a/game/themes/common/[Options]buttonnetwork.png b/game/themes/common/[Options]buttonnetwork.png index 2382ab0d..d0ad12fa 100644 Binary files a/game/themes/common/[Options]buttonnetwork.png and b/game/themes/common/[Options]buttonnetwork.png differ diff --git a/game/themes/common/[Options]buttonprofiles.png b/game/themes/common/[Options]buttonprofiles.png new file mode 100644 index 00000000..f967278b Binary files /dev/null and b/game/themes/common/[Options]buttonprofiles.png differ diff --git a/game/themes/common/[Options]buttonsound.png b/game/themes/common/[Options]buttonsound.png index 6d588d21..4a027f40 100644 Binary files a/game/themes/common/[Options]buttonsound.png and b/game/themes/common/[Options]buttonsound.png differ diff --git a/game/themes/common/[Options]buttonwebcam.png b/game/themes/common/[Options]buttonwebcam.png index badadd32..d1d18767 100644 Binary files a/game/themes/common/[Options]buttonwebcam.png and b/game/themes/common/[Options]buttonwebcam.png differ diff --git a/game/themes/common/[bg-load]basic.jpg b/game/themes/common/[bg-load]basic.jpg index 4a394b3a..f8511367 100644 Binary files a/game/themes/common/[bg-load]basic.jpg and b/game/themes/common/[bg-load]basic.jpg differ diff --git a/game/themes/common/[bg-main]blue.jpg b/game/themes/common/[bg-main]blue.jpg deleted file mode 100644 index 658b4728..00000000 Binary files a/game/themes/common/[bg-main]blue.jpg and /dev/null differ diff --git a/game/themes/common/[bg-main]red.jpg b/game/themes/common/[bg-main]red.jpg deleted file mode 100644 index 68db580f..00000000 Binary files a/game/themes/common/[bg-main]red.jpg and /dev/null differ diff --git a/game/themes/common/[bg-main]violet.jpg b/game/themes/common/[bg-main]violet.jpg index 681e613a..3dc34a17 100644 Binary files a/game/themes/common/[bg-main]violet.jpg and b/game/themes/common/[bg-main]violet.jpg differ diff --git a/game/themes/common/[button]13.png b/game/themes/common/[button]13.png index f837cbe1..7db87046 100644 Binary files a/game/themes/common/[button]13.png and b/game/themes/common/[button]13.png differ diff --git a/game/themes/common/[button]alt.png b/game/themes/common/[button]alt.png index 06ae7e77..50aea37f 100644 Binary files a/game/themes/common/[button]alt.png and b/game/themes/common/[button]alt.png differ diff --git a/game/themes/common/[button]az.png b/game/themes/common/[button]az.png index 2ec4b87f..e340a7af 100644 Binary files a/game/themes/common/[button]az.png and b/game/themes/common/[button]az.png differ diff --git a/game/themes/common/[button]del.png b/game/themes/common/[button]del.png index 8941767b..eaf0848d 100644 Binary files a/game/themes/common/[button]del.png and b/game/themes/common/[button]del.png differ diff --git a/game/themes/common/[button]enter.png b/game/themes/common/[button]enter.png index 68b3a50d..95581a0b 100644 Binary files a/game/themes/common/[button]enter.png and b/game/themes/common/[button]enter.png differ diff --git a/game/themes/common/[button]esc.png b/game/themes/common/[button]esc.png index fb6128d2..517af830 100644 Binary files a/game/themes/common/[button]esc.png and b/game/themes/common/[button]esc.png differ diff --git a/game/themes/common/[button]ins.png b/game/themes/common/[button]ins.png index a2c8eecd..31501303 100644 Binary files a/game/themes/common/[button]ins.png and b/game/themes/common/[button]ins.png differ diff --git a/game/themes/common/[button]j.png b/game/themes/common/[button]j.png index 3e42be75..047b44f2 100644 Binary files a/game/themes/common/[button]j.png and b/game/themes/common/[button]j.png differ diff --git a/game/themes/common/[button]m.png b/game/themes/common/[button]m.png index 02a209ef..e98f975a 100644 Binary files a/game/themes/common/[button]m.png and b/game/themes/common/[button]m.png differ diff --git a/game/themes/common/[button]navi.png b/game/themes/common/[button]navi.png index 80215da6..aab57705 100644 Binary files a/game/themes/common/[button]navi.png and b/game/themes/common/[button]navi.png differ diff --git a/game/themes/common/[button]p.png b/game/themes/common/[button]p.png index e5ca531f..4931e5cd 100644 Binary files a/game/themes/common/[button]p.png and b/game/themes/common/[button]p.png differ diff --git a/game/themes/common/[button]rectangle.png b/game/themes/common/[button]rectangle.png new file mode 100644 index 00000000..b1eb9c29 Binary files /dev/null and b/game/themes/common/[button]rectangle.png differ diff --git a/game/themes/common/[color]black-fade.png b/game/themes/common/[color]black-fade.png index 56f59bdb..90967089 100644 Binary files a/game/themes/common/[color]black-fade.png and b/game/themes/common/[color]black-fade.png differ diff --git a/game/themes/common/[color]hue-bar.png b/game/themes/common/[color]hue-bar.png index 80210f36..4ba29e37 100644 Binary files a/game/themes/common/[color]hue-bar.png and b/game/themes/common/[color]hue-bar.png differ diff --git a/game/themes/common/[color]picker.jpg b/game/themes/common/[color]picker.jpg index 746d396f..db51a4ea 100644 Binary files a/game/themes/common/[color]picker.jpg and b/game/themes/common/[color]picker.jpg differ diff --git a/game/themes/common/[color]picker.png b/game/themes/common/[color]picker.png index 69bfbe3c..2d42904c 100644 Binary files a/game/themes/common/[color]picker.png and b/game/themes/common/[color]picker.png differ diff --git a/game/themes/common/[color]pickerbg.png b/game/themes/common/[color]pickerbg.png index 8541275d..c107a962 100644 Binary files a/game/themes/common/[color]pickerbg.png and b/game/themes/common/[color]pickerbg.png differ diff --git a/game/themes/common/[color]pointer.png b/game/themes/common/[color]pointer.png index 2292d6c1..e94b4a6d 100644 Binary files a/game/themes/common/[color]pointer.png and b/game/themes/common/[color]pointer.png differ diff --git a/game/themes/common/[color]white-fade.png b/game/themes/common/[color]white-fade.png index 91fab672..db5a2ab4 100644 Binary files a/game/themes/common/[color]white-fade.png and b/game/themes/common/[color]white-fade.png differ diff --git a/game/themes/common/[common]blackbg.png b/game/themes/common/[common]blackbg.png new file mode 100644 index 00000000..3cf27f47 Binary files /dev/null and b/game/themes/common/[common]blackbg.png differ diff --git a/game/themes/common/[effect]goldenNoteStar.png b/game/themes/common/[effect]goldenNoteStar.png index bd3e21a5..a4e9160b 100644 Binary files a/game/themes/common/[effect]goldenNoteStar.png and b/game/themes/common/[effect]goldenNoteStar.png differ diff --git a/game/themes/common/[effect]perfectNoteStar.png b/game/themes/common/[effect]perfectNoteStar.png index a9d0fccf..c6fc4989 100644 Binary files a/game/themes/common/[effect]perfectNoteStar.png and b/game/themes/common/[effect]perfectNoteStar.png differ diff --git a/game/themes/common/[helper]buttonFade.png b/game/themes/common/[helper]buttonFade.png index c51465db..7ace9230 100644 Binary files a/game/themes/common/[helper]buttonFade.png and b/game/themes/common/[helper]buttonFade.png differ diff --git a/game/themes/common/[helper]rectangle.png b/game/themes/common/[helper]rectangle.png deleted file mode 100644 index 8c607396..00000000 Binary files a/game/themes/common/[helper]rectangle.png and /dev/null differ diff --git a/game/themes/common/[icon]song_calcmedley.png b/game/themes/common/[icon]song_calcmedley.png deleted file mode 100644 index 3b1b243e..00000000 Binary files a/game/themes/common/[icon]song_calcmedley.png and /dev/null differ diff --git a/game/themes/common/[icon]song_createdby.png b/game/themes/common/[icon]song_createdby.png new file mode 100644 index 00000000..95fb0ccc Binary files /dev/null and b/game/themes/common/[icon]song_createdby.png differ diff --git a/game/themes/common/[icon]song_duet.png b/game/themes/common/[icon]song_duet.png index 6cf3bcc9..70eae283 100644 Binary files a/game/themes/common/[icon]song_duet.png and b/game/themes/common/[icon]song_duet.png differ diff --git a/game/themes/common/[icon]song_fixedby.png b/game/themes/common/[icon]song_fixedby.png new file mode 100644 index 00000000..b7b64d9b Binary files /dev/null and b/game/themes/common/[icon]song_fixedby.png differ diff --git a/game/themes/common/[icon]song_medley.png b/game/themes/common/[icon]song_medley.png index 514e9e3d..cf905698 100644 Binary files a/game/themes/common/[icon]song_medley.png and b/game/themes/common/[icon]song_medley.png differ diff --git a/game/themes/common/[icon]song_menu.png b/game/themes/common/[icon]song_menu.png index fd0ccb93..e4735178 100644 Binary files a/game/themes/common/[icon]song_menu.png and b/game/themes/common/[icon]song_menu.png differ diff --git a/game/themes/common/[icon]song_rap.png b/game/themes/common/[icon]song_rap.png index 4ca3a260..80f07543 100644 Binary files a/game/themes/common/[icon]song_rap.png and b/game/themes/common/[icon]song_rap.png differ diff --git a/game/themes/common/[icon]song_search.png b/game/themes/common/[icon]song_search.png index 3a7a7322..3e7c7133 100644 Binary files a/game/themes/common/[icon]song_search.png and b/game/themes/common/[icon]song_search.png differ diff --git a/game/themes/common/[icon]song_unvalidated.png b/game/themes/common/[icon]song_unvalidated.png new file mode 100644 index 00000000..fb01dcab Binary files /dev/null and b/game/themes/common/[icon]song_unvalidated.png differ diff --git a/game/themes/common/[icon]song_video.png b/game/themes/common/[icon]song_video.png index bd72ceb2..c18a2cb0 100644 Binary files a/game/themes/common/[icon]song_video.png and b/game/themes/common/[icon]song_video.png differ diff --git a/game/themes/common/[interface]cursor.png b/game/themes/common/[interface]cursor.png index c648973f..75994396 100644 Binary files a/game/themes/common/[interface]cursor.png and b/game/themes/common/[interface]cursor.png differ diff --git a/game/themes/common/[interface]cursor_pressed.png b/game/themes/common/[interface]cursor_pressed.png index e706e3be..6592617b 100644 Binary files a/game/themes/common/[interface]cursor_pressed.png and b/game/themes/common/[interface]cursor_pressed.png differ diff --git a/game/themes/common/[interface]dialog_background.png b/game/themes/common/[interface]dialog_background.png index 188f3d1d..452da517 100644 Binary files a/game/themes/common/[interface]dialog_background.png and b/game/themes/common/[interface]dialog_background.png differ diff --git a/game/themes/common/[interface]dialog_background2.png b/game/themes/common/[interface]dialog_background2.png index 18b9157f..3470a44c 100644 Binary files a/game/themes/common/[interface]dialog_background2.png and b/game/themes/common/[interface]dialog_background2.png differ diff --git a/game/themes/common/[interface]dialog_backgroundtop.png b/game/themes/common/[interface]dialog_backgroundtop.png index d7d7b409..69f1c3aa 100644 Binary files a/game/themes/common/[interface]dialog_backgroundtop.png and b/game/themes/common/[interface]dialog_backgroundtop.png differ diff --git a/game/themes/common/[interface]select_arrow_left.png b/game/themes/common/[interface]select_arrow_left.png index eb62e8b2..b5a8f85f 100644 Binary files a/game/themes/common/[interface]select_arrow_left.png and b/game/themes/common/[interface]select_arrow_left.png differ diff --git a/game/themes/common/[interface]select_arrow_right.png b/game/themes/common/[interface]select_arrow_right.png index cce260b0..7ddbe088 100644 Binary files a/game/themes/common/[interface]select_arrow_right.png and b/game/themes/common/[interface]select_arrow_right.png differ diff --git a/game/themes/common/[interface]selectbg_search.png b/game/themes/common/[interface]selectbg_search.png index 04a4854f..6081ad53 100644 Binary files a/game/themes/common/[interface]selectbg_search.png and b/game/themes/common/[interface]selectbg_search.png differ diff --git a/game/themes/common/[jukebox]bartop.png b/game/themes/common/[jukebox]bartop.png index 7ef2a9a3..0e1f0741 100644 Binary files a/game/themes/common/[jukebox]bartop.png and b/game/themes/common/[jukebox]bartop.png differ diff --git a/game/themes/common/[jukebox]close.png b/game/themes/common/[jukebox]close.png index 447ab1fb..1f24f328 100644 Binary files a/game/themes/common/[jukebox]close.png and b/game/themes/common/[jukebox]close.png differ diff --git a/game/themes/common/[jukebox]currentsong.png b/game/themes/common/[jukebox]currentsong.png index 074ed29f..08af0b1b 100644 Binary files a/game/themes/common/[jukebox]currentsong.png and b/game/themes/common/[jukebox]currentsong.png differ diff --git a/game/themes/common/[jukebox]lyric.png b/game/themes/common/[jukebox]lyric.png index cda4296f..580a4849 100644 Binary files a/game/themes/common/[jukebox]lyric.png and b/game/themes/common/[jukebox]lyric.png differ diff --git a/game/themes/common/[jukebox]options.png b/game/themes/common/[jukebox]options.png index e28f424f..84f40f62 100644 Binary files a/game/themes/common/[jukebox]options.png and b/game/themes/common/[jukebox]options.png differ diff --git a/game/themes/common/[jukebox]pin.png b/game/themes/common/[jukebox]pin.png index 49aa1a45..eb4dd4d2 100644 Binary files a/game/themes/common/[jukebox]pin.png and b/game/themes/common/[jukebox]pin.png differ diff --git a/game/themes/common/[jukebox]random.png b/game/themes/common/[jukebox]random.png index d1705215..d54cdf7d 100644 Binary files a/game/themes/common/[jukebox]random.png and b/game/themes/common/[jukebox]random.png differ diff --git a/game/themes/common/[jukebox]repeat.png b/game/themes/common/[jukebox]repeat.png index a99eac5a..f2017bab 100644 Binary files a/game/themes/common/[jukebox]repeat.png and b/game/themes/common/[jukebox]repeat.png differ diff --git a/game/themes/common/[jukebox]songlist.png b/game/themes/common/[jukebox]songlist.png index 8a78179f..6659f1bb 100644 Binary files a/game/themes/common/[jukebox]songlist.png and b/game/themes/common/[jukebox]songlist.png differ diff --git a/game/themes/common/[jukebox]songlistdown.png b/game/themes/common/[jukebox]songlistdown.png index fde877de..263a768d 100644 Binary files a/game/themes/common/[jukebox]songlistdown.png and b/game/themes/common/[jukebox]songlistdown.png differ diff --git a/game/themes/common/[jukebox]songlistup.png b/game/themes/common/[jukebox]songlistup.png index 2ce68bd5..9f21905f 100644 Binary files a/game/themes/common/[jukebox]songlistup.png and b/game/themes/common/[jukebox]songlistup.png differ diff --git a/game/themes/common/[jukebox]songmenunext.png b/game/themes/common/[jukebox]songmenunext.png index 3d2faa52..8ad5357c 100644 Binary files a/game/themes/common/[jukebox]songmenunext.png and b/game/themes/common/[jukebox]songmenunext.png differ diff --git a/game/themes/common/[jukebox]songmenuplaylist.png b/game/themes/common/[jukebox]songmenuplaylist.png index 743e6523..17a6fcc3 100644 Binary files a/game/themes/common/[jukebox]songmenuplaylist.png and b/game/themes/common/[jukebox]songmenuplaylist.png differ diff --git a/game/themes/common/[jukebox]songmenuplaypause.png b/game/themes/common/[jukebox]songmenuplaypause.png index 1639122b..ec71dff3 100644 Binary files a/game/themes/common/[jukebox]songmenuplaypause.png and b/game/themes/common/[jukebox]songmenuplaypause.png differ diff --git a/game/themes/common/[jukebox]songmenuprevious.png b/game/themes/common/[jukebox]songmenuprevious.png index e971709d..c3685c85 100644 Binary files a/game/themes/common/[jukebox]songmenuprevious.png and b/game/themes/common/[jukebox]songmenuprevious.png differ diff --git a/game/themes/common/[jukebox]songoptions.png b/game/themes/common/[jukebox]songoptions.png index 2580617c..b4c41028 100644 Binary files a/game/themes/common/[jukebox]songoptions.png and b/game/themes/common/[jukebox]songoptions.png differ diff --git a/game/themes/common/[jukebox]songselection.png b/game/themes/common/[jukebox]songselection.png index b88ecaf8..0d9e09af 100644 Binary files a/game/themes/common/[jukebox]songselection.png and b/game/themes/common/[jukebox]songselection.png differ diff --git a/game/themes/common/[jukebox]timeBar.jpg b/game/themes/common/[jukebox]timeBar.jpg index cc5cb552..d71f2e0c 100644 Binary files a/game/themes/common/[jukebox]timeBar.jpg and b/game/themes/common/[jukebox]timeBar.jpg differ diff --git a/game/themes/common/[jukebox]timeBarBG.png b/game/themes/common/[jukebox]timeBarBG.png index c4446c70..582f7667 100644 Binary files a/game/themes/common/[jukebox]timeBarBG.png and b/game/themes/common/[jukebox]timeBarBG.png differ diff --git a/game/themes/common/[jukebox]timeBarSongMenuBG.png b/game/themes/common/[jukebox]timeBarSongMenuBG.png index 78347963..5e17b78c 100644 Binary files a/game/themes/common/[jukebox]timeBarSongMenuBG.png and b/game/themes/common/[jukebox]timeBarSongMenuBG.png differ diff --git a/game/themes/common/[jukebox]title.png b/game/themes/common/[jukebox]title.png index 13526ec4..18dd0819 100644 Binary files a/game/themes/common/[jukebox]title.png and b/game/themes/common/[jukebox]title.png differ diff --git a/game/themes/common/[main]button.png b/game/themes/common/[main]button.png index 07457576..30cc59b6 100644 Binary files a/game/themes/common/[main]button.png and b/game/themes/common/[main]button.png differ diff --git a/game/themes/common/[main]button2.png b/game/themes/common/[main]button2.png index 8a722346..050cf7da 100644 Binary files a/game/themes/common/[main]button2.png and b/game/themes/common/[main]button2.png differ diff --git a/game/themes/common/[main]buttonabout.png b/game/themes/common/[main]buttonabout.png index 8671d32b..f891ff3f 100644 Binary files a/game/themes/common/[main]buttonabout.png and b/game/themes/common/[main]buttonabout.png differ diff --git a/game/themes/common/[main]buttonexit.png b/game/themes/common/[main]buttonexit.png index 65d13401..7551545c 100644 Binary files a/game/themes/common/[main]buttonexit.png and b/game/themes/common/[main]buttonexit.png differ diff --git a/game/themes/common/[main]buttonf.jpg b/game/themes/common/[main]buttonf.jpg index d844add5..4a89c9d5 100644 Binary files a/game/themes/common/[main]buttonf.jpg and b/game/themes/common/[main]buttonf.jpg differ diff --git a/game/themes/common/[main]buttonjukebox.png b/game/themes/common/[main]buttonjukebox.png index 8b8cd3ff..ec852bea 100644 Binary files a/game/themes/common/[main]buttonjukebox.png and b/game/themes/common/[main]buttonjukebox.png differ diff --git a/game/themes/common/[main]buttonoption.png b/game/themes/common/[main]buttonoption.png index e3843311..9eda5eb7 100644 Binary files a/game/themes/common/[main]buttonoption.png and b/game/themes/common/[main]buttonoption.png differ diff --git a/game/themes/common/[main]buttonparty.png b/game/themes/common/[main]buttonparty.png index 74409d3e..392a4768 100644 Binary files a/game/themes/common/[main]buttonparty.png and b/game/themes/common/[main]buttonparty.png differ diff --git a/game/themes/common/[main]buttonsolo.png b/game/themes/common/[main]buttonsolo.png index 941cebf8..e41aeeb2 100644 Binary files a/game/themes/common/[main]buttonsolo.png and b/game/themes/common/[main]buttonsolo.png differ diff --git a/game/themes/common/[main]buttonstats.png b/game/themes/common/[main]buttonstats.png index b5ef5b61..a633db4f 100644 Binary files a/game/themes/common/[main]buttonstats.png and b/game/themes/common/[main]buttonstats.png differ diff --git a/game/themes/common/[main]mainBar.png b/game/themes/common/[main]mainBar.png index 07457576..406ed69f 100644 Binary files a/game/themes/common/[main]mainBar.png and b/game/themes/common/[main]mainBar.png differ diff --git a/game/themes/common/[main]playerNumberBox.png b/game/themes/common/[main]playerNumberBox.png index bf78a816..f47a4596 100644 Binary files a/game/themes/common/[main]playerNumberBox.png and b/game/themes/common/[main]playerNumberBox.png differ diff --git a/game/themes/common/[main]selectbg.png b/game/themes/common/[main]selectbg.png index 2815e108..8a7cdd37 100644 Binary files a/game/themes/common/[main]selectbg.png and b/game/themes/common/[main]selectbg.png differ diff --git a/game/themes/common/[main]songSelection1.png b/game/themes/common/[main]songSelection1.png index 7b3e7926..349f2a57 100644 Binary files a/game/themes/common/[main]songSelection1.png and b/game/themes/common/[main]songSelection1.png differ diff --git a/game/themes/common/[main]songSelection1dn.png b/game/themes/common/[main]songSelection1dn.png index 096574ae..51911c87 100644 Binary files a/game/themes/common/[main]songSelection1dn.png and b/game/themes/common/[main]songSelection1dn.png differ diff --git a/game/themes/common/[main]songSelection1up.png b/game/themes/common/[main]songSelection1up.png index 324a5a26..882a9623 100644 Binary files a/game/themes/common/[main]songSelection1up.png and b/game/themes/common/[main]songSelection1up.png differ diff --git a/game/themes/common/[main]songSelection2.png b/game/themes/common/[main]songSelection2.png index 8ee7f4b1..d9315c4f 100644 Binary files a/game/themes/common/[main]songSelection2.png and b/game/themes/common/[main]songSelection2.png differ diff --git a/game/themes/common/[main]songSelection3.png b/game/themes/common/[main]songSelection3.png index 77747504..c1788ea6 100644 Binary files a/game/themes/common/[main]songSelection3.png and b/game/themes/common/[main]songSelection3.png differ diff --git a/game/themes/common/[main]songSelection4.png b/game/themes/common/[main]songSelection4.png index 9c6cbaa4..52f53b05 100644 Binary files a/game/themes/common/[main]songSelection4.png and b/game/themes/common/[main]songSelection4.png differ diff --git a/game/themes/common/[main]songSelection5.png b/game/themes/common/[main]songSelection5.png index 87d0b3c7..cf962ee3 100644 Binary files a/game/themes/common/[main]songSelection5.png and b/game/themes/common/[main]songSelection5.png differ diff --git a/game/themes/common/[menu]bg.png b/game/themes/common/[menu]bg.png new file mode 100644 index 00000000..463d3f60 Binary files /dev/null and b/game/themes/common/[menu]bg.png differ diff --git a/game/themes/common/[menu]songMenuBg.png b/game/themes/common/[menu]songMenuBg.png index 0309b3e0..249ab82a 100644 Binary files a/game/themes/common/[menu]songMenuBg.png and b/game/themes/common/[menu]songMenuBg.png differ diff --git a/game/themes/common/[menu]songMenuSelectBg.png b/game/themes/common/[menu]songMenuSelectBg.png index 8ff5eef8..556f0b0d 100644 Binary files a/game/themes/common/[menu]songMenuSelectBg.png and b/game/themes/common/[menu]songMenuSelectBg.png differ diff --git a/game/themes/common/[name]frame.png b/game/themes/common/[name]frame.png index ed05e2be..361d55ea 100644 Binary files a/game/themes/common/[name]frame.png and b/game/themes/common/[name]frame.png differ diff --git a/game/themes/common/[name]noavatar.png b/game/themes/common/[name]noavatar.png index 2a7801d9..f967278b 100644 Binary files a/game/themes/common/[name]noavatar.png and b/game/themes/common/[name]noavatar.png differ diff --git a/game/themes/common/[name]player.png b/game/themes/common/[name]player.png index 9d99b991..75795783 100644 Binary files a/game/themes/common/[name]player.png and b/game/themes/common/[name]player.png differ diff --git a/game/themes/common/[name]select.png b/game/themes/common/[name]select.png index 74baa9f2..8080acca 100644 Binary files a/game/themes/common/[name]select.png and b/game/themes/common/[name]select.png differ diff --git a/game/themes/common/[party]Joker.png b/game/themes/common/[party]Joker.png index 605e49c9..5dfe4875 100644 Binary files a/game/themes/common/[party]Joker.png and b/game/themes/common/[party]Joker.png differ diff --git a/game/themes/common/[party]playerButton.png b/game/themes/common/[party]playerButton.png index 7d05462d..9a2430e3 100644 Binary files a/game/themes/common/[party]playerButton.png and b/game/themes/common/[party]playerButton.png differ diff --git a/game/themes/common/[party]playerTeamButton.png b/game/themes/common/[party]playerTeamButton.png index aa3ace9c..50be0c70 100644 Binary files a/game/themes/common/[party]playerTeamButton.png and b/game/themes/common/[party]playerTeamButton.png differ diff --git a/game/themes/common/[party]playerselectbg.png b/game/themes/common/[party]playerselectbg.png index 3f5a0c2e..33587502 100644 Binary files a/game/themes/common/[party]playerselectbg.png and b/game/themes/common/[party]playerselectbg.png differ diff --git a/game/themes/common/[party]pointer.png b/game/themes/common/[party]pointer.png index 2292d6c1..a700ec88 100644 Binary files a/game/themes/common/[party]pointer.png and b/game/themes/common/[party]pointer.png differ diff --git a/game/themes/common/[party]roundBG1.png b/game/themes/common/[party]roundBG1.png index 64df6329..694ee47c 100644 Binary files a/game/themes/common/[party]roundBG1.png and b/game/themes/common/[party]roundBG1.png differ diff --git a/game/themes/common/[party]roundBG2.png b/game/themes/common/[party]roundBG2.png index a2780e2f..3922f750 100644 Binary files a/game/themes/common/[party]roundBG2.png and b/game/themes/common/[party]roundBG2.png differ diff --git a/game/themes/common/[party]roundBG3.png b/game/themes/common/[party]roundBG3.png index 7a1d02d9..f5d89329 100644 Binary files a/game/themes/common/[party]roundBG3.png and b/game/themes/common/[party]roundBG3.png differ diff --git a/game/themes/common/[party]roundBG4.png b/game/themes/common/[party]roundBG4.png index 81ccfd8e..e9a41e9b 100644 Binary files a/game/themes/common/[party]roundBG4.png and b/game/themes/common/[party]roundBG4.png differ diff --git a/game/themes/common/[party]roundTeamButton.png b/game/themes/common/[party]roundTeamButton.png index c70d7b62..55b603d2 100644 Binary files a/game/themes/common/[party]roundTeamButton.png and b/game/themes/common/[party]roundTeamButton.png differ diff --git a/game/themes/common/[party]scoreBG1.png b/game/themes/common/[party]scoreBG1.png index 28496bcf..6196cc60 100644 Binary files a/game/themes/common/[party]scoreBG1.png and b/game/themes/common/[party]scoreBG1.png differ diff --git a/game/themes/common/[party]scoreBG2.png b/game/themes/common/[party]scoreBG2.png index e6417915..5b2aa83e 100644 Binary files a/game/themes/common/[party]scoreBG2.png and b/game/themes/common/[party]scoreBG2.png differ diff --git a/game/themes/common/[party]scoreDecoration.png b/game/themes/common/[party]scoreDecoration.png index 4d820510..0e4f47f5 100644 Binary files a/game/themes/common/[party]scoreDecoration.png and b/game/themes/common/[party]scoreDecoration.png differ diff --git a/game/themes/common/[party]teamPoints.png b/game/themes/common/[party]teamPoints.png index 446c4421..707c9d92 100644 Binary files a/game/themes/common/[party]teamPoints.png and b/game/themes/common/[party]teamPoints.png differ diff --git a/game/themes/common/[party]winDecoration.png b/game/themes/common/[party]winDecoration.png index e3506eea..d0179f98 100644 Binary files a/game/themes/common/[party]winDecoration.png and b/game/themes/common/[party]winDecoration.png differ diff --git a/game/themes/common/[party]winTeamButton1.png b/game/themes/common/[party]winTeamButton1.png index 11042481..4c2e0c52 100644 Binary files a/game/themes/common/[party]winTeamButton1.png and b/game/themes/common/[party]winTeamButton1.png differ diff --git a/game/themes/common/[party]winTeamButton2.png b/game/themes/common/[party]winTeamButton2.png index 3b2650f7..f12576d2 100644 Binary files a/game/themes/common/[party]winTeamButton2.png and b/game/themes/common/[party]winTeamButton2.png differ diff --git a/game/themes/common/[party]winTeamButton3.png b/game/themes/common/[party]winTeamButton3.png index 10c1977f..092da09d 100644 Binary files a/game/themes/common/[party]winTeamButton3.png and b/game/themes/common/[party]winTeamButton3.png differ diff --git a/game/themes/common/[rap]notesBgLeft.png b/game/themes/common/[rap]notesBgLeft.png index a69be6eb..16822236 100644 Binary files a/game/themes/common/[rap]notesBgLeft.png and b/game/themes/common/[rap]notesBgLeft.png differ diff --git a/game/themes/common/[rap]notesBgMid.png b/game/themes/common/[rap]notesBgMid.png index b76c94f8..b69864ff 100644 Binary files a/game/themes/common/[rap]notesBgMid.png and b/game/themes/common/[rap]notesBgMid.png differ diff --git a/game/themes/common/[rap]notesBgRight.png b/game/themes/common/[rap]notesBgRight.png index a680f3cb..d9311c0d 100644 Binary files a/game/themes/common/[rap]notesBgRight.png and b/game/themes/common/[rap]notesBgRight.png differ diff --git a/game/themes/common/[rap]notesLeft.png b/game/themes/common/[rap]notesLeft.png index afa165d4..10d14202 100644 Binary files a/game/themes/common/[rap]notesLeft.png and b/game/themes/common/[rap]notesLeft.png differ diff --git a/game/themes/common/[rap]notesMid.png b/game/themes/common/[rap]notesMid.png index e5aac4e6..7dd2bc67 100644 Binary files a/game/themes/common/[rap]notesMid.png and b/game/themes/common/[rap]notesMid.png differ diff --git a/game/themes/common/[rap]notesPlainLeft.png b/game/themes/common/[rap]notesPlainLeft.png index fa9112b5..4f1f2989 100644 Binary files a/game/themes/common/[rap]notesPlainLeft.png and b/game/themes/common/[rap]notesPlainLeft.png differ diff --git a/game/themes/common/[rap]notesPlainMid.png b/game/themes/common/[rap]notesPlainMid.png index 82f27410..ac59a4c0 100644 Binary files a/game/themes/common/[rap]notesPlainMid.png and b/game/themes/common/[rap]notesPlainMid.png differ diff --git a/game/themes/common/[rap]notesPlainRight.png b/game/themes/common/[rap]notesPlainRight.png index 01793d97..6cddb47c 100644 Binary files a/game/themes/common/[rap]notesPlainRight.png and b/game/themes/common/[rap]notesPlainRight.png differ diff --git a/game/themes/common/[rap]notesRight.png b/game/themes/common/[rap]notesRight.png index d22ba6ba..daed44c3 100644 Binary files a/game/themes/common/[rap]notesRight.png and b/game/themes/common/[rap]notesRight.png differ diff --git a/game/themes/common/[score]bar_box_dark.png b/game/themes/common/[score]bar_box_dark.png index 48c18d64..9ee35cbb 100644 Binary files a/game/themes/common/[score]bar_box_dark.png and b/game/themes/common/[score]bar_box_dark.png differ diff --git a/game/themes/common/[score]bar_box_light.png b/game/themes/common/[score]bar_box_light.png index 86d6e5ea..6ad612a3 100644 Binary files a/game/themes/common/[score]bar_box_light.png and b/game/themes/common/[score]bar_box_light.png differ diff --git a/game/themes/common/[score]bar_box_lightest.png b/game/themes/common/[score]bar_box_lightest.png index 21182649..cbfa6da0 100644 Binary files a/game/themes/common/[score]bar_box_lightest.png and b/game/themes/common/[score]bar_box_lightest.png differ diff --git a/game/themes/common/[score]box.png b/game/themes/common/[score]box.png index 71a0cee6..68f49962 100644 Binary files a/game/themes/common/[score]box.png and b/game/themes/common/[score]box.png differ diff --git a/game/themes/common/[score]buttonsendscore.png b/game/themes/common/[score]buttonsendscore.png index 789edbfb..9e671037 100644 Binary files a/game/themes/common/[score]buttonsendscore.png and b/game/themes/common/[score]buttonsendscore.png differ diff --git a/game/themes/common/[score]endcap.png b/game/themes/common/[score]endcap.png index b20eb000..350b3134 100644 Binary files a/game/themes/common/[score]endcap.png and b/game/themes/common/[score]endcap.png differ diff --git a/game/themes/common/[score]frame.png b/game/themes/common/[score]frame.png index ca324de4..552a35a3 100644 Binary files a/game/themes/common/[score]frame.png and b/game/themes/common/[score]frame.png differ diff --git a/game/themes/common/[score]glass_box.png b/game/themes/common/[score]glass_box.png index c0cf2a9c..5b2dfaa5 100644 Binary files a/game/themes/common/[score]glass_box.png and b/game/themes/common/[score]glass_box.png differ diff --git a/game/themes/common/[score]level.png b/game/themes/common/[score]level.png index 1f627560..c8b0beea 100644 Binary files a/game/themes/common/[score]level.png and b/game/themes/common/[score]level.png differ diff --git a/game/themes/common/[score]levelRound.png b/game/themes/common/[score]levelRound.png index 2bc7a6b8..219ab858 100644 Binary files a/game/themes/common/[score]levelRound.png and b/game/themes/common/[score]levelRound.png differ diff --git a/game/themes/common/[score]level_dark.png b/game/themes/common/[score]level_dark.png index da4fd407..34fc2128 100644 Binary files a/game/themes/common/[score]level_dark.png and b/game/themes/common/[score]level_dark.png differ diff --git a/game/themes/common/[score]level_dark_round.png b/game/themes/common/[score]level_dark_round.png index de239cb2..50781c97 100644 Binary files a/game/themes/common/[score]level_dark_round.png and b/game/themes/common/[score]level_dark_round.png differ diff --git a/game/themes/common/[score]level_light.png b/game/themes/common/[score]level_light.png index 1c1c8a4d..2c742aab 100644 Binary files a/game/themes/common/[score]level_light.png and b/game/themes/common/[score]level_light.png differ diff --git a/game/themes/common/[score]level_light_round.png b/game/themes/common/[score]level_light_round.png index 641151a5..2e7ae2e0 100644 Binary files a/game/themes/common/[score]level_light_round.png and b/game/themes/common/[score]level_light_round.png differ diff --git a/game/themes/common/[score]level_lightest.png b/game/themes/common/[score]level_lightest.png index f02fdf7b..d9508f53 100644 Binary files a/game/themes/common/[score]level_lightest.png and b/game/themes/common/[score]level_lightest.png differ diff --git a/game/themes/common/[score]level_lightest_round.png b/game/themes/common/[score]level_lightest_round.png index 9f1bb09e..d8984e1c 100644 Binary files a/game/themes/common/[score]level_lightest_round.png and b/game/themes/common/[score]level_lightest_round.png differ diff --git a/game/themes/common/[score]line.png b/game/themes/common/[score]line.png index 954caf94..5fbcbf69 100644 Binary files a/game/themes/common/[score]line.png and b/game/themes/common/[score]line.png differ diff --git a/game/themes/common/[score]rating_0.png b/game/themes/common/[score]rating_0.png index ce32746f..7d64be4d 100644 Binary files a/game/themes/common/[score]rating_0.png and b/game/themes/common/[score]rating_0.png differ diff --git a/game/themes/common/[score]rating_1.png b/game/themes/common/[score]rating_1.png index eb188371..a7f44d74 100644 Binary files a/game/themes/common/[score]rating_1.png and b/game/themes/common/[score]rating_1.png differ diff --git a/game/themes/common/[score]rating_2.png b/game/themes/common/[score]rating_2.png index 51489a15..af10a898 100644 Binary files a/game/themes/common/[score]rating_2.png and b/game/themes/common/[score]rating_2.png differ diff --git a/game/themes/common/[score]rating_3.png b/game/themes/common/[score]rating_3.png index 48fc5348..de0cb68e 100644 Binary files a/game/themes/common/[score]rating_3.png and b/game/themes/common/[score]rating_3.png differ diff --git a/game/themes/common/[score]rating_4.png b/game/themes/common/[score]rating_4.png index 738437d5..f747476b 100644 Binary files a/game/themes/common/[score]rating_4.png and b/game/themes/common/[score]rating_4.png differ diff --git a/game/themes/common/[score]rating_5.png b/game/themes/common/[score]rating_5.png index 74352524..177a3fa5 100644 Binary files a/game/themes/common/[score]rating_5.png and b/game/themes/common/[score]rating_5.png differ diff --git a/game/themes/common/[score]rating_6.png b/game/themes/common/[score]rating_6.png index b80563c8..5e99bb0c 100644 Binary files a/game/themes/common/[score]rating_6.png and b/game/themes/common/[score]rating_6.png differ diff --git a/game/themes/common/[score]rating_7.png b/game/themes/common/[score]rating_7.png index c8ba1131..9ba1cf83 100644 Binary files a/game/themes/common/[score]rating_7.png and b/game/themes/common/[score]rating_7.png differ diff --git a/game/themes/common/[sing]LyricsBall.png b/game/themes/common/[sing]LyricsBall.png index d09b128a..132935f3 100644 Binary files a/game/themes/common/[sing]LyricsBall.png and b/game/themes/common/[sing]LyricsBall.png differ diff --git a/game/themes/common/[sing]SongName.png b/game/themes/common/[sing]SongName.png index 530fed3f..f3f9853f 100644 Binary files a/game/themes/common/[sing]SongName.png and b/game/themes/common/[sing]SongName.png differ diff --git a/game/themes/common/[sing]lineBonusPopUp.png b/game/themes/common/[sing]lineBonusPopUp.png index 1f204c89..3c4128d1 100644 Binary files a/game/themes/common/[sing]lineBonusPopUp.png and b/game/themes/common/[sing]lineBonusPopUp.png differ diff --git a/game/themes/common/[sing]lyricsHelpBar.png b/game/themes/common/[sing]lyricsHelpBar.png index 420190b7..7a05cdb7 100644 Binary files a/game/themes/common/[sing]lyricsHelpBar.png and b/game/themes/common/[sing]lyricsHelpBar.png differ diff --git a/game/themes/common/[sing]notesBgLeft.png b/game/themes/common/[sing]notesBgLeft.png index 1e015fc6..4e3ae6f2 100644 Binary files a/game/themes/common/[sing]notesBgLeft.png and b/game/themes/common/[sing]notesBgLeft.png differ diff --git a/game/themes/common/[sing]notesBgMid.png b/game/themes/common/[sing]notesBgMid.png index 6d938a80..1ed6c49d 100644 Binary files a/game/themes/common/[sing]notesBgMid.png and b/game/themes/common/[sing]notesBgMid.png differ diff --git a/game/themes/common/[sing]notesBgRight.png b/game/themes/common/[sing]notesBgRight.png index d8041688..d2262ea6 100644 Binary files a/game/themes/common/[sing]notesBgRight.png and b/game/themes/common/[sing]notesBgRight.png differ diff --git a/game/themes/common/[sing]notesLeft.png b/game/themes/common/[sing]notesLeft.png index 670afd8b..9853ed8f 100644 Binary files a/game/themes/common/[sing]notesLeft.png and b/game/themes/common/[sing]notesLeft.png differ diff --git a/game/themes/common/[sing]notesMid.png b/game/themes/common/[sing]notesMid.png index 439657be..6bcf39f9 100644 Binary files a/game/themes/common/[sing]notesMid.png and b/game/themes/common/[sing]notesMid.png differ diff --git a/game/themes/common/[sing]notesPlainLeft.png b/game/themes/common/[sing]notesPlainLeft.png index 7c7a5c02..18e53d29 100644 Binary files a/game/themes/common/[sing]notesPlainLeft.png and b/game/themes/common/[sing]notesPlainLeft.png differ diff --git a/game/themes/common/[sing]notesPlainMid.png b/game/themes/common/[sing]notesPlainMid.png index 2bf70fb7..ba1d5533 100644 Binary files a/game/themes/common/[sing]notesPlainMid.png and b/game/themes/common/[sing]notesPlainMid.png differ diff --git a/game/themes/common/[sing]notesPlainRight.png b/game/themes/common/[sing]notesPlainRight.png index d35abe2b..78a72385 100644 Binary files a/game/themes/common/[sing]notesPlainRight.png and b/game/themes/common/[sing]notesPlainRight.png differ diff --git a/game/themes/common/[sing]notesRight.png b/game/themes/common/[sing]notesRight.png index 8ab6995a..88980fd3 100644 Binary files a/game/themes/common/[sing]notesRight.png and b/game/themes/common/[sing]notesRight.png differ diff --git a/game/themes/common/[sing]p.png b/game/themes/common/[sing]p.png index db8dec4d..2b10fa45 100644 Binary files a/game/themes/common/[sing]p.png and b/game/themes/common/[sing]p.png differ diff --git a/game/themes/common/[sing]pause.png b/game/themes/common/[sing]pause.png index 288c0997..91e3085d 100644 Binary files a/game/themes/common/[sing]pause.png and b/game/themes/common/[sing]pause.png differ diff --git a/game/themes/common/[sing]scoreBg.jpg b/game/themes/common/[sing]scoreBg.jpg index 4a4459f6..95797302 100644 Binary files a/game/themes/common/[sing]scoreBg.jpg and b/game/themes/common/[sing]scoreBg.jpg differ diff --git a/game/themes/common/[sing]scoreBg.png b/game/themes/common/[sing]scoreBg.png index e15412d5..93377b42 100644 Binary files a/game/themes/common/[sing]scoreBg.png and b/game/themes/common/[sing]scoreBg.png differ diff --git a/game/themes/common/[sing]singBarBack.png b/game/themes/common/[sing]singBarBack.png index 14d2ba42..52c6676a 100644 Binary files a/game/themes/common/[sing]singBarBack.png and b/game/themes/common/[sing]singBarBack.png differ diff --git a/game/themes/common/[sing]singBarBar.jpg b/game/themes/common/[sing]singBarBar.jpg index 4fd9bde9..4b424243 100644 Binary files a/game/themes/common/[sing]singBarBar.jpg and b/game/themes/common/[sing]singBarBar.jpg differ diff --git a/game/themes/common/[sing]singBarBar.png b/game/themes/common/[sing]singBarBar.png index 9c57057b..02aa731d 100644 Binary files a/game/themes/common/[sing]singBarBar.png and b/game/themes/common/[sing]singBarBar.png differ diff --git a/game/themes/common/[sing]singBarFront.png b/game/themes/common/[sing]singBarFront.png index 42477c5a..f20ad5f4 100644 Binary files a/game/themes/common/[sing]singBarFront.png and b/game/themes/common/[sing]singBarFront.png differ diff --git a/game/themes/common/[sing]textBar.png b/game/themes/common/[sing]textBar.png index 9fe4e26c..1d974df0 100644 Binary files a/game/themes/common/[sing]textBar.png and b/game/themes/common/[sing]textBar.png differ diff --git a/game/themes/common/[sing]textBarDuet.png b/game/themes/common/[sing]textBarDuet.png index 43963d4e..a1ab4eda 100644 Binary files a/game/themes/common/[sing]textBarDuet.png and b/game/themes/common/[sing]textBarDuet.png differ diff --git a/game/themes/common/[sing]timeBar.jpg b/game/themes/common/[sing]timeBar.jpg index cc5cb552..d71f2e0c 100644 Binary files a/game/themes/common/[sing]timeBar.jpg and b/game/themes/common/[sing]timeBar.jpg differ diff --git a/game/themes/common/[sing]timeBarBG.png b/game/themes/common/[sing]timeBarBG.png index 6014fd75..5a8c1b08 100644 Binary files a/game/themes/common/[sing]timeBarBG.png and b/game/themes/common/[sing]timeBarBG.png differ diff --git a/game/themes/common/[sing]timeBarBG2.png b/game/themes/common/[sing]timeBarBG2.png index 1b8b255f..55787c92 100644 Binary files a/game/themes/common/[sing]timeBarBG2.png and b/game/themes/common/[sing]timeBarBG2.png differ diff --git a/game/themes/common/[song]duetsinger.png b/game/themes/common/[song]duetsinger.png index aa3ace9c..19c49d00 100644 Binary files a/game/themes/common/[song]duetsinger.png and b/game/themes/common/[song]duetsinger.png differ diff --git a/game/themes/common/[song]duetsinger2.png b/game/themes/common/[song]duetsinger2.png index 0d0ea023..1c5d4610 100644 Binary files a/game/themes/common/[song]duetsinger2.png and b/game/themes/common/[song]duetsinger2.png differ diff --git a/game/themes/common/[song]duetsinger3.png b/game/themes/common/[song]duetsinger3.png index bb931c2a..c7f170cf 100644 Binary files a/game/themes/common/[song]duetsinger3.png and b/game/themes/common/[song]duetsinger3.png differ diff --git a/game/themes/common/[song]message.png b/game/themes/common/[song]message.png index 077b93e8..8d6757d2 100644 Binary files a/game/themes/common/[song]message.png and b/game/themes/common/[song]message.png differ diff --git a/game/themes/common/[special]bg_fade.png b/game/themes/common/[special]bg_fade.png index dc3248ef..e7113458 100644 Binary files a/game/themes/common/[special]bg_fade.png and b/game/themes/common/[special]bg_fade.png differ diff --git a/game/themes/common/[stat]InfoBG1.png b/game/themes/common/[stat]InfoBG1.png index 533e6d75..0fcd70d0 100644 Binary files a/game/themes/common/[stat]InfoBG1.png and b/game/themes/common/[stat]InfoBG1.png differ diff --git a/game/themes/common/[stat]InfoBG2.png b/game/themes/common/[stat]InfoBG2.png index 48f19570..49db74c2 100644 Binary files a/game/themes/common/[stat]InfoBG2.png and b/game/themes/common/[stat]InfoBG2.png differ diff --git a/game/themes/common/[tournament]trophy.png b/game/themes/common/[tournament]trophy.png index bc8b22d4..61a9aaee 100644 Binary files a/game/themes/common/[tournament]trophy.png and b/game/themes/common/[tournament]trophy.png differ diff --git a/game/themes/common/[tournament]winner.png b/game/themes/common/[tournament]winner.png index 053fd06b..9aee18ec 100644 Binary files a/game/themes/common/[tournament]winner.png and b/game/themes/common/[tournament]winner.png differ diff --git a/game/zlib1.dll b/game/zlib1.dll index 68a8bf7a..3a45deb5 100644 Binary files a/game/zlib1.dll and b/game/zlib1.dll differ diff --git a/install b/install index 771d1050..b38d6e16 100755 --- a/install +++ b/install @@ -1,4 +1,4 @@ -sudo apt-get update && sudo apt-get install automake autoconf make gcc fpc libsdl2-image-dev libavformat-dev libswscale-dev libsqlite3-dev libfreetype6-dev portaudio19-dev libportmidi-dev liblua5.3-dev libopencv-highgui-dev +sudo apt-get update && sudo apt-get install automake autoconf make gcc fpc libsdl2-image-dev libavformat-dev libswscale-dev libsqlite3-dev libfreetype6-dev libportmidi-dev liblua5.3-dev libopencv-highgui-dev ./autogen.sh ./configure make diff --git a/src/WorldParty for Windows.lpi b/src/WorldParty for Windows.lpi index 650d48b1..5e7045e7 100644 --- a/src/WorldParty for Windows.lpi +++ b/src/WorldParty for Windows.lpi @@ -266,7 +266,7 @@ - + diff --git a/src/WorldParty.dpr b/src/WorldParty.dpr index b253e1fa..1d0df970 100644 --- a/src/WorldParty.dpr +++ b/src/WorldParty.dpr @@ -27,25 +27,11 @@ program WorldParty; {$R '..\res\link.res' '..\res\link.rc'} {$ENDIF} -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} +{$MODE OBJFPC} {$I switches.inc} -{$IFDEF MSWINDOWS} - // Set global application-type (GUI/CONSOLE) switch for Windows. - // CONSOLE is the default for FPC, GUI for Delphi, so we have - // to specify one of the two in any case. - {$IFDEF CONSOLE} - {$APPTYPE CONSOLE} - {$ELSE} - {$APPTYPE GUI} - {$ENDIF} -{$ENDIF} - uses - //heaptrc, {$IFDEF Unix} cthreads, // THIS MUST be the first used unit in FPC if Threads are used!! // (see http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial) @@ -70,55 +56,14 @@ uses zlib in 'lib\zlib\zlib.pas', freetype in 'lib\freetype\freetype.pas', - {$IFDEF UseBass} - BASS in 'lib\bass\delphi\bass.pas', - BASS_FX in 'lib\bass_fx\bass_fx.pas', - UAudioCore_Bass in 'media\UAudioCore_Bass.pas', - {$ENDIF} - {$IFDEF UsePortaudio} - portaudio in 'lib\portaudio\portaudio.pas', - UAudioCore_Portaudio in 'media\UAudioCore_Portaudio.pas', - {$ENDIF} - {$IFDEF UsePortmixer} - portmixer in 'lib\portmixer\portmixer.pas', - {$ENDIF} - - {$IFDEF UseFFmpeg} - {$IFDEF FPC} // This solution is not very elegant, but working - avcodec in 'lib\' + FFMPEG_DIR + '\avcodec.pas', - avformat in 'lib\' + FFMPEG_DIR + '\avformat.pas', - avutil in 'lib\' + FFMPEG_DIR + '\avutil.pas', - rational in 'lib\' + FFMPEG_DIR + '\rational.pas', - avio in 'lib\' + FFMPEG_DIR + '\avio.pas', - {$IFDEF UseSWResample} - swresample in 'lib\' + FFMPEG_DIR + '\swresample.pas', - {$ENDIF} - {$IFDEF useOLD_FFMPEG} - mathematics in 'lib\' + FFMPEG_DIR + '\mathematics.pas', - opt in 'lib\' + FFMPEG_DIR + '\opt.pas', - {$ENDIF} - {$IFDEF UseSWScale} - swscale in 'lib\' + FFMPEG_DIR + '\swscale.pas', - {$ENDIF} - {$ELSE} // speak: This is for Delphi. Change version as needed! - avcodec in 'lib\ffmpeg-0.10\avcodec.pas', - avformat in 'lib\ffmpeg-0.10\avformat.pas', - avutil in 'lib\ffmpeg-0.10\avutil.pas', - rational in 'lib\ffmpeg-0.10\rational.pas', - avio in 'lib\ffmpeg-0.10\avio.pas', - {$IFDEF UseSWResample} - swresample in 'lib\ffmpeg-0.10\swresample.pas', - {$ENDIF} - {$IFDEF UseSWScale} - swscale in 'lib\ffmpeg-0.10\swscale.pas', - {$ENDIF} - {$ENDIF} - UMediaCore_FFmpeg in 'media\UMediaCore_FFmpeg.pas', - {$ENDIF} // UseFFmpeg - - {$IFDEF UseSRCResample} - samplerate in 'lib\samplerate\samplerate.pas', - {$ENDIF} + avcodec in 'lib\'+FFMPEG_DIR+'\avcodec.pas', + avformat in 'lib\'+FFMPEG_DIR+'\avformat.pas', + avutil in 'lib\'+FFMPEG_DIR+'\avutil.pas', + rational in 'lib\'+FFMPEG_DIR+'\rational.pas', + avio in 'lib\'+FFMPEG_DIR+'\avio.pas', + swresample in 'lib\'+FFMPEG_DIR+'\swresample.pas', + swscale in 'lib\'+FFMPEG_DIR+'\swscale.pas', + UMediaCore_FFmpeg in 'media\UMediaCore_FFmpeg.pas', {$IFDEF UseProjectM} projectM in 'lib\projectM\projectM.pas', @@ -136,15 +81,13 @@ uses {$ENDIF} {$IFDEF FPC} - FileUtil in 'lib\Lazarus\fileutil.pas', - FPCAdds in 'lib\Lazarus\fpcadds.pas', - LazUtilsStrConsts in 'lib\Lazarus\lazutilsstrconsts.pas', - LazFileUtils in 'lib\Lazarus\lazfileutils.pas', - LazUTF8 in 'lib\Lazarus\lazutf8.pas', - LazUTF8Classes in 'lib\Lazarus\lazutf8classes.pas', - Masks in 'lib\Lazarus\masks.pas', - MTProcs in 'lib\Lazarus\components\multithreadprocs\mtprocs.pas', - MTPCPU in 'lib\Lazarus\components\multithreadprocs\mtpcpu.pas', + FileUtil in 'lib\Lazarus\components\lazutils\fileutil.pas', + FPCAdds in 'lib\Lazarus\components\lazutils\fpcadds.pas', + LazUtilsStrConsts in 'lib\Lazarus\components\lazutils\lazutilsstrconsts.pas', + LazFileUtils in 'lib\Lazarus\components\lazutils\lazfileutils.pas', + LazUTF8 in 'lib\Lazarus\components\lazutils\lazutf8.pas', + LazUTF8Classes in 'lib\Lazarus\components\lazutils\lazutf8classes.pas', + Masks in 'lib\Lazarus\components\lazutils\masks.pas', {$ENDIF} CpuCount in 'lib\other\cpucount.pas', {$IFDEF MSWINDOWS} @@ -253,13 +196,11 @@ uses //Includes - Media //------------------------------ - UMusic in 'base\UMusic.pas', - UAudioPlaybackBase in 'media\UAudioPlaybackBase.pas', -{$IF Defined(UsePortaudioPlayback) or Defined(UseSDLPlayback)} - UFFT in 'lib\fft\UFFT.pas', - UAudioPlayback_SoftMixer in 'media\UAudioPlayback_SoftMixer.pas', -{$IFEND} - UAudioConverter in 'media\UAudioConverter.pas', + UMusic in 'base\UMusic.pas', + UAudioPlaybackBase in 'media\UAudioPlaybackBase.pas', + UFFT in 'lib\fft\UFFT.pas', + UAudioPlayback_SoftMixer in 'media\UAudioPlayback_SoftMixer.pas', + UAudioConverter in 'media\UAudioConverter.pas', //****************************** //Pluggable media modules @@ -267,45 +208,29 @@ uses // This means the first entry has highest priority, the last lowest. //****************************** -{$IFDEF UseFFmpegVideo} - UVideo in 'media\UVideo.pas', -{$ENDIF} +UVideo in 'media\UVideo.pas', {$IFDEF UseProjectM} // must be after UVideo, so it will not be the default video module UVisualizer in 'media\UVisualizer.pas', {$ENDIF} -{$IFDEF UseBASSInput} - UAudioInput_Bass in 'media\UAudioInput_Bass.pas', -{$ENDIF} -{$IFDEF UseBASSDecoder} - // prefer Bass to FFmpeg if possible - UAudioDecoder_Bass in 'media\UAudioDecoder_Bass.pas', -{$ENDIF} -{$IFDEF UseBASSPlayback} - UAudioPlayback_Bass in 'media\UAudioPlayback_Bass.pas', -{$ENDIF} -{$IFDEF UseSDLPlayback} - UAudioPlayback_SDL in 'media\UAudioPlayback_SDL.pas', -{$ENDIF} -{$IFDEF UsePortaudioInput} - UAudioInput_Portaudio in 'media\UAudioInput_Portaudio.pas', -{$ENDIF} -{$IFDEF UsePortaudioPlayback} - UAudioPlayback_Portaudio in 'media\UAudioPlayback_Portaudio.pas', -{$ENDIF} -{$IFDEF UseFFmpegDecoder} - UAudioDecoder_FFmpeg in 'media\UAudioDecoder_FFmpeg.pas', -{$ENDIF} - // fallback dummy, must be last - UMedia_dummy in 'media\UMedia_dummy.pas', - - + {$IFDEF UseBASS} + BASS in 'lib\bass\bass.pas', + BASS_FX in 'lib\bass_fx\bass_fx.pas', + UAudioCore_Bass in 'media\UAudioCore_Bass.pas', + UAudioInput_Bass in 'media\UAudioInput_Bass.pas', + UAudioPlayback_Bass in 'media\UAudioPlayback_Bass.pas', + UAudioDecoder_Bass in 'media\UAudioDecoder_Bass.pas', + {$ELSE} + UAudioInput_SDL in 'media\UAudioInput_SDL.pas', + UAudioPlayback_SDL in 'media\UAudioPlayback_SDL.pas', + UAudioDecoder_FFmpeg in 'media\UAudioDecoder_FFmpeg.pas', + {$ENDIF} //------------------------------ //Includes - Screens //------------------------------ UScreenLoading in 'screens\UScreenLoading.pas', UScreenMain in 'screens\UScreenMain.pas', - UScreenPlayerSelection in 'screens\UScreenPlayerSelection.pas', + UScreenPlayerSelector in 'screens\UScreenPlayerSelector.pas', UScreenSong in 'screens\UScreenSong.pas', UScreenSingController in 'screens\controllers\UScreenSingController.pas', UScreenSingView in 'screens\views\UScreenSingView.pas', @@ -319,6 +244,10 @@ uses UScreenOptionsThemes in 'screens\UScreenOptionsThemes.pas', UScreenOptionsMicrophones in 'screens\UScreenOptionsMicrophones.pas', UScreenOptionsAdvanced in 'screens\UScreenOptionsAdvanced.pas', + UScreenOptionsNetwork in 'screens\UScreenOptionsNetwork.pas', + UScreenOptionsWebcam in 'screens\UScreenOptionsWebcam.pas', + UScreenOptionsProfiles in 'screens\UScreenOptionsProfiles.pas', + UScreenOpen in 'screens\UScreenOpen.pas', UScreenTop5 in 'screens\UScreenTop5.pas', UScreenSongMenu in 'screens\UScreenSongMenu.pas', @@ -343,8 +272,6 @@ uses opencv_imgproc in 'lib\openCV\opencv_imgproc.pas', opencv_types in 'lib\openCV\opencv_types.pas', - //BassMIDI in 'lib\bassmidi\bassmidi.pas', - UWebcam in 'base\UWebcam.pas', UDLLManager in 'base\UDLLManager.pas', @@ -357,8 +284,6 @@ uses UScreenJukeboxOptions in 'screens\UScreenJukeboxOptions.pas', UScreenJukeboxPlaylist in 'screens\UScreenJukeboxPlaylist.pas', - UScreenOptionsNetwork in 'screens\UScreenOptionsNetwork.pas', - UScreenOptionsWebcam in 'screens\UScreenOptionsWebcam.pas', UAvatars in 'base\UAvatars.pas', UScreenAbout in 'screens\UScreenAbout.pas', @@ -374,12 +299,10 @@ var begin try - {$IFDEF MSWINDOWS} - {$IFDEF CONSOLE} - FreeConsole(); //hacky workaround to get a working GUI-only experience on windows 10 when using fpc 3.0.0 on windows - {$ENDIF} - {$ENDIF} - Main; + {$IF DEFINED(MSWINDOWS) AND NOT DEFINED(DEBUG)} + FreeConsole(); //hacky workaround to get a working GUI-only experience on windows 10 when using fpc 3.0.0 on windows + {$IFEND} + UMain.Main(); except on E : Exception do begin diff --git a/src/base/TextGL.pas b/src/base/TextGL.pas index 60855bd1..f24f71d0 100644 --- a/src/base/TextGL.pas +++ b/src/base/TextGL.pas @@ -34,10 +34,11 @@ interface dglOpenGL, sdl2, Classes, - UTexture, + UCommon, UFont, + ULog, UPath, - ULog; + UTexture; type PGLFont = ^TGLFont; @@ -57,19 +58,21 @@ TGLFont = record var Fonts: array of TGLFont; ActFont: integer; + OutlineColor: TRGB; procedure BuildFonts; // builds all fonts procedure KillFonts; // deletes all font function glTextWidth(const text: UTF8String): real; // returns text width procedure glPrint(const text: UTF8String); // custom GL "Print" routine procedure ResetFont(); // reset font settings of active font -procedure SetFontPos(X, Y: real); // sets X and Y +procedure SetFontPos(X, Y: real; NewLine: integer = 0); // sets X and Y procedure SetFontZ(Z: real); // sets Z procedure SetFontSize(Size: real); procedure SetFontStyle(Style: integer); // sets active font style (normal, bold, etc) procedure SetFontItalic(Enable: boolean); // sets italic type letter (works for all fonts) procedure SetFontReflection(Enable:boolean;Spacing: real); // enables/disables text reflection procedure SetOutlineColor(R, G, B, A: GLFloat); // set outline color +procedure SetOutlineAlpha(A: GLFloat); //only update outline alpha implementation @@ -77,7 +80,6 @@ implementation UTextEncoding, SysUtils, IniFiles, - UCommon, UMain, UPathUtils; @@ -156,13 +158,16 @@ procedure BuildFonts; FontFile, FontMaxResolution, Outline, - True, + true, (FontPreCache<>0) ); + OutlineColor.R := FontIni.ReadFloat(SectionName, 'OutlineColorR', 0.0); + OutlineColor.G := FontIni.ReadFloat(SectionName, 'OutlineColorG', 0.0); + OutlineColor.B := FontIni.ReadFloat(SectionName, 'OutlineColorB', 0.0); OutlineFont.SetOutlineColor( - FontIni.ReadFloat(SectionName, 'OutlineColorR', 0.0), - FontIni.ReadFloat(SectionName, 'OutlineColorG', 0.0), - FontIni.ReadFloat(SectionName, 'OutlineColorB', 0.0), + OutlineColor.R, + OutlineColor.G, + OutlineColor.B, FontIni.ReadFloat(SectionName, 'OutlineColorA', -1.0) ); Fonts[I].Font := OutlineFont; @@ -176,13 +181,14 @@ procedure BuildFonts; FontFile, FontMaxResolution, Embolden, - True, + true, (FontPreCache<>0) ); Fonts[I].Outlined := false; end; Fonts[I].Font.GlyphSpacing := FontIni.ReadFloat(SectionName, 'GlyphSpacing', 0.0); + Fonts[I].Font.LineSpacing := FontIni.ReadFloat(SectionName, 'LineSpacing', 1.0); Fonts[I].Font.Stretch := FontIni.ReadFloat(SectionName, 'Stretch', 1.0); AddFontFallbacks(FontIni, Fonts[I].Font); @@ -242,10 +248,12 @@ procedure ResetFont(); SetOutlineColor(0,0,0,1); end; -procedure SetFontPos(X, Y: real); +procedure SetFontPos(X, Y: real; NewLine: integer = 0); begin Fonts[ActFont].X := X; Fonts[ActFont].Y := Y; + if NewLine > 0 then + Fonts[ActFont].Y += NewLine * (Fonts[ActFont].Font.Height * 3) * Fonts[ActFont].Font.LineSpacing; end; procedure SetFontZ(Z: real); @@ -286,4 +294,9 @@ procedure SetOutlineColor(R, G, B, A: GLFloat); TFTScalableOutlineFont(Fonts[ActFont].Font).SetOutlineColor(R, G, B, A); end; +procedure SetOutlineAlpha(A: GLFloat); +begin + TFTScalableOutlineFont(Fonts[ActFont].Font).SetOutlineColor(OutlineColor.R, OutlineColor.G, OutlineColor.B, A); +end; + end. diff --git a/src/base/UCommandLine.pas b/src/base/UCommandLine.pas index cdbcec82..023f4c65 100644 --- a/src/base/UCommandLine.pas +++ b/src/base/UCommandLine.pas @@ -118,7 +118,7 @@ procedure TCMDParams.ShowHelp(); begin writeln; writeln('**************************************************************'); - writeln(' UltraStar Deluxe - Command line switches '); + writeln(' UltraStar WorldParty - Command line switches '); writeln('**************************************************************'); writeln; writeln(' '+ Fmt('Switch') +' : Purpose'); diff --git a/src/base/UConfig.pas b/src/base/UConfig.pas index 994a14aa..c98934f2 100644 --- a/src/base/UConfig.pas +++ b/src/base/UConfig.pas @@ -124,10 +124,10 @@ interface (* * Current version of UltraStar WorldParty *) - USDX_VERSION_MAJOR = 19; + USDX_VERSION_MAJOR = 20; USDX_VERSION_MINOR = 12; USDX_VERSION_RELEASE = ''; - USDX_VERSION_STATE = ''; + USDX_VERSION_STATE = 'Beta 1'; USDX_STRING = 'UltraStar WorldParty'; (* @@ -160,8 +160,6 @@ interface {$MESSAGE FATAL 'FPC >= 2.2.2 required!'} {$IFEND} - {$IFDEF HaveFFmpeg} - LIBAVCODEC_VERSION = (LIBAVCODEC_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVCODEC_VERSION_MINOR * VERSION_MINOR) + (LIBAVCODEC_VERSION_RELEASE * VERSION_RELEASE); @@ -174,19 +172,13 @@ interface (LIBAVUTIL_VERSION_MINOR * VERSION_MINOR) + (LIBAVUTIL_VERSION_RELEASE * VERSION_RELEASE); - {$IFDEF HaveSWScale} LIBSWSCALE_VERSION = (LIBSWSCALE_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWSCALE_VERSION_MINOR * VERSION_MINOR) + (LIBSWSCALE_VERSION_RELEASE * VERSION_RELEASE); - {$ENDIF} - {$IFDEF HaveSWResample} LIBSWRESAMPLE_VERSION = (LIBSWRESAMPLE_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWRESAMPLE_VERSION_MINOR * VERSION_MINOR) + (LIBSWRESAMPLE_VERSION_RELEASE * VERSION_RELEASE); - {$ENDIF} - - {$ENDIF} {$IFDEF HaveProjectM} PROJECTM_VERSION = (PROJECTM_VERSION_MAJOR * VERSION_MAJOR) + @@ -194,18 +186,6 @@ interface (PROJECTM_VERSION_RELEASE * VERSION_RELEASE); {$ENDIF} - {$IFDEF HavePortaudio} - PORTAUDIO_VERSION = (PORTAUDIO_VERSION_MAJOR * VERSION_MAJOR) + - (PORTAUDIO_VERSION_MINOR * VERSION_MINOR) + - (PORTAUDIO_VERSION_RELEASE * VERSION_RELEASE); - {$ENDIF} - - {$IFDEF HaveLibsamplerate} - LIBSAMPLERATE_VERSION = (LIBSAMPLERATE_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSAMPLERATE_VERSION_MINOR * VERSION_MINOR) + - (LIBSAMPLERATE_VERSION_RELEASE * VERSION_RELEASE); - {$ENDIF} - function USDXVersionStr(): string; function USDXShortVersionStr(): string; diff --git a/src/base/UDLLManager.pas b/src/base/UDLLManager.pas index d36145f1..7d4f960a 100644 --- a/src/base/UDLLManager.pas +++ b/src/base/UDLLManager.pas @@ -224,7 +224,7 @@ function TDLLMan.WebsiteSendScore (var SendInfo: TSendInfo): byte; function TDLLMan.WebsiteEncryptScore (var SendInfo: TSendInfo): string; begin if (@P_EncryptScore <> nil) then - Result := P_EncryptScore (SendInfo) + Result := string(P_EncryptScore(SendInfo)) else Result := ''; end; @@ -241,7 +241,7 @@ function TDLLMan.WebsiteEncryptPassword (var LoginInfo: TLoginInfo): string; begin if (@P_EncryptPassword <> nil) then begin - Result := P_EncryptPassword (LoginInfo); + Result := string(P_EncryptPassword(LoginInfo)); end else Result := ''; @@ -250,7 +250,7 @@ function TDLLMan.WebsiteEncryptPassword (var LoginInfo: TLoginInfo): string; function TDLLMan.WebsiteDownloadScore (List_MD5Song: widestring; Level: byte): string; begin if (@P_DownloadScore <> nil) then - Result := P_DownloadScore (List_MD5Song, Level) + Result := string(P_DownloadScore(List_MD5Song, Level)) else Result := ''; end; @@ -258,7 +258,7 @@ function TDLLMan.WebsiteDownloadScore (List_MD5Song: widestring; Level: byte): s function TDLLMan.WebsiteVerifySong (MD5Song: widestring): string; begin if (@P_VerifySong <> nil) then - Result := P_VerifySong (MD5Song) + Result := string(P_VerifySong(MD5Song)) else Result := ''; end; diff --git a/src/base/UDataBase.pas b/src/base/UDataBase.pas index 9205c998..ce1760ff 100644 --- a/src/base/UDataBase.pas +++ b/src/base/UDataBase.pas @@ -1004,7 +1004,7 @@ function TDataBaseSystem.ReadUser_Score(Artist, Title: UTF8String; WebID, Level: TableData.Free; - Result := UTF8Decode(User_Score); + Result := string(UTF8Decode(User_Score)); end; diff --git a/src/base/UDraw.pas b/src/base/UDraw.pas index f25c7329..2eec7f64 100644 --- a/src/base/UDraw.pas +++ b/src/base/UDraw.pas @@ -115,9 +115,6 @@ implementation procedure SingDrawWebCamFrame; -var - status: integer; - TextureCam2: PTexture; begin Webcam.GetWebcamFrame; @@ -333,9 +330,6 @@ procedure SingDrawJukeboxBackground; end; procedure SingDrawJukeboxBlackBackground; -var - Rec: TRecR; - TexRec: TRecR; begin glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, ScreenJukebox.Tex_Background.TexNum); @@ -577,6 +571,10 @@ procedure SingDrawPlayerLine(X, Y, W: real; NrLines, PlayerIndex: integer; Space // R, G, B, A: real; NotesH2: real; begin + Rec.Right := 0; + Rec.Left := 0; + Rec.Top := 0; + Rec.Bottom := 0; //Log.LogStatus('Player notes', 'SingDraw'); { if NrGracza = 0 then @@ -718,6 +716,10 @@ procedure SingDrawPlayerBGLine(Left, Top, Right: real; NrLines, PlayerIndex: int TempR: real; W, H: real; begin + Rec.Right := 0; + Rec.Left := 0; + Rec.Top := 0; + Rec.Bottom := 0; if (ScreenSing.settings.NotesVisible and (1 shl PlayerIndex) <> 0) then begin //glColor4f(1, 1, 1, sqrt((1+sin( AudioPlayback.Position * 3))/4)/ 2 + 0.5 ); @@ -924,6 +926,7 @@ procedure SingDrawLyricHelper(CP: integer; Left, LyricsMid: real); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); + Col := HexToRGB(UIni.Ini.LyricsSingColor); if (CurrentSong.isDuet) then begin if (PlayersPlay = 1) or (PlayersPlay = 2) then @@ -938,13 +941,8 @@ procedure SingDrawLyricHelper(CP: integer; Left, LyricsMid: real); if (PlayersPlay = 6) then Col := GetLyricBarColor(CP + 1); end - else - Col := HexToRGB(UIni.Ini.LyricsSingColor) - end; - end - else - Col := HexToRGB(UIni.Ini.LyricsSingColor); - + end + end; glColor4f(Col.R, Col.G, Col.B, BarAlpha); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -1070,8 +1068,6 @@ procedure SingDrawLyricHelperJukebox(Left, LyricsMid: real); procedure SingDrawLines; var NR: TRecR; // lyrics area bounds (NR = NoteRec?) - LyricEngine: TLyricEngine; - LyricEngineDuet: TLyricEngine; begin // positions if Ini.SingWindow = 0 then @@ -1172,9 +1168,6 @@ procedure SingDrawLines; procedure SingDraw; var NR: TRecR; // lyrics area bounds (NR = NoteRec?) - LyricEngine: TLyricEngine; - LyricEngineDuetP1: TLyricEngine; - LyricEngineDuetP2: TLyricEngine; I: integer; Difficulty: integer; begin @@ -1190,15 +1183,6 @@ procedure SingDraw; NR.WMid := NR.Width / 2; NR.Mid := NR.Left + NR.WMid; - // FIXME: accessing ScreenSing is not that generic - if (CurrentSong.isDuet) and (PlayersPlay <> 1) then - begin - LyricEngineDuetP1 := ScreenSing.LyricsDuetP1; - LyricEngineDuetP2 := ScreenSing.LyricsDuetP2; - end - else - LyricEngine := ScreenSing.Lyrics; - // draw time-bar SingDrawTimeBar(); @@ -1207,15 +1191,15 @@ procedure SingDraw; begin if (CurrentSong.isDuet) and (PlayersPlay <> 1) then begin - LyricEngineDuetP1.Draw(LyricsState.MidBeat); + UGraphic.ScreenSing.LyricsDuetP1.Draw(LyricsState.MidBeat); SingDrawLyricHelper(0, NR.Left, NR.WMid); - LyricEngineDuetP2.Draw(LyricsState.MidBeat); + UGraphic.ScreenSing.LyricsDuetP2.Draw(LyricsState.MidBeat); SingDrawLyricHelper(1, NR.Left, NR.WMid); end else begin - LyricEngine.Draw(LyricsState.MidBeat); + UGraphic.ScreenSing.Lyrics.Draw(LyricsState.MidBeat); SingDrawLyricHelper(0, NR.Left, NR.WMid); end; end; @@ -1996,7 +1980,10 @@ procedure SingDrawJukeboxTimeBar(); LyricsProgress: real; CurLyricsTime: real; begin - + x := 0; + y := 0; + width := 0; + height := 0; if (ScreenJukebox.SongListVisible) then begin x := Theme.Jukebox.StaticTimeProgress.x; diff --git a/src/base/UFiles.pas b/src/base/UFiles.pas index 3f442dbf..661c3c5d 100644 --- a/src/base/UFiles.pas +++ b/src/base/UFiles.pas @@ -81,7 +81,6 @@ function SaveSong(const Song: TSong; const Lines: TLines; const Name: IPath): TS C: integer; N: integer; S: AnsiString; - B: integer; NoteState: AnsiString; SongFile: TTextFileStream; diff --git a/src/base/UFont.pas b/src/base/UFont.pas index b8651e40..40196b19 100644 --- a/src/base/UFont.pas +++ b/src/base/UFont.pas @@ -30,13 +30,10 @@ interface -{$IFNDEF FREETYPE_DEMO} // Flip direction of y-axis. // Default is a cartesian coordinate system with y-axis in upper direction // but with USDX the y-axis is in lower direction. {$DEFINE FLIP_YAXIS} - {$DEFINE BITMAP_FONT} -{$ENDIF} // Enables the Freetype font cache {$DEFINE ENABLE_FT_FACE_CACHE} @@ -53,9 +50,6 @@ interface Classes, SysUtils, UUnicodeUtils, - {$IFDEF BITMAP_FONT} - UTexture, - {$ENDIF} UPath; type @@ -753,72 +747,6 @@ TFTScalableOutlineFont = class(TScalableFont) property Outset: single read GetOutset; end; -{$IFDEF BITMAP_FONT} - - {** - * A bitmapped font loads it's glyphs from a bitmap and stores them in a - * texture. Unicode characters are not supported (but could be by supporting - * multiple textures each storing a subset of unicode glyphs). - * For backward compatibility only. - *} - TBitmapFont = class(TFont) - private - fTex: TTexture; - fTexSize: integer; - fBaseline: integer; - fAscender: integer; - fDescender: integer; - fWidths: array[0..255] of byte; //**< half widths - fOutline: integer; - fTempColor: TGLColor; //**< colours for the reflection - - procedure ResetIntern(); - - procedure RenderChar(ch: UCS4Char; var AdvanceX: real); - - {** - * Load font widths from an info file. - * @param InfoFile the name of the info (.dat) file - * @raises EFontError if the file is corrupted - *} - procedure LoadFontInfo(const InfoFile: IPath); - - protected - procedure Render(const Text: UCS4String); override; - function BBox(const Text: TUCS4StringArray; Advance: boolean): TBoundsDbl; override; - - function GetHeight(): single; override; - function GetAscender(): single; override; - function GetDescender(): single; override; - function GetUnderlinePosition(): single; override; - function GetUnderlineThickness(): single; override; - - public - {** - * Creates a bitmapped font from image Filename and font width info - * loaded from the corresponding file with ending .dat. - * @param(Baseline y-coord of the baseline given in cartesian coords - * (y-axis up) and from the lower edge of the glyphs bounding box) - * @param(Ascender pixels from baseline to top of highest glyph) - *} - constructor Create(const Filename: IPath; Outline: integer; - Baseline, Ascender, Descender: integer); - destructor Destroy(); override; - - {** - * Corrects font widths provided by the info file. - * NewWidth := Width * WidthMult + WidthAdd - *} - procedure CorrectWidths(WidthMult: real; WidthAdd: integer); - - {** @seealso TFont.Reset } - procedure Reset(); override; - - procedure AddFallback(const Filename: IPath); override; - end; - -{$ENDIF BITMAP_FONT} - TFreeType = class public {** @@ -1139,13 +1067,13 @@ constructor TScalableFont.Create(Font: TFont; UseMipmaps: boolean); inherited Create(Font.Filename); fBaseFont := Font; - fMipmapFonts[0] := Font; fUseMipmaps := UseMipmaps; ResetIntern(); // create mipmap fonts if requested if (UseMipmaps) then begin + fMipmapFonts[0] := Font; for MipmapLevel := 1 to cMaxMipmapLevel do begin fMipmapFonts[MipmapLevel] := CreateMipmap(MipmapLevel, 1/(1 shl MipmapLevel)); @@ -1160,8 +1088,9 @@ destructor TScalableFont.Destroy(); var Level: integer; begin - for Level := 0 to High(fMipmapFonts) do - fMipmapFonts[Level].Free; + // TODO FIXME see how to do FreeAndNil(fMipmapFonts) + // for Level := 0 to High(fMipmapFonts) do + // fMipmapFonts[Level].Free; inherited; end; @@ -2254,7 +2183,7 @@ procedure TFTGlyph.StrokeBorder(var Glyph: FT_Glyph); OuterNumPoints, InnerNumPoints, GlyphNumPoints: FT_UInt; OuterNumContours, InnerNumContours, GlyphNumContours: FT_UInt; OuterBorder, InnerBorder: FT_StrokerBorder; - OutlineFlags: FT_Int; + // OutlineFlags: FT_Int; UseStencil: boolean; begin // It is possible to extrude the borders of a glyph with FT_Glyph_Stroke @@ -2339,7 +2268,7 @@ procedure TFTGlyph.StrokeBorder(var Glyph: FT_Glyph); GlyphNumContours := InnerNumContours + OuterNumContours; // save flags before deletion (TODO: set them on the resulting outline) - OutlineFlags := Outline.flags; + // OutlineFlags := Outline.flags; // resize glyph outline to hold inner and outer border FT_Outline_Done(Glyph.Library_, Outline); @@ -2851,241 +2780,6 @@ class procedure TFreeType.FreeLibrary(); LibraryInst := nil; end; - -{$IFDEF BITMAP_FONT} -{* - * TBitmapFont - *} - -constructor TBitmapFont.Create(const Filename: IPath; Outline: integer; - Baseline, Ascender, Descender: integer); -begin - inherited Create(Filename); - - fTex := Texture.LoadTexture(Filename, TEXTURE_TYPE_TRANSPARENT, 0); - fTexSize := 1024; - fOutline := Outline; - fBaseline := Baseline; - fAscender := Ascender; - fDescender := Descender; - - LoadFontInfo(Filename.SetExtension('.dat')); - - ResetIntern(); -end; - -destructor TBitmapFont.Destroy(); -begin - glDeleteTextures(1, @fTex.TexNum); - inherited; -end; - -procedure TBitmapFont.ResetIntern(); -begin - fLineSpacing := Height; -end; - -procedure TBitmapFont.Reset(); -begin - inherited; - ResetIntern(); -end; - -procedure TBitmapFont.AddFallback(const Filename: IPath); -begin - // no support for fallbacks -end; - -procedure TBitmapFont.CorrectWidths(WidthMult: real; WidthAdd: integer); -var - Count: integer; -begin - for Count := 0 to 255 do - fWidths[Count] := Round(fWidths[Count] * WidthMult) + WidthAdd; -end; - -procedure TBitmapFont.LoadFontInfo(const InfoFile: IPath); -var - Stream: TStream; -begin - FillChar(fWidths[0], Length(fWidths), 0); - - Stream := nil; - try - Stream := TBinaryFileStream.Create(InfoFile, fmOpenRead); - Stream.Read(fWidths, 256); - except - raise EFontError.Create('Could not read font info file ''' + InfoFile.ToNative + ''''); - end; - Stream.Free; -end; - -function TBitmapFont.BBox(const Text: TUCS4StringArray; Advance: boolean): TBoundsDbl; -var - LineIndex, CharIndex: integer; - CharCode: cardinal; - Line: UCS4String; - LineWidth: double; -begin - Result.Left := 0; - Result.Right := 0; - Result.Top := Height; - Result.Bottom := 0; - - for LineIndex := 0 to High(Text) do - begin - Line := Text[LineIndex]; - LineWidth := 0; - for CharIndex := 0 to LengthUCS4(Line)-1 do - begin - CharCode := Ord(Line[CharIndex]); - if (CharCode < Length(fWidths)) then - LineWidth := LineWidth + fWidths[CharCode]; - end; - if (LineWidth > Result.Right) then - Result.Right := LineWidth; - end; -end; - -procedure TBitmapFont.RenderChar(ch: UCS4Char; var AdvanceX: real); -var - TexX, TexY: real; - TexR, TexB: real; - GlyphWidth: real; - PL, PT: real; - PR, PB: real; - CharCode: cardinal; -begin - CharCode := Ord(ch); - if (CharCode > High(fWidths)) then - CharCode := 0; - - GlyphWidth := fWidths[CharCode]; - - // set texture positions - TexX := (CharCode mod 16) * 1/16 + 1/32 - (GlyphWidth/2 - fOutline)/fTexSize; - TexY := (CharCode div 16) * 1/16 + {2 texels} 2/fTexSize; - TexR := (CharCode mod 16) * 1/16 + 1/32 + (GlyphWidth/2 + fOutline)/fTexSize; - TexB := (1 + CharCode div 16) * 1/16 - {2 texels} 2/fTexSize; - - // set vector positions - PL := AdvanceX - fOutline; - PR := PL + GlyphWidth + fOutline*2; - PB := -fBaseline; - PT := PB + fTexSize div 16; - - (* - if (Font.Blend) then - begin - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - end; - *) - - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, fTex.TexNum); - - if (not ReflectionPass) then - begin - glBegin(GL_QUADS); - glTexCoord2f(TexX, TexY); glVertex2f(PL, PT); - glTexCoord2f(TexX, TexB); glVertex2f(PL, PB); - glTexCoord2f(TexR, TexB); glVertex2f(PR, PB); - glTexCoord2f(TexR, TexY); glVertex2f(PR, PT); - glEnd; - end - else - begin - glDepthRange(0, 10); - glDepthFunc(GL_LEQUAL); - glEnable(GL_DEPTH_TEST); - - glBegin(GL_QUADS); - glTexCoord2f(TexX, TexY); glVertex2f(PL, PT); - glTexCoord2f(TexX, TexB); glVertex2f(PL, PB); - glTexCoord2f(TexR, TexB); glVertex2f(PR, PB); - glTexCoord2f(TexR, TexY); glVertex2f(PR, PT); - glEnd; - - glBegin(GL_QUADS); - glTexCoord2f(TexX, TexY); glVertex2f(PL, PT); - glTexCoord2f(TexX, TexB); glVertex2f(PL, PB); - glTexCoord2f(TexR, TexB); glVertex2f(PR, PB); - glTexCoord2f(TexR, TexY); glVertex2f(PR, PT); - -(* - glColor4f(fTempColor.r, fTempColor.g, fTempColor.b, 0.7); - glTexCoord2f(TexX, TexB); glVertex3f(PL, PB, 0); - glTexCoord2f(TexR, TexB); glVertex3f(PR, PB, 0); - - glColor4f(fTempColor.r, fTempColor.g, fTempColor.b, 0); - glTexCoord2f(TexR, (TexY + TexB)/2); glVertex3f(PR, (PT + PB)/2, 0); - glTexCoord2f(TexX, (TexY + TexB)/2); glVertex3f(PL, (PT + PB)/2, 0); -*) - glEnd; - - //write the colour back - glColor4fv(@fTempColor); - - glDisable(GL_DEPTH_TEST); - end; // reflection - - glDisable(GL_TEXTURE_2D); - (* - if (Font.Blend) then - glDisable(GL_BLEND); - *) - - AdvanceX := AdvanceX + GlyphWidth; -end; - -procedure TBitmapFont.Render(const Text: UCS4String); -var - CharIndex: integer; - AdvanceX: real; -begin - // if there is no text do nothing - if (Text = nil) or (Text[0] = 0) then - Exit; - - //Save the current color and alpha (for reflection) - glGetFloatv(GL_CURRENT_COLOR, @fTempColor); - - AdvanceX := 0; - for CharIndex := 0 to LengthUCS4(Text)-1 do - begin - RenderChar(Text[CharIndex], AdvanceX); - end; -end; - -function TBitmapFont.GetHeight(): single; -begin - Result := fAscender - fDescender; -end; - -function TBitmapFont.GetAscender(): single; -begin - Result := fAscender; -end; - -function TBitmapFont.GetDescender(): single; -begin - Result := fDescender; -end; - -function TBitmapFont.GetUnderlinePosition(): single; -begin - Result := -2.0; -end; - -function TBitmapFont.GetUnderlineThickness(): single; -begin - Result := 1.0; -end; - -{$ENDIF BITMAP_FONT} - - initialization finalization diff --git a/src/base/UGraphic.pas b/src/base/UGraphic.pas index 3cc33430..93d5918d 100644 --- a/src/base/UGraphic.pas +++ b/src/base/UGraphic.pas @@ -44,7 +44,7 @@ interface UPathUtils, UScreenLoading, UScreenMain, - UScreenPlayerSelection, + UScreenPlayerSelector, UScreenOptions, UScreenOptionsGame, UScreenOptionsGraphics, @@ -55,6 +55,7 @@ interface UScreenOptionsAdvanced, UScreenOptionsNetwork, UScreenOptionsWebcam, + UScreenOptionsProfiles, UScreenSong, UScreenSingController, UScreenJukebox, @@ -146,6 +147,7 @@ TRecR = record ScreenOptionsAdvanced: TScreenOptionsAdvanced; ScreenOptionsNetwork: TScreenOptionsNetwork; ScreenOptionsWebcam: TScreenOptionsWebcam; + ScreenOptionsProfiles: TScreenOptionsProfiles; ScreenOpen: TScreenOpen; ScreenAbout: TScreenAbout; ScreenDevelopers: TScreenDevelopers; @@ -429,7 +431,7 @@ procedure InitializeScreen(Title: string); begin Log.LogStatus('Set Video Mode... Borderless fullscreen', 'SDL_SetVideoMode'); CurrentWindowMode := Mode_Borderless; - screen := SDL_CreateWindow('UltraStar Deluxe loading...', + screen := SDL_CreateWindow('Loading...', SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, W, H, SDL_WINDOW_OPENGL or SDL_WINDOW_FULLSCREEN_DESKTOP or SDL_WINDOW_RESIZABLE); end else if Fullscreen then @@ -717,6 +719,7 @@ procedure UnloadScreens; FreeAndNil(ScreenOptionsAdvanced); FreeAndNil(ScreenOptionsNetwork); FreeAndNil(ScreenOptionsWebcam); + FreeAndNil(ScreenOptionsProfiles); FreeAndNil(ScreenJukebox); FreeAndNil(ScreenJukeboxOptions); FreeAndNil(ScreenJukeboxPlaylist); diff --git a/src/base/UGraphicClasses.pas b/src/base/UGraphicClasses.pas index 4c805455..42d4f610 100644 --- a/src/base/UGraphicClasses.pas +++ b/src/base/UGraphicClasses.pas @@ -515,7 +515,6 @@ procedure TEffectManager.KillAll(); procedure TEffectManager.SentenceChange(CP: integer); var c: cardinal; - p: integer; begin c := 0; @@ -658,6 +657,9 @@ procedure TEffectManager.SpawnPerfectLineTwinkle(); Left, Right, Top, Bottom: cardinal; cScreen, Nstars: integer; begin + Bottom := 0; + Top := 0; + cScreen := 0; // calculation of coordinates done with hardcoded values like in UDraw.pas // might need to be adjusted if drawing of SingScreen is modified // coordinates may still be a bit weird and need adjustment diff --git a/src/base/UImage.pas b/src/base/UImage.pas index add1a839..77d30f64 100644 --- a/src/base/UImage.pas +++ b/src/base/UImage.pas @@ -645,6 +645,7 @@ procedure ColorizeImage(ImgSurface: PSDL_Surface; NewColor: longword); // longword to double as expected. // After the change to longint, we may not need it, but left for now // Something to check + Hue := 0; if (Max = Red ) then Hue := Green - Blue else if (Max = Green) then Hue := 2.0*Delta + Blue - Red else if (Max = Blue ) then Hue := 4.0*Delta + Red - Green; diff --git a/src/base/UIni.pas b/src/base/UIni.pas index 6bc49e7b..9ff0b0a6 100644 --- a/src/base/UIni.pas +++ b/src/base/UIni.pas @@ -104,7 +104,7 @@ TIni = class // Players or Teams colors SingColor: array[0..(IMaxPlayerCount-1)] of integer; - Name: array[0..15] of UTF8String; + Name: array[0..(IMaxPlayerCount-1)] of UTF8String; PlayerColor: array[0..(IMaxPlayerCount-1)] of integer; TeamColor: array[0..2] of integer; @@ -267,13 +267,13 @@ TIni = class procedure ClearCustomResolutions(); end; - var Ini: TIni; IResolution: TUTF8StringDynArray; IResolutionFullScreen: TUTF8StringDynArray; IResolutionCustom: TUTF8StringDynArray; ILanguage: TUTF8StringDynArray; + LanguageIso: array of UTF8String; ITheme: TUTF8StringDynArray; {* @@ -352,7 +352,7 @@ TIni = class ILyricsAlpha: array[0..19] of UTF8String = ('0.05', '0.10', '0.15', '0.20', '0.25', '0.30', '0.35', '0.40', '0.45', '0.50', '0.55', '0.60', '0.65', '0.70', '0.75', '0.80', '0.85', '0.90', '0.95', '1.00'); //for lyric colors - ILine: array[0..2] of UTF8String = ('Sing', 'Actual', 'Next'); + ILine: array[0..2] of UTF8String = ('Sing', 'Top', 'Bottom'); IProperty: array[0..1] of UTF8String = ('Fill', 'Outline'); LineColor: array[0..21] of UTF8String = ('Blue', 'Green', 'Pink', 'Red', 'Violet', 'Orange', 'Yellow', 'Magenta', 'Brown', 'Black', 'Turquoise', 'Salmon', 'GreenYellow', 'Lavender', 'Beige', 'Teal', 'Orchid', 'SteelBlue', 'Plum', 'Chocolate', 'Gold', 'Other'); LineInactiveColor: array[0..9] of UTF8String = ('Black', 'Gray +3', 'Gray +2', 'Gray +1', 'Gray', 'Gray -1', 'Gray -2', 'Gray -3', 'White', 'Other'); @@ -423,6 +423,13 @@ TIni = class implementation uses + gettext, + {$IFDEF MSWINDOWS} + Windows, + {$ELSE} + Unix, + {$ENDIF} + math, StrUtils, sdl2, UCommandLine, @@ -703,21 +710,16 @@ procedure TIni.SaveInputDeviceCfg(IniFile: TIniFile); procedure TIni.LoadPaths(IniFile: TCustomIniFile); var PathStrings: TStringList; - I: integer; + I: integer; begin - PathStrings := TStringList.Create; + UPathUtils.InitializeSongPaths(); + PathStrings := TStringList.Create(); IniFile.ReadSection('Directories', PathStrings); - - // Load song-paths - for I := 0 to PathStrings.Count-1 do - begin + for I := 0 to PathStrings.Count - 1 do if (Pos('SONGDIR', UpperCase(PathStrings[I])) = 1) then - begin - AddSongPath(Path(IniFile.ReadString('Directories', PathStrings[I], ''))); - end; - end; + UPathUtils.AddSongPath(UPath.Path(IniFile.ReadString('Directories', PathStrings[I], ''))); - PathStrings.Free; + PathStrings.Free(); end; procedure TIni.LoadThemes(IniFile: TCustomIniFile); @@ -887,8 +889,10 @@ procedure TIni.LoadScreenModes(IniFile: TCustomIniFile); procedure TIni.Load(); var IniFile: TMemIniFile; - I: integer; + I: integer; IShowWebScore: array of UTF8String; + LanguageIsoCode: integer; + Lang, FallbackLang: string; begin GamePath := Platform.GetGameUserPath; @@ -930,10 +934,10 @@ procedure TIni.Load(); // Difficulty Difficulty := ReadArrayIndex(IDifficulty, IniFile, 'Game', 'Difficulty', IGNORE_INDEX, 'Easy'); - // Language - Language := ReadArrayIndex(ILanguage, IniFile, 'Game', 'Language', IGNORE_INDEX, 'English'); - if Language < 0 then Language := GetArrayIndex(ILanguage, 'English'); // Default to english - if Language < 0 then Language := 0; // Default to first available + //if language is unset try to find system language or load english at default + GetLanguageIDs(Lang, FallbackLang); + LanguageIsoCode := GetArrayIndex(LanguageIso, IfThen(Length(Lang) = 2, Lang, Copy(FallbackLang, 1, 2))); + Language := ReadArrayIndex(ILanguage, IniFile, 'Game', 'Language', IGNORE_INDEX, ILanguage[IfThen(LanguageIsoCode > -1, LanguageIsoCode, GetArrayIndex(LanguageIso, 'en'))]); // SongMenu SongMenu := ReadArrayIndex(ISongMenuMode, IniFile, 'Game', 'SongMenu', Ord(smChessboard)); @@ -1141,8 +1145,6 @@ procedure TIni.Load(); procedure TIni.Save; var IniFile: TIniFile; - HexColor: string; - C: TRGB; begin try begin diff --git a/src/base/UJoystick.pas b/src/base/UJoystick.pas index ba5fc080..5ac086fe 100644 --- a/src/base/UJoystick.pas +++ b/src/base/UJoystick.pas @@ -523,6 +523,7 @@ function TJoy.AddController(DeviceId: integer; out Error: string): boolean; s: string; begin Result := true; + Controller := nil; if SDL_IsGameController(DeviceId) = SDL_TRUE then begin s := SDL_GameControllerNameForIndex(DeviceId); diff --git a/src/base/ULanguage.pas b/src/base/ULanguage.pas index 20257875..da07d196 100644 --- a/src/base/ULanguage.pas +++ b/src/base/ULanguage.pas @@ -1,8 +1,8 @@ {* UltraStar WorldParty - Karaoke Game - - UltraStar WorldParty is the legal property of its developers, - whose names are too numerous to list here. Please refer to the + + UltraStar WorldParty is the legal property of its developers, + whose names are too numerous to list here. Please refer to the COPYRIGHT file distributed with this source distribution. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. Check "LICENSE" file. If not, see + along with this program. Check "LICENSE" file. If not, see . *} @@ -55,7 +55,6 @@ TLanguage = class Implode_Glue1, Implode_Glue2: UTF8String; - procedure LoadList; function FindID(const ID: AnsiString; const EntryList: TLanguageEntryArray): integer; public @@ -89,25 +88,35 @@ implementation constructor TLanguage.Create; var I, J: Integer; + Iter: IFileIterator; begin inherited; - - LoadList; - //Set Implode Glues for Backward Compatibility Implode_Glue1 := ', '; Implode_Glue2 := ' and '; + SetLength(List, 0); + Iter := FileSystem.FileFind(LanguagesPath.Append('*.ini'), 0); + while(Iter.HasNext) do + begin + SetLength(List, Length(List)+1); + List[High(List)].Name := Iter.Next.Name.SetExtension('').ToUTF8; + end; if (Length(List) = 0) then //No Language Files Loaded -> Abort Loading Log.CriticalError('Could not load any Language File'); //Standard Language (If a Language File is Incomplete) //Then use English Language + SetLength(UIni.ILanguage, 0); + SetLength(UIni.LanguageIso, 0); for I := 0 to high(List) do //Search for English Language begin // Load each language to store the native language name ChangeLanguage(List[I].Name); - ILanguage[I] := Translate('LANGUAGE'); + SetLength(UIni.ILanguage, Length(UIni.ILanguage)+1); + SetLength(UIni.LanguageIso, Length(UIni.LanguageIso)+1); + UIni.ILanguage[I] := Self.Translate('LANGUAGE'); + UIni.LanguageIso[I] := Self.Translate('LANGUAGE_ISO_CODE'); //English Language Found -> Load if Uppercase(List[I].Name) = 'ENGLISH' then @@ -118,39 +127,9 @@ constructor TLanguage.Create; SetLength(Entry, 0); end; - - if (I = high(List)) then - Log.LogError('language file missing! No standard translation loaded'); - end; - //Standard Language END - -end; - -{** - * Parse the Language Dir searching Translations - *} -procedure TLanguage.LoadList; -var - Iter: IFileIterator; - IniInfo: TFileInfo; - LangName: string; -begin - SetLength(List, 0); - SetLength(ILanguage, 0); - - Iter := FileSystem.FileFind(LanguagesPath.Append('*.ini'), 0); - while(Iter.HasNext) do - begin - IniInfo := Iter.Next; - - LangName := IniInfo.Name.SetExtension('').ToUTF8; - - SetLength(List, Length(List)+1); - List[High(List)].Name := LangName; - - SetLength(ILanguage, Length(ILanguage)+1); - ILanguage[High(ILanguage)] := LangName; end; + if Length(EntryDefault) = 0 then + Log.CriticalError('Cannot find Languages\English.ini'); end; {** @@ -205,8 +184,8 @@ function TLanguage.FindID(const ID: AnsiString; const EntryList: TLanguageEntryA {** * Translate the Text. * If Text is an ID, text will be translated according to the current language - * setting. If Text is not a known ID, it will be returned as is. - * @param Text either an ID or an UTF-8 encoded string + * setting. If Text is not a known ID, it will be returned as is. + * @param Text either an ID or an UTF-8 encoded string *} function TLanguage.Translate(const Text: RawByteString): UTF8String; var diff --git a/src/base/ULog.pas b/src/base/ULog.pas index af4939c3..1e83b1c8 100644 --- a/src/base/ULog.pas +++ b/src/base/ULog.pas @@ -242,6 +242,7 @@ procedure TLog.LogBenchmark(const Text: string; Number: integer); Miliseconds := Trunc(Frac(Time) * 1000); Seconds := Trunc(Time) mod 60; Minutes := Trunc((Time - Seconds) / 60); + ValueText := ''; //ValueText := FloatToStr(BenchmarkTimeLength[Number]); { diff --git a/src/base/ULyrics.pas b/src/base/ULyrics.pas index 233343e6..6ca74ed0 100644 --- a/src/base/ULyrics.pas +++ b/src/base/ULyrics.pas @@ -592,6 +592,9 @@ procedure TLyricEngine.DrawLyricsLine(IsUpperLine: boolean; Beat: real); // clip non-active right part of the current word ClipPlaneEq[0] := -1; ClipPlaneEq[3] := CurWord^.Width * Progress; + if CurWord^.Freestyle then //add a extra width to fill in full freestyle italic notes + ClipPlaneEq[3] += 5; + glClipPlane(GL_CLIP_PLANE0, @ClipPlaneEq); // and draw active left part glColor4f(LineColor_act.R, LineColor_act.G ,LineColor_act.B, Alpha); diff --git a/src/base/UMain.pas b/src/base/UMain.pas index fb9b0a50..c5dac1e5 100644 --- a/src/base/UMain.pas +++ b/src/base/UMain.pas @@ -98,7 +98,6 @@ implementation USongs, UTime, UWebcam; - //UVideoAcinerella; procedure Main; var @@ -368,7 +367,6 @@ procedure CheckEvents; SimEvent: TSDL_event; KeyCharUnicode: UCS4Char; SimKey: LongWord; - s1: UTF8String; mouseDown: boolean; mouseBtn: integer; mouseX, mouseY: PInt; diff --git a/src/base/UMusic.pas b/src/base/UMusic.pas index 550e8a24..2dfb1d22 100644 --- a/src/base/UMusic.pas +++ b/src/base/UMusic.pas @@ -245,7 +245,7 @@ TSoundFX = class procedure Init(); virtual; abstract; procedure Removed(); virtual; abstract; - class function CanEnable: boolean; virtual; abstract; static; + class function CanEnable: boolean; virtual; abstract; function GetType: DWORD; virtual; abstract; function GetPriority: LongInt; virtual; abstract; diff --git a/src/base/UNote.pas b/src/base/UNote.pas index 0d95d567..d07a13fb 100644 --- a/src/base/UNote.pas +++ b/src/base/UNote.pas @@ -176,7 +176,6 @@ function GetMidBeat(Time: real): real; function GetTimeFromBeat(Beat: integer; SelfSong: TSong = nil): real; var - CurBPM: integer; Song: TSong; begin diff --git a/src/base/UPath.pas b/src/base/UPath.pas index 97ea8ce7..88bfe9ba 100644 --- a/src/base/UPath.pas +++ b/src/base/UPath.pas @@ -791,9 +791,10 @@ function TPathImpl.Append(const Child: IPath; DelimOption: TPathDelimOption): IP TmpResult := Path(Self.AppendPathDelim().ToUTF8() + Child.ToUTF8()); case DelimOption of - pdKeep: Result := TmpResult; pdAppend: Result := TmpResult.AppendPathDelim; pdRemove: Result := TmpResult.RemovePathDelim; + else //pdKeep + Result := TmpResult; end; end; diff --git a/src/base/UPathUtils.pas b/src/base/UPathUtils.pas index c06a7631..80aae165 100644 --- a/src/base/UPathUtils.pas +++ b/src/base/UPathUtils.pas @@ -1,8 +1,8 @@ {* UltraStar WorldParty - Karaoke Game - - UltraStar WorldParty is the legal property of its developers, - whose names are too numerous to list here. Please refer to the + + UltraStar WorldParty is the legal property of its developers, + whose names are too numerous to list here. Please refer to the COPYRIGHT file distributed with this source distribution. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. Check "LICENSE" file. If not, see + along with this program. Check "LICENSE" file. If not, see . *} @@ -57,7 +57,8 @@ interface AvatarsPath: IPath; function FindPath(out PathResult: IPath; const RequestedPath: IPath; NeedsWritePermission: boolean): boolean; -procedure InitializePaths; +procedure InitializePaths(); +procedure InitializeSongPaths(); procedure AddSongPath(const Path: IPath); implementation @@ -187,19 +188,21 @@ procedure InitializePaths; Log.LogWarn('Screenshot directory "'+ UserPath.ToNative +'" not available', 'InitializePaths'); end; - // Add song paths - AddSongPath(Params.SongPath); -{$IF Defined(DARWIN)} - AddSongPath(Platform.GetMusicPath); - AddSongPath(UserPath.Append('songs')); -{$ELSE} - AddSongPath(SharedPath.Append('songs')); - AddSongPath(UserPath.Append('songs')); -{$IFEND} - // Add category cover paths AddCoverPath(SharedPath.Append('covers')); AddCoverPath(UserPath.Append('covers')); end; +procedure InitializeSongPaths(); +begin + SongPaths := TInterfaceList.Create(); + AddSongPath(UCommandLine.Params.SongPath); + AddSongPath(UPlatform.Platform().GetGameUserPath().Append('songs')); + {$IF Defined(DARWIN)} + AddSongPath(UPlatform.Platform().GetMusicPath()); + {$ELSE} + AddSongPath(UPlatform.Platform().GetGameSharedPath().Append('songs')); + {$IFEND} +end; + end. diff --git a/src/base/UPlaylist.pas b/src/base/UPlaylist.pas index c9829553..1c777a42 100644 --- a/src/base/UPlaylist.pas +++ b/src/base/UPlaylist.pas @@ -61,7 +61,7 @@ TPlaylistManager = class private public - CurPlayList: Cardinal; + CurPlayList: integer; CurItem: Cardinal; Playlists: APlaylist; @@ -237,7 +237,7 @@ procedure TPlayListManager.SavePlayList(Index: Cardinal); try // Write version (not nessecary but helpful) TextStream.WriteLine('######################################'); - TextStream.WriteLine('#Ultrastar Deluxe Playlist Format v1.0'); + TextStream.WriteLine('#Ultrastar WorldParty'); TextStream.WriteLine(Format('#Playlist %s with %d Songs.', [ Playlists[Index].Name, Length(Playlists[Index].Items) ])); TextStream.WriteLine('######################################'); diff --git a/src/base/USingScores.pas b/src/base/USingScores.pas index 6f7aeea4..b442f9ef 100644 --- a/src/base/USingScores.pas +++ b/src/base/USingScores.pas @@ -842,6 +842,13 @@ procedure TSingScores.DrawPopUp(const PopUp: PScorePopUp); ScoretoAdd: word; PosDiff: real; begin + X := 0; + Y := 0; + H := 0; + W := 0; + FontSize:= 0; + FontOffset := 0; + { if screens = 2 and playerplay <= 3 the 2nd screen shows the textures of screen 1 } if (Screens = 2) and (PlayersPlay <= 3) then @@ -1373,6 +1380,7 @@ procedure TSingScores.DrawScore(const Index: integer); Drawing: boolean; begin Drawing := false; + Position.BGX := 0; //to fix compilation notice only { if screens = 2 and playerplay <= 3 the 2nd screen shows the textures of screen 1 } @@ -1738,7 +1746,9 @@ procedure TSingScores.DrawRatingBar(const Index: integer); if (Screens = 2) and (PlayersPlay <= 3) then ScreenAct := 1; - Drawing := false; + Drawing := false; + Position.RBX := 0; //to fix compilation notice only + // DIRTY HACK // correct position for duet with 3/6 players and 4/6 players in one screen diff --git a/src/base/USong.pas b/src/base/USong.pas index 17f9a636..d4cd2052 100644 --- a/src/base/USong.pas +++ b/src/base/USong.pas @@ -297,6 +297,7 @@ constructor TSong.Create(const aFileName: IPath); Self.Video := PATH_NONE; Self.VideoGAP := 0; Self.Creator := ''; + Self.Fixer := ''; Self.PreviewStart := 0; Self.Medley.Source := msNone; Self.isDuet := false; diff --git a/src/base/USongs.pas b/src/base/USongs.pas index b8ffe494..6e21f343 100644 --- a/src/base/USongs.pas +++ b/src/base/USongs.pas @@ -165,8 +165,8 @@ constructor TSongsParse.Create(); destructor TSongsParse.Destroy(); begin RTLeventDestroy(Self.Event); - Self.Txts.Destroy(); - Self.TxtsParsed.Destroy(); + Self.Txts.Free(); + Self.TxtsParsed.Free(); inherited; end; @@ -221,13 +221,8 @@ constructor TSongs.Create(); end; destructor TSongs.Destroy(); -var - I: integer; begin RTLeventDestroy(Self.Event); - for I := 0 to Self.CoresAvailable do - Self.Threads[I].Terminate(); - inherited; end; @@ -533,6 +528,7 @@ function TCatSongs.Refresh(Sort: integer; Categories: boolean; Duets: boolean): Self.SortSongs(); CurCategory := ''; SetLength(Self.Song, 0); + NewCategory := nil; for I := 0 to Songs.SongList.Count - 1 do begin NewSong := TSong(Songs.SongList[I]); @@ -621,7 +617,9 @@ function TCatSongs.SetFilter(FilterStr: UTF8String; Filter: TSongFilter = sfAll) WordArray: array of UTF8String; begin Result := 0; - FilterStr := UCommon.RemoveSpecialChars(FilterStr); + if FilterStr <> '' then //FIXME required because fails when cancel a search without results + FilterStr := UCommon.RemoveSpecialChars(FilterStr); + if FilterStr <> '' then begin Self.CatNumShow := -2; @@ -653,6 +651,8 @@ function TCatSongs.SetFilter(FilterStr: UTF8String; Filter: TSongFilter = sfAll) TmpString := Song[I].TitleNoAccent; sfArtist: TmpString := Song[I].ArtistNoAccent; + else + TmpString := ''; end; Song[i].Visible := true; // Look for every searched word @@ -686,6 +686,7 @@ function TCatSongs.ShowCategory(Index: integer): integer; var I: integer; begin + Result := 0; Self.CatNumShow := Index; Self.VisibleSongs := 0; for I := 0 to High(Self.Song) do diff --git a/src/base/UThemes.pas b/src/base/UThemes.pas index 51cc5812..c8a96a69 100644 --- a/src/base/UThemes.pas +++ b/src/base/UThemes.pas @@ -45,7 +45,7 @@ interface const ThemeMinVersion = 19.12; - DefaultTheme = 'Fantasy'; + DefaultTheme = 'Argon'; BGT_Names: array [TBackgroundType] of string = ('none', 'color', 'texture', 'video', 'fade', 'auto'); @@ -269,6 +269,7 @@ TThemePlayerSelector = class(TThemeBasic) SelectPlayerColor: TThemeSelectSlide; SelectPlayerLevel: TThemeSelectSlide; SingButton: TThemeButton; + ExitButton: TThemeButton; end; TThemeSong = class(TThemeBasic) @@ -277,6 +278,8 @@ TThemeSong = class(TThemeBasic) TextNumber: TThemeText; TextTitle: TThemeText; TextYear: TThemeText; + TextCreator: TThemeText; + TextFixer: TThemeText; TextMedleyMax: integer; @@ -285,18 +288,14 @@ TThemeSong = class(TThemeBasic) StaticMedley: array of TThemeStatic; TextNumberMedley: array of TThemeText; - //Video Icon Mod - VideoIcon: TThemeStatic; - - //Medley Icons + //Song icons + VideoIcon: TThemeStatic; MedleyIcon: TThemeStatic; CalculatedMedleyIcon: TThemeStatic; - - //Duet Icon - DuetIcon: TThemeStatic; - - //Rap Icon - RapIcon: TThemeStatic; + DuetIcon: TThemeStatic; + RapIcon: TThemeStatic; + CreatorIcon: TThemeStatic; + FixerIcon: TThemeStatic; //Show Cat in TopLeft Mod TextCat: TThemeText; @@ -353,16 +352,21 @@ TThemeSong = class(TThemeBasic) InfoMessageText: TThemeText; InfoMessageBG: TThemeStatic; - //Screen Song Scores - TextScore: TThemeText; - TextMaxScore: TThemeText; - TextMediaScore: TThemeText; - TextMaxScore2: TThemeText; - TextMediaScore2: TThemeText; - TextScoreUser: TThemeText; - TextMaxScoreLocal: TThemeText; - TextMediaScoreLocal: TThemeText; - TextScoreUserLocal: TThemeText; + //Ranking Song Screen + TextMyScores: TThemeText; + TextWebsite: TThemeText; + TextUserLocalScore1: TThemeText; + TextUserLocalScore2: TThemeText; + TextUserLocalScore3: TThemeText; + TextLocalScore1: TThemeText; + TextLocalScore2: TThemeText; + TextLocalScore3: TThemeText; + TextUserOnlineScore1: TThemeText; + TextUserOnlineScore2: TThemeText; + TextUserOnlineScore3: TThemeText; + TextOnlineScore1: TThemeText; + TextOnlineScore2: TThemeText; + TextOnlineScore3: TThemeText; //Party Mode StaticTeamJoker: TThemeStatic; @@ -785,7 +789,7 @@ TThemeOptions = class(TThemeBasic) ButtonAdvanced: TThemeButton; ButtonNetwork: TThemeButton; ButtonWebcam: TThemeButton; - ButtonJukebox: TThemeButton; + ButtonProfiles: TThemeButton; ButtonExit: TThemeButton; TextDescription: TThemeText; @@ -900,6 +904,10 @@ TThemeOptionsWebcam = class(TThemeBasic) ButtonExit: TThemeButton; end; + TThemeOptionsProfiles = class(TThemeBasic) + ButtonExit: TThemeButton; + end; + //Error- and Check-Popup TThemeError = class(TThemeBasic) Button1: TThemeButton; @@ -938,13 +946,14 @@ TThemeScoreDownload = class(TThemeBasic) DownloadProgressWeb: TThemeStatic; end; - //ScreenSong Menue + //ScreenSong Menu TThemeSongMenu = class(TThemeBasic) Button1: TThemeButton; Button2: TThemeButton; Button3: TThemeButton; Button4: TThemeButton; Button5: TThemeButton; + Button6: TThemeButton; SelectSlide1: TThemeSelectSlide; SelectSlide2: TThemeSelectSlide; @@ -954,9 +963,6 @@ TThemeSongMenu = class(TThemeBasic) end; TThemeSongJumpTo = class(TThemeBasic) - ButtonSearchText: TThemeButton; - SelectSlideType: TThemeSelectSlide; - TextFound: TThemeText; end; //Party Screens @@ -1244,6 +1250,7 @@ TTheme = class OptionsAdvanced: TThemeOptionsAdvanced; OptionsNetwork: TThemeOptionsNetwork; OptionsWebcam: TThemeOptionsWebcam; + OptionsProfiles: TThemeOptionsProfiles; //error and check popup ErrorPopup: TThemeError; CheckPopup: TThemeCheck; @@ -1609,6 +1616,7 @@ function TTheme.LoadTheme(ThemeNum: integer; sColor: integer): boolean; ThemeLoadButton(PlayerSelector.PlayerAvatar, 'NamePlayerAvatar'); Self.ThemeLoadButton(Self.PlayerSelector.SingButton, 'NamePlayerSingButton'); + Self.ThemeLoadButton(Self.PlayerSelector.ExitButton, 'NamePlayerExitButton'); ThemeLoadSelectSlide(PlayerSelector.SelectPlayersCount, 'NameSelectPlayerCount'); ThemeLoadSelectSlide(PlayerSelector.SelectPlayerColor, 'NameSelectPlayerColor'); @@ -2010,7 +2018,7 @@ function TTheme.LoadTheme(ThemeNum: integer; sColor: integer): boolean; ThemeLoadButton(Options.ButtonAdvanced, 'OptionsButtonAdvanced'); ThemeLoadButton(Options.ButtonNetwork, 'OptionsButtonNetwork'); ThemeLoadButton(Options.ButtonWebcam, 'OptionsButtonWebcam'); - ThemeLoadButton(Options.ButtonJukebox, 'OptionsButtonJukebox'); + ThemeLoadButton(Options.ButtonProfiles, 'OptionsButtonProfiles'); ThemeLoadButton(Options.ButtonExit, 'OptionsButtonExit'); ThemeLoadText(Options.TextDescription, 'OptionsTextDescription'); @@ -2134,6 +2142,10 @@ function TTheme.LoadTheme(ThemeNum: integer; sColor: integer): boolean; ThemeLoadButton(OptionsWebcam.ButtonPreVisualization, 'OptionsWebcamButtonPreVisualization'); ThemeLoadButton(OptionsWebcam.ButtonExit, 'OptionsWebcamButtonExit'); + //Options Profiles + ThemeLoadBasic(OptionsProfiles, 'OptionsProfiles'); + ThemeLoadButton(OptionsProfiles.ButtonExit, 'OptionsProfilesButtonExit'); + //error popup ThemeLoadBasic (ErrorPopup, 'ErrorPopup'); ThemeLoadButton(ErrorPopup.Button1, 'ErrorPopupButton1'); @@ -2178,6 +2190,7 @@ function TTheme.LoadTheme(ThemeNum: integer; sColor: integer): boolean; ThemeLoadButton(SongMenu.Button3, 'SongMenuButton3'); ThemeLoadButton(SongMenu.Button4, 'SongMenuButton4'); ThemeLoadButton(SongMenu.Button5, 'SongMenuButton5'); + ThemeLoadButton(SongMenu.Button6, 'SongMenuButton6'); ThemeLoadSelectSlide(SongMenu.SelectSlide1, 'SongMenuSelectSlide1'); ThemeLoadSelectSlide(SongMenu.SelectSlide2, 'SongMenuSelectSlide2'); ThemeLoadSelectSlide(SongMenu.SelectSlide3, 'SongMenuSelectSlide3'); @@ -2185,11 +2198,7 @@ function TTheme.LoadTheme(ThemeNum: integer; sColor: integer): boolean; ThemeLoadText(SongMenu.TextMenu, 'SongMenuTextMenu'); //Song Jumpto - ThemeLoadBasic (SongJumpto, 'SongJumpto'); - ThemeLoadButton(SongJumpto.ButtonSearchText, 'SongJumptoButtonSearchText'); - - ThemeLoadSelectSlide(SongJumpto.SelectSlideType, 'SongJumptoSelectSlideType'); - ThemeLoadText(SongJumpto.TextFound, 'SongJumptoTextFound'); + Self.ThemeLoadBasic(Self.SongJumpto, 'SongJumpto'); //Party Options ThemeLoadBasic(PartyOptions, 'PartyOptions'); @@ -3538,9 +3547,8 @@ procedure TTheme.ThemeScoreLoad; ThemeLoadText(Score.TextTitle, 'ScoreTextTitle'); ThemeLoadText(Score.TextArtistTitle, 'ScoreTextArtistTitle'); - if (Ini.Players < 3) or (Ini.Screens = 1) then - prefix := '' - else + prefix := ''; + if not((Ini.Players < 3) or (Ini.Screens = 1)) then begin // 4 players 1 screen if (Ini.Players = 3) then @@ -3585,6 +3593,7 @@ procedure TTheme.ThemeSongLoad; I, C: integer; prefix, TempString: string; begin + prefix := ''; case (TSongMenuMode(Ini.SongMenu)) of smRoulette: prefix := 'Roulette'; smChessboard: prefix := 'Chessboard'; @@ -3602,6 +3611,8 @@ procedure TTheme.ThemeSongLoad; ThemeLoadText(Song.TextTitle, 'Song' + prefix + 'TextTitle'); ThemeLoadText(Song.TextNumber, 'Song' + prefix + 'TextNumber'); ThemeLoadText(Song.TextYear, 'Song' + prefix + 'TextYear'); + ThemeLoadText(Song.TextCreator, 'Song' + prefix + 'TextCreator'); + ThemeLoadText(Song.TextFixer, 'Song' + prefix + 'TextFixer'); // medley playlist Self.SetInheritance('Song'+prefix+'TextMedleyMax'); @@ -3620,18 +3631,14 @@ procedure TTheme.ThemeSongLoad; ThemeLoadStatic(Song.StaticMedley[I], 'Song' + prefix + 'StaticMedley' + IntToStr(I + 1)); end; - //Video Icon Mod + //Song icons ThemeLoadStatic(Song.VideoIcon, 'Song' + prefix + 'VideoIcon'); - - //Medley Icons ThemeLoadStatic(Song.MedleyIcon, 'Song' + prefix + 'MedleyIcon'); ThemeLoadStatic(Song.CalculatedMedleyIcon, 'Song' + prefix + 'CalculatedMedleyIcon'); - - //Duet Icon ThemeLoadStatic(Song.DuetIcon, 'Song' + prefix + 'DuetIcon'); - - //Rap Icon ThemeLoadStatic(Song.RapIcon, 'Song' + prefix + 'RapIcon'); + ThemeLoadStatic(Song.CreatorIcon, 'Song' + prefix + 'CreatorIcon'); + ThemeLoadStatic(Song.FixerIcon, 'Song' + prefix + 'FixerIcon'); //Show Cat in TopLeft Mod ThemeLoadText(Song.TextCat, 'Song' + prefix + 'TextCat'); @@ -3690,16 +3697,21 @@ procedure TTheme.ThemeSongLoad; ThemeLoadEqualizer(Song.Equalizer, 'Song' + prefix + 'Equalizer'); - //Screen Song Scores - ThemeLoadText(Song.TextScore, 'Song' + prefix + 'TextScore'); - ThemeLoadText(Song.TextMaxScore, 'Song' + prefix + 'TextMaxScore'); - ThemeLoadText(Song.TextMediaScore, 'Song' + prefix + 'TextMediaScore'); - ThemeLoadText(Song.TextMaxScore2, 'Song' + prefix + 'TextMaxScore2'); - ThemeLoadText(Song.TextMediaScore2, 'Song' + prefix + 'TextMediaScore2'); - ThemeLoadText(Song.TextScoreUser, 'Song' + prefix + 'TextScoreUser'); - ThemeLoadText(Song.TextMaxScoreLocal, 'Song' + prefix + 'TextMaxScoreLocal'); - ThemeLoadText(Song.TextMediaScoreLocal, 'Song' + prefix + 'TextMediaScoreLocal'); - ThemeLoadText(Song.TextScoreUserLocal, 'Song' + prefix + 'TextScoreUserLocal'); + //Ranking Song Screen + ThemeLoadText(Song.TextMyScores, 'Song' + prefix + 'TextMyScores'); + ThemeLoadText(Song.TextWebsite, 'Song' + prefix + 'TextWebsite'); + ThemeLoadText(Song.TextUserLocalScore1, 'Song' + prefix + 'TextUserLocalScore1'); + ThemeLoadText(Song.TextUserLocalScore2, 'Song' + prefix + 'TextUserLocalScore2'); + ThemeLoadText(Song.TextUserLocalScore3, 'Song' + prefix + 'TextUserLocalScore3'); + ThemeLoadText(Song.TextLocalScore1, 'Song' + prefix + 'TextLocalScore1'); + ThemeLoadText(Song.TextLocalScore2, 'Song' + prefix + 'TextLocalScore2'); + ThemeLoadText(Song.TextLocalScore3, 'Song' + prefix + 'TextLocalScore3'); + ThemeLoadText(Song.TextUserOnlineScore1, 'Song' + prefix + 'TextUserOnlineScore1'); + ThemeLoadText(Song.TextUserOnlineScore2, 'Song' + prefix + 'TextUserOnlineScore2'); + ThemeLoadText(Song.TextUserOnlineScore3, 'Song' + prefix + 'TextUserOnlineScore3'); + ThemeLoadText(Song.TextOnlineScore1, 'Song' + prefix + 'TextOnlineScore1'); + ThemeLoadText(Song.TextOnlineScore2, 'Song' + prefix + 'TextOnlineScore2'); + ThemeLoadText(Song.TextOnlineScore3, 'Song' + prefix + 'TextOnlineScore3'); //Party and Non Party specific Statics and Texts ThemeLoadStatics (Song.StaticParty, 'Song' + prefix + 'StaticParty'); @@ -3761,6 +3773,7 @@ procedure TTheme.CreateThemeObjects(); Self.OptionsAdvanced := TThemeOptionsAdvanced.Create(); Self.OptionsNetwork := TThemeOptionsNetwork.Create(); Self.OptionsWebcam := TThemeOptionsWebcam.Create(); + Self.OptionsProfiles := TThemeOptionsProfiles.Create(); Self.ErrorPopup := TThemeError.Create(); Self.CheckPopup := TThemeCheck.Create(); Self.InsertUserPopup := TThemeInsertUser.Create(); diff --git a/src/base/UTime.pas b/src/base/UTime.pas index 54cfed0f..59ca4688 100644 --- a/src/base/UTime.pas +++ b/src/base/UTime.pas @@ -43,7 +43,6 @@ TRelativeTimer = class private AbsoluteTime: int64; // system-clock reference time for calculation of CurrentTime RelativeTime: real; - TriggerMode: boolean; State: TRelativeTimerState; public constructor Create(); @@ -218,6 +217,8 @@ function TRelativeTimer.GetTime(): real; AbsoluteTime := SDL_GetTicks(); Result := RelativeTime; end; + else + Result := 0; end; end; diff --git a/src/config-darwin.inc b/src/config-darwin.inc index f77fd3cc..e7d5816b 100644 --- a/src/config-darwin.inc +++ b/src/config-darwin.inc @@ -11,40 +11,30 @@ LUA_VERSION = '5.2.4'; {$IFEND} -{$DEFINE HaveFFmpeg} -{$IF Defined(HaveFFmpeg)} - {$MACRO ON} - {$IFNDEF FFMPEG_DIR} - {$IF (8 > 0) or (2 > 0)} - {$DEFINE FFMPEG_DIR := 'ffmpeg-2.8'} - {$DEFINE FF_API_OLD_DECODE_AUDIO} - {$ELSE} - {$DEFINE FFMPEG_DIR := 'ffmpeg'} - {$DEFINE useOLD_FFMPEG} - {$IFEND} - {$ENDIF} - {$IF Defined(IncludeConstants)} - FFMPEG_VERSION_INT = 2008000; - - av__codec = 'libavcodec'; - LIBAVCODEC_VERSION_MAJOR = 56; - LIBAVCODEC_VERSION_MINOR = 60; - LIBAVCODEC_VERSION_RELEASE = 100; - - av__format = 'libavformat'; - LIBAVFORMAT_VERSION_MAJOR = 56; - LIBAVFORMAT_VERSION_MINOR = 40; - LIBAVFORMAT_VERSION_RELEASE = 101; - - av__util = 'libavutil'; - LIBAVUTIL_VERSION_MAJOR = 54; - LIBAVUTIL_VERSION_MINOR = 31; - LIBAVUTIL_VERSION_RELEASE = 100; - {$IFEND} +{$MACRO ON} +{$IFNDEF FFMPEG_DIR} + {$DEFINE FFMPEG_DIR := 'ffmpeg-4.0'} +{$ENDIF} +{$IF Defined(IncludeConstants)} + FFMPEG_VERSION_INT = 2008000; + +av__codec = 'libavcodec'; +LIBAVCODEC_VERSION_MAJOR = 56; +LIBAVCODEC_VERSION_MINOR = 60; +LIBAVCODEC_VERSION_RELEASE = 100; + +av__format = 'libavformat'; +LIBAVFORMAT_VERSION_MAJOR = 56; +LIBAVFORMAT_VERSION_MINOR = 40; +LIBAVFORMAT_VERSION_RELEASE = 101; + +av__util = 'libavutil'; +LIBAVUTIL_VERSION_MAJOR = 54; +LIBAVUTIL_VERSION_MINOR = 31; +LIBAVUTIL_VERSION_RELEASE = 100; {$IFEND} -{$DEFINE HaveSWScale} -{$IF Defined(HaveSWScale) and Defined(IncludeConstants)} +{$IF Defined(IncludeConstants)} sw__scale = 'libswscale'; LIBSWSCALE_VERSION_MAJOR = 3; LIBSWSCALE_VERSION_MINOR = 1; @@ -59,17 +49,8 @@ PROJECTM_VERSION_RELEASE = 0; {$IFEND} -{$DEFINE HavePortaudio} -{$IF Defined(HavePortaudio) and Defined(IncludeConstants)} - PORTAUDIO_VERSION_MAJOR = 19; - PORTAUDIO_VERSION_MINOR = 0; - PORTAUDIO_VERSION_RELEASE = 0; -{$IFEND} - {$DEFINE HaveLibPcre} {$IF Defined(HaveLibPcre) and Defined(IncludeConstants)} LIBPCRE_LIBNAME = ''; LIBPCRE_LIBDIR = '/usr/local/Cellar/pcre/8.38/lib'; {$IFEND} - -{$UNDEF HavePortmixer} diff --git a/src/config-win.inc b/src/config-win.inc index ccdd501a..4d92f276 100644 --- a/src/config-win.inc +++ b/src/config-win.inc @@ -32,54 +32,41 @@ LUA_INTEGER_BITS = 32; {$IFEND} -{$DEFINE HaveFFmpeg} //the required DLLs can be downloaded here: https://ffmpeg.zeranoe.com/builds/win32/shared/ -{$IF Defined(HaveFFmpeg)} - {$MACRO ON} - {$IFNDEF FFMPEG_DIR} - {$IF (4 > 0) or (2 > 0)} - {$DEFINE FFMPEG_DIR := 'ffmpeg-3.1'} - {$DEFINE FF_API_OLD_DECODE_AUDIO} - {$ELSE} - {$DEFINE FFMPEG_DIR := 'ffmpeg'} - {$DEFINE useOLD_FFMPEG} - {$IFEND} - {$ENDIF} - {$IF Defined(IncludeConstants)} - FFMPEG_VERSION_INT = 3001000; - av__codec = 'avcodec-57'; - LIBAVCODEC_VERSION_MAJOR = 57; - LIBAVCODEC_VERSION_MINOR = 48; - LIBAVCODEC_VERSION_RELEASE = 101; +{$MACRO ON} +{$IFNDEF FFMPEG_DIR} + {$DEFINE FFMPEG_DIR := 'ffmpeg-4.0'} +{$ENDIF} +{$IF Defined(IncludeConstants)} + FFMPEG_VERSION_INT = 4002002; + av__codec = 'avcodec-58'; + LIBAVCODEC_VERSION_MAJOR = 58; + LIBAVCODEC_VERSION_MINOR = 91; + LIBAVCODEC_VERSION_RELEASE = 100; - av__format = 'avformat-57'; - LIBAVFORMAT_VERSION_MAJOR = 57; - LIBAVFORMAT_VERSION_MINOR = 41; - LIBAVFORMAT_VERSION_RELEASE = 100; + av__format = 'avformat-58'; + LIBAVFORMAT_VERSION_MAJOR = 58; + LIBAVFORMAT_VERSION_MINOR = 45; + LIBAVFORMAT_VERSION_RELEASE = 100; - av__util = 'avutil-55'; - LIBAVUTIL_VERSION_MAJOR = 55; - LIBAVUTIL_VERSION_MINOR = 28; - LIBAVUTIL_VERSION_RELEASE = 100; - {$IFEND} -{$IFEND} + av__util = 'avutil-56'; + LIBAVUTIL_VERSION_MAJOR = 56; + LIBAVUTIL_VERSION_MINOR = 51; + LIBAVUTIL_VERSION_RELEASE = 100; -{$DEFINE HaveSWResample} -{$IF Defined(HaveSWScale) and Defined(IncludeConstants)} - sw__resample = 'swresample-2'; - LIBSWRESAMPLE_VERSION_MAJOR = 2; - LIBSWRESAMPLE_VERSION_MINOR = 1; + sw__resample = 'swresample-3'; + LIBSWRESAMPLE_VERSION_MAJOR = 3; + LIBSWRESAMPLE_VERSION_MINOR = 7; LIBSWRESAMPLE_VERSION_RELEASE = 100; -{$IFEND} -{$DEFINE HaveSWScale} -{$IF Defined(HaveSWScale) and Defined(IncludeConstants)} - sw__scale = 'swscale-4'; - LIBSWSCALE_VERSION_MAJOR = 4; - LIBSWSCALE_VERSION_MINOR = 1; + sw__scale = 'swscale-5'; + LIBSWSCALE_VERSION_MAJOR = 5; + LIBSWSCALE_VERSION_MINOR = 7; LIBSWSCALE_VERSION_RELEASE = 100; {$IFEND} +{$DEFINE UseBASS} + {$DEFINE HaveProjectM} {$IF Defined(HaveProjectM) and Defined(IncludeConstants)} ProjectM_DataDir = 'Visuals\projectM'; @@ -88,19 +75,4 @@ PROJECTM_VERSION_RELEASE = 0; {$IFEND} -{$UNDEF HavePortaudio} -{$IF Defined(HavePortaudio) and Defined(IncludeConstants)} - PORTAUDIO_VERSION_MAJOR = 19; - PORTAUDIO_VERSION_MINOR = 0; - PORTAUDIO_VERSION_RELEASE = 0; -{$IFEND} - -{$UNDEF HavePortmixer} - -{$UNDEF HaveLibsamplerate} -{$IF Defined(HaveLibsamplerate) and Defined(IncludeConstants)} - LIBSAMPLERATE_VERSION_MAJOR = 0; - LIBSAMPLERATE_VERSION_MINOR = 1; - LIBSAMPLERATE_VERSION_RELEASE = 3; -{$IFEND} {$DEFINE UseMIDIPort} diff --git a/src/config.inc.in b/src/config.inc.in index 15acba0e..61adb42c 100644 --- a/src/config.inc.in +++ b/src/config.inc.in @@ -37,53 +37,37 @@ LUA_INTEGER_BITS = @LUA_INTEGER_BITS@; {$IFEND} -{$@DEFINE_HAVE_FFMPEG@ HaveFFmpeg} -{$IF Defined(HaveFFmpeg)} - {$MACRO ON} - {$IFNDEF FFMPEG_DIR} - {$IF (@FFMPEG_VERSION_MINOR@ > 0) or (@FFMPEG_VERSION_MAJOR@ > 0)} - {$DEFINE FFMPEG_DIR := 'ffmpeg-@FFMPEG_VERSION_MAJOR@.@FFMPEG_VERSION_MINOR@'} - {$DEFINE FF_API_OLD_DECODE_AUDIO} - {$ELSE} - {$DEFINE FFMPEG_DIR := 'ffmpeg'} - {$DEFINE useOLD_FFMPEG} - {$IFEND} - {$ENDIF} - {$IF Defined(IncludeConstants)} - FFMPEG_VERSION_INT = @FFMPEG_VERSION_INT@; - - av__codec = 'libavcodec'; - LIBAVCODEC_VERSION_MAJOR = @libavcodec_VERSION_MAJOR@; - LIBAVCODEC_VERSION_MINOR = @libavcodec_VERSION_MINOR@; - LIBAVCODEC_VERSION_RELEASE = @libavcodec_VERSION_RELEASE@; - - av__format = 'libavformat'; - LIBAVFORMAT_VERSION_MAJOR = @libavformat_VERSION_MAJOR@; - LIBAVFORMAT_VERSION_MINOR = @libavformat_VERSION_MINOR@; - LIBAVFORMAT_VERSION_RELEASE = @libavformat_VERSION_RELEASE@; - - av__util = 'libavutil'; - LIBAVUTIL_VERSION_MAJOR = @libavutil_VERSION_MAJOR@; - LIBAVUTIL_VERSION_MINOR = @libavutil_VERSION_MINOR@; - LIBAVUTIL_VERSION_RELEASE = @libavutil_VERSION_RELEASE@; - {$IFEND} -{$IFEND} - -{$IF (@FFMPEG_VERSION_MAJOR@ < 4)} - {$DEFINE UseFFmpegResample} +{$MACRO ON} +{$IFNDEF FFMPEG_DIR} + {$DEFINE FFMPEG_DIR := 'ffmpeg-@FFMPEG_VERSION_MAJOR@.@FFMPEG_VERSION_MINOR@'} +{$ENDIF} +{$IF Defined(IncludeConstants)} + FFMPEG_VERSION_INT = @FFMPEG_VERSION_INT@; + +av__codec = 'libavcodec'; +LIBAVCODEC_VERSION_MAJOR = @libavcodec_VERSION_MAJOR@; +LIBAVCODEC_VERSION_MINOR = @libavcodec_VERSION_MINOR@; +LIBAVCODEC_VERSION_RELEASE = @libavcodec_VERSION_RELEASE@; + +av__format = 'libavformat'; +LIBAVFORMAT_VERSION_MAJOR = @libavformat_VERSION_MAJOR@; +LIBAVFORMAT_VERSION_MINOR = @libavformat_VERSION_MINOR@; +LIBAVFORMAT_VERSION_RELEASE = @libavformat_VERSION_RELEASE@; + +av__util = 'libavutil'; +LIBAVUTIL_VERSION_MAJOR = @libavutil_VERSION_MAJOR@; +LIBAVUTIL_VERSION_MINOR = @libavutil_VERSION_MINOR@; +LIBAVUTIL_VERSION_RELEASE = @libavutil_VERSION_RELEASE@; {$IFEND} -{$@DEFINE_HAVE_SWSCALE@ HaveSWScale} -{$IF Defined(HaveSWScale) and Defined(IncludeConstants)} +{$IF Defined(IncludeConstants)} sw__scale = 'libswscale'; LIBSWSCALE_VERSION_MAJOR = @libswscale_VERSION_MAJOR@; LIBSWSCALE_VERSION_MINOR = @libswscale_VERSION_MINOR@; LIBSWSCALE_VERSION_RELEASE = @libswscale_VERSION_RELEASE@; {$IFEND} -{* libswresample was introduced with FFmpeg 0.9 *} -{$@DEFINE_HAVE_SWRESAMPLE@ HaveSWResample} -{$IF Defined(HaveSWResample) and Defined(IncludeConstants)} +{$IF Defined(IncludeConstants)} sw__resample = 'libswresample'; LIBSWRESAMPLE_VERSION_MAJOR = @libswresample_VERSION_MAJOR@; LIBSWRESAMPLE_VERSION_MINOR = @libswresample_VERSION_MINOR@; @@ -97,12 +81,3 @@ PROJECTM_VERSION_MINOR = @libprojectM_VERSION_MINOR@; PROJECTM_VERSION_RELEASE = @libprojectM_VERSION_RELEASE@; {$IFEND} - -{$@DEFINE_HAVE_PORTAUDIO@ HavePortaudio} -{$IF Defined(HavePortaudio) and Defined(IncludeConstants)} - PORTAUDIO_VERSION_MAJOR = @portaudio_VERSION_MAJOR@; - PORTAUDIO_VERSION_MINOR = @portaudio_VERSION_MINOR@; - PORTAUDIO_VERSION_RELEASE = @portaudio_VERSION_RELEASE@; -{$IFEND} - -{$@DEFINE_HAVE_PORTMIXER@ HavePortmixer} diff --git a/src/encoding/Auto.inc b/src/encoding/Auto.inc index 81a1d7cd..02a3d8e0 100644 --- a/src/encoding/Auto.inc +++ b/src/encoding/Auto.inc @@ -97,8 +97,6 @@ begin end; function TEncoderAuto.Decode(const InStr: AnsiString; out OutStr: UCS4String): boolean; -var - RegexResults: Integer; begin if IsUtf8(InStr) then Result := UTF8Encoder.Decode(InStr, OutStr) diff --git a/src/lib/FreeImage/FreeBitmap.pas b/src/lib/FreeImage/FreeBitmap.pas deleted file mode 100644 index d32fb5cb..00000000 --- a/src/lib/FreeImage/FreeBitmap.pas +++ /dev/null @@ -1,1742 +0,0 @@ -unit FreeBitmap; - -// ========================================================== -// -// Delphi wrapper for FreeImage 3 -// -// Design and implementation by -// - Anatoliy Pulyaevskiy (xvel84@rambler.ru) -// -// Contributors: -// - Enzo Costantini (enzocostantini@libero.it) -// -// This file is part of FreeImage 3 -// -// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY -// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES -// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE -// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED -// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT -// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY -// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL -// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER -// THIS DISCLAIMER. -// -// Use at your own risk! -// -// ========================================================== -// -// From begining all code of this file is based on C++ wrapper to -// FreeImage - FreeImagePlus. -// -// ========================================================== - -{$IFDEF FPC} - {$MODE Delphi} - {$H+} // use long strings -{$ENDIF} - -interface - -uses - SysUtils, Classes, Windows, FreeImage; - -type - { TFreeObject } - - TFreeObject = class(TObject) - public - function IsValid: Boolean; virtual; - end; - - { TFreeTag } - - TFreeTag = class(TFreeObject) - private - // fields - FTag: PFITAG; - - // getters & setters - function GetCount: Cardinal; - function GetDescription: string; - function GetID: Word; - function GetKey: string; - function GetLength: Cardinal; - function GetTagType: FREE_IMAGE_MDTYPE; - function GetValue: Pointer; - procedure SetCount(const Value: Cardinal); - procedure SetDescription(const Value: string); - procedure SetID(const Value: Word); - procedure SetKey(const Value: string); - procedure SetLength(const Value: Cardinal); - procedure SetTagType(const Value: FREE_IMAGE_MDTYPE); - procedure SetValue(const Value: Pointer); - public - // construction & destruction - constructor Create(ATag: PFITAG = nil); virtual; - destructor Destroy; override; - - // methods - function Clone: TFreeTag; - function IsValid: Boolean; override; - function ToString(Model: FREE_IMAGE_MDMODEL; Make: PChar = nil): string; - - // properties - property Key: string read GetKey write SetKey; - property Description: string read GetDescription write SetDescription; - property ID: Word read GetID write SetID; - property TagType: FREE_IMAGE_MDTYPE read GetTagType write SetTagType; - property Count: Cardinal read GetCount write SetCount; - property Length: Cardinal read GetLength write SetLength; - property Value: Pointer read GetValue write SetValue; - property Tag: PFITAG read FTag; - end; - - { forward declarations } - - TFreeBitmap = class; - TFreeMemoryIO = class; - - { TFreeBitmap } - - TFreeBitmapChangingEvent = procedure(Sender: TFreeBitmap; var OldDib, NewDib: PFIBITMAP; var Handled: Boolean) of object; - - TFreeBitmap = class(TFreeObject) - private - // fields - FDib: PFIBITMAP; - FOnChange: TNotifyEvent; - FOnChanging: TFreeBitmapChangingEvent; - - procedure SetDib(Value: PFIBITMAP); - protected - function DoChanging(var OldDib, NewDib: PFIBITMAP): Boolean; dynamic; - function Replace(NewDib: PFIBITMAP): Boolean; dynamic; - public - constructor Create(ImageType: FREE_IMAGE_TYPE = FIT_BITMAP; Width: Integer = 0; Height: Integer = 0; Bpp: Integer = 0); - destructor Destroy; override; - function SetSize(ImageType: FREE_IMAGE_TYPE; Width, Height, Bpp: Integer; RedMask: Cardinal = 0; GreenMask: Cardinal = 0; BlueMask: Cardinal = 0): Boolean; - procedure Change; dynamic; - procedure Assign(Source: TFreeBitmap); - function CopySubImage(Left, Top, Right, Bottom: Integer; Dest: TFreeBitmap): Boolean; - function PasteSubImage(Src: TFreeBitmap; Left, Top: Integer; Alpha: Integer = 256): Boolean; - procedure Clear; virtual; - function Load(const FileName: string; Flag: Integer = 0): Boolean; - function LoadU(const FileName: WideString; Flag: Integer = 0): Boolean; - function LoadFromHandle(IO: PFreeImageIO; Handle: fi_handle; Flag: Integer = 0): Boolean; - function LoadFromMemory(MemIO: TFreeMemoryIO; Flag: Integer = 0): Boolean; - function LoadFromStream(Stream: TStream; Flag: Integer = 0): Boolean; - // save functions - function CanSave(fif: FREE_IMAGE_FORMAT): Boolean; - function Save(const FileName: string; Flag: Integer = 0): Boolean; - function SaveU(const FileName: WideString; Flag: Integer = 0): Boolean; - function SaveToHandle(fif: FREE_IMAGE_FORMAT; IO: PFreeImageIO; Handle: fi_handle; Flag: Integer = 0): Boolean; - function SaveToMemory(fif: FREE_IMAGE_FORMAT; MemIO: TFreeMemoryIO; Flag: Integer = 0): Boolean; - function SaveToStream(fif: FREE_IMAGE_FORMAT; Stream: TStream; Flag: Integer = 0): Boolean; - // image information - function GetImageType: FREE_IMAGE_TYPE; - function GetWidth: Integer; - function GetHeight: Integer; - function GetScanWidth: Integer; - function IsValid: Boolean; override; - function GetInfo: PBitmapInfo; - function GetInfoHeader: PBitmapInfoHeader; - function GetImageSize: Cardinal; - function GetBitsPerPixel: Integer; - function GetLine: Integer; - function GetHorizontalResolution: Double; - function GetVerticalResolution: Double; - procedure SetHorizontalResolution(Value: Double); - procedure SetVerticalResolution(Value: Double); - // palette operations - function GetPalette: PRGBQUAD; - function GetPaletteSize: Integer; - function GetColorsUsed: Integer; - function GetColorType: FREE_IMAGE_COLOR_TYPE; - function IsGrayScale: Boolean; - // pixels access - function AccessPixels: PByte; - function GetScanLine(ScanLine: Integer): PByte; - function GetPixelIndex(X, Y: Cardinal; var Value: PByte): Boolean; - function GetPixelColor(X, Y: Cardinal; Value: PRGBQUAD): Boolean; - function SetPixelIndex(X, Y: Cardinal; Value: PByte): Boolean; - function SetPixelColor(X, Y: Cardinal; Value: PRGBQUAD): Boolean; - // convertion - function ConvertToStandardType(ScaleLinear: Boolean): Boolean; - function ConvertToType(ImageType: FREE_IMAGE_TYPE; ScaleLinear: Boolean): Boolean; - function Threshold(T: Byte): Boolean; - function ConvertTo4Bits: Boolean; - function ConvertTo8Bits: Boolean; - function ConvertTo16Bits555: Boolean; - function ConvertTo16Bits565: Boolean; - function ConvertTo24Bits: Boolean; - function ConvertTo32Bits: Boolean; - function ConvertToGrayscale: Boolean; - function ColorQuantize(Algorithm: FREE_IMAGE_QUANTIZE): Boolean; - function Dither(Algorithm: FREE_IMAGE_DITHER): Boolean; - function ConvertToRGBF: Boolean; - function ToneMapping(TMO: FREE_IMAGE_TMO; FirstParam, SecondParam: Double): Boolean; - // transparency - function IsTransparent: Boolean; - function GetTransparencyCount: Cardinal; - function GetTransparencyTable: PByte; - procedure SetTransparencyTable(Table: PByte; Count: Integer); - function HasFileBkColor: Boolean; - function GetFileBkColor(var BkColor: PRGBQuad): Boolean; - function SetFileBkColor(BkColor: PRGBQuad): Boolean; - // channel processing routines - function GetChannel(Bitmap: TFreeBitmap; Channel: FREE_IMAGE_COLOR_CHANNEL): Boolean; - function SetChannel(Bitmap: TFreeBitmap; Channel: FREE_IMAGE_COLOR_CHANNEL): Boolean; - function SplitChannels(RedChannel, GreenChannel, BlueChannel: TFreeBitmap): Boolean; - function CombineChannels(Red, Green, Blue: TFreeBitmap): Boolean; - // rotation and flipping - function RotateEx(Angle, XShift, YShift, XOrigin, YOrigin: Double; UseMask: Boolean): Boolean; - function Rotate(Angle: Double): Boolean; - function FlipHorizontal: Boolean; - function FlipVertical: Boolean; - // color manipulation routines - function Invert: Boolean; - function AdjustCurve(Lut: PByte; Channel: FREE_IMAGE_COLOR_CHANNEL): Boolean; - function AdjustGamma(Gamma: Double): Boolean; - function AdjustBrightness(Percentage: Double): Boolean; - function AdjustContrast(Percentage: Double): Boolean; - function GetHistogram(Histo: PDWORD; Channel: FREE_IMAGE_COLOR_CHANNEL = FICC_BLACK): Boolean; - // upsampling / downsampling - procedure MakeThumbnail(const Width, Height: Integer; DestBitmap: TFreeBitmap); - function Rescale(NewWidth, NewHeight: Integer; Filter: FREE_IMAGE_FILTER; Dest: TFreeBitmap = nil): Boolean; - // metadata routines - function FindFirstMetadata(Model: FREE_IMAGE_MDMODEL; var Tag: TFreeTag): PFIMETADATA; - function FindNextMetadata(MDHandle: PFIMETADATA; var Tag: TFreeTag): Boolean; - procedure FindCloseMetadata(MDHandle: PFIMETADATA); - function SetMetadata(Model: FREE_IMAGE_MDMODEL; const Key: string; Tag: TFreeTag): Boolean; - function GetMetadata(Model: FREE_IMAGE_MDMODEL; const Key: string; var Tag: TFreeTag): Boolean; - function GetMetadataCount(Model: FREE_IMAGE_MDMODEL): Cardinal; - - // properties - property Dib: PFIBITMAP read FDib write SetDib; - property OnChange: TNotifyEvent read FOnChange write FOnChange; - property OnChanging: TFreeBitmapChangingEvent read FOnChanging write FOnChanging; - end; - - { TFreeWinBitmap } - - - { TFreeMemoryIO } - - TFreeMemoryIO = class(TFreeObject) - private - FHMem: PFIMEMORY; - public - // construction and destruction - constructor Create(Data: PByte = nil; SizeInBytes: DWORD = 0); - destructor Destroy; override; - - function GetFileType: FREE_IMAGE_FORMAT; - function Read(fif: FREE_IMAGE_FORMAT; Flag: Integer = 0): PFIBITMAP; - function Write(fif: FREE_IMAGE_FORMAT; dib: PFIBITMAP; Flag: Integer = 0): Boolean; - function Tell: Longint; - function Seek(Offset: Longint; Origin: Word): Boolean; - function Acquire(var Data: PByte; var SizeInBytes: DWORD): Boolean; - // overriden methods - function IsValid: Boolean; override; - end; - - { TFreeMultiBitmap } - - TFreeMultiBitmap = class(TFreeObject) - private - FMPage: PFIMULTIBITMAP; - FMemoryCache: Boolean; - public - // constructor and destructor - constructor Create(KeepCacheInMemory: Boolean = False); - destructor Destroy; override; - - // methods - function Open(const FileName: string; CreateNew, ReadOnly: Boolean; Flags: Integer = 0): Boolean; - function Close(Flags: Integer = 0): Boolean; - function GetPageCount: Integer; - procedure AppendPage(Bitmap: TFreeBitmap); - procedure InsertPage(Page: Integer; Bitmap: TFreeBitmap); - procedure DeletePage(Page: Integer); - function MovePage(Target, Source: Integer): Boolean; - procedure LockPage(Page: Integer; DestBitmap: TFreeBitmap); - procedure UnlockPage(Bitmap: TFreeBitmap; Changed: Boolean); - function GetLockedPageNumbers(var Pages: Integer; var Count: Integer): Boolean; - // overriden methods - function IsValid: Boolean; override; - - // properties - // change of this property influences only on the next opening of a file - property MemoryCache: Boolean read FMemoryCache write FMemoryCache; - end; - -implementation - -const - ThumbSize = 150; - -// marker used for clipboard copy / paste - -procedure SetFreeImageMarker(bmih: PBitmapInfoHeader; dib: PFIBITMAP); -begin - // Windows constants goes from 0L to 5L - // Add $FF to avoid conflicts - bmih.biCompression := $FF + FreeImage_GetImageType(dib); -end; - -function GetFreeImageMarker(bmih: PBitmapInfoHeader): FREE_IMAGE_TYPE; -begin - Result := FREE_IMAGE_TYPE(bmih.biCompression - $FF); -end; - -{ TFreePersistent } - -function TFreeObject.IsValid: Boolean; -begin - Result := False -end; - -{ TFreeBitmap } - -function TFreeBitmap.AccessPixels: PByte; -begin - Result := FreeImage_GetBits(FDib) -end; - -function TFreeBitmap.AdjustBrightness(Percentage: Double): Boolean; -begin - if FDib <> nil then - begin - Result := FreeImage_AdjustBrightness(FDib, Percentage); - Change; - end - else - Result := False -end; - -function TFreeBitmap.AdjustContrast(Percentage: Double): Boolean; -begin - if FDib <> nil then - begin - Result := FreeImage_AdjustContrast(FDib, Percentage); - Change; - end - else - Result := False -end; - -function TFreeBitmap.AdjustCurve(Lut: PByte; - Channel: FREE_IMAGE_COLOR_CHANNEL): Boolean; -begin - if FDib <> nil then - begin - Result := FreeImage_AdjustCurve(FDib, Lut, Channel); - Change; - end - else - Result := False -end; - -function TFreeBitmap.AdjustGamma(Gamma: Double): Boolean; -begin - if FDib <> nil then - begin - Result := FreeImage_AdjustGamma(FDib, Gamma); - Change; - end - else - Result := False -end; - -procedure TFreeBitmap.Assign(Source: TFreeBitmap); -var - SourceBmp: TFreeBitmap; - Clone: PFIBITMAP; -begin - if Source = nil then - begin - Clear; - Exit; - end; - - if Source is TFreeBitmap then - begin - SourceBmp := TFreeBitmap(Source); - if SourceBmp <> Self then - begin - if SourceBmp.IsValid then - begin - Clone := FreeImage_Clone(SourceBmp.FDib); - Replace(Clone); - end - else - Clear; - end; - end; -end; - -function TFreeBitmap.CanSave(fif: FREE_IMAGE_FORMAT): Boolean; -var - ImageType: FREE_IMAGE_TYPE; - Bpp: Word; -begin - Result := False; - if not IsValid then Exit; - - if fif <> FIF_UNKNOWN then - begin - // check that the dib can be saved in this format - ImageType := FreeImage_GetImageType(FDib); - if ImageType = FIT_BITMAP then - begin - // standard bitmap type - Bpp := FreeImage_GetBPP(FDib); - Result := FreeImage_FIFSupportsWriting(fif) - and FreeImage_FIFSupportsExportBPP(fif, Bpp); - end - else // special bitmap type - Result := FreeImage_FIFSupportsExportType(fif, ImageType); - end; -end; - -procedure TFreeBitmap.Change; -begin - if Assigned(FOnChange) then FOnChange(Self) -end; - -procedure TFreeBitmap.Clear; -begin - if FDib <> nil then - begin - FreeImage_Unload(FDib); - FDib := nil; - Change; - end; -end; - -function TFreeBitmap.ColorQuantize( - Algorithm: FREE_IMAGE_QUANTIZE): Boolean; -var - dib8: PFIBITMAP; -begin - if FDib <> nil then - begin - dib8 := FreeImage_ColorQuantize(FDib, Algorithm); - Result := Replace(dib8); - end - else - Result := False; -end; - -function TFreeBitmap.CombineChannels(Red, Green, - Blue: TFreeBitmap): Boolean; -var - Width, Height: Integer; -begin - if FDib = nil then - begin - Width := Red.GetWidth; - Height := Red.GetHeight; - FDib := FreeImage_Allocate(Width, Height, 24, FI_RGBA_RED_MASK, - FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - end; - - if FDib <> nil then - begin - Result := FreeImage_SetChannel(FDib, Red.FDib, FICC_RED) and - FreeImage_SetChannel(FDib, Green.FDib, FICC_GREEN) and - FreeImage_SetChannel(FDib, Blue.FDib, FICC_BLUE); - - Change - end - else - Result := False; -end; - -function TFreeBitmap.ConvertTo16Bits555: Boolean; -var - dib16_555: PFIBITMAP; -begin - if FDib <> nil then - begin - dib16_555 := FreeImage_ConvertTo16Bits555(FDib); - Result := Replace(dib16_555); - end - else - Result := False -end; - -function TFreeBitmap.ConvertTo16Bits565: Boolean; -var - dib16_565: PFIBITMAP; -begin - if FDib <> nil then - begin - dib16_565 := FreeImage_ConvertTo16Bits565(FDib); - Result := Replace(dib16_565); - end - else - Result := False -end; - -function TFreeBitmap.ConvertTo24Bits: Boolean; -var - dibRGB: PFIBITMAP; -begin - if FDib <> nil then - begin - dibRGB := FreeImage_ConvertTo24Bits(FDib); - Result := Replace(dibRGB); - end - else - Result := False -end; - -function TFreeBitmap.ConvertTo32Bits: Boolean; -var - dib32: PFIBITMAP; -begin - if FDib <> nil then - begin - dib32 := FreeImage_ConvertTo32Bits(FDib); - Result := Replace(dib32); - end - else - Result := False -end; - -function TFreeBitmap.ConvertTo4Bits: Boolean; -var - dib4: PFIBITMAP; -begin - Result := False; - if IsValid then - begin - dib4 := FreeImage_ConvertTo4Bits(FDib); - Result := Replace(dib4); - end; -end; - -function TFreeBitmap.ConvertTo8Bits: Boolean; -var - dib8: PFIBITMAP; -begin - if FDib <> nil then - begin - dib8 := FreeImage_ConvertTo8Bits(FDib); - Result := Replace(dib8); - end - else - Result := False -end; - -function TFreeBitmap.ConvertToGrayscale: Boolean; -var - dib8: PFIBITMAP; -begin - Result := False; - - if IsValid then - begin - dib8 := FreeImage_ConvertToGreyscale(FDib); - Result := Replace(dib8); - end -end; - -function TFreeBitmap.ConvertToRGBF: Boolean; -var - ImageType: FREE_IMAGE_TYPE; - NewDib: PFIBITMAP; -begin - Result := False; - if not IsValid then Exit; - - ImageType := GetImageType; - - if (ImageType = FIT_BITMAP) then - begin - if GetBitsPerPixel < 24 then - if not ConvertTo24Bits then - Exit - end; - NewDib := FreeImage_ConvertToRGBF(FDib); - Result := Replace(NewDib); -end; - -function TFreeBitmap.ConvertToStandardType(ScaleLinear: Boolean): Boolean; -var - dibStandard: PFIBITMAP; -begin - if IsValid then - begin - dibStandard := FreeImage_ConvertToStandardType(FDib, ScaleLinear); - Result := Replace(dibStandard); - end - else - Result := False; -end; - -function TFreeBitmap.ConvertToType(ImageType: FREE_IMAGE_TYPE; - ScaleLinear: Boolean): Boolean; -var - dib: PFIBITMAP; -begin - if FDib <> nil then - begin - dib := FreeImage_ConvertToType(FDib, ImageType, ScaleLinear); - Result := Replace(dib) - end - else - Result := False -end; - -function TFreeBitmap.CopySubImage(Left, Top, Right, Bottom: Integer; - Dest: TFreeBitmap): Boolean; -begin - if FDib <> nil then - begin - Dest.FDib := FreeImage_Copy(FDib, Left, Top, Right, Bottom); - Result := Dest.IsValid; - end else - Result := False; -end; - -constructor TFreeBitmap.Create(ImageType: FREE_IMAGE_TYPE; Width, Height, - Bpp: Integer); -begin - inherited Create; - - FDib := nil; - if (Width > 0) and (Height > 0) and (Bpp > 0) then - SetSize(ImageType, Width, Height, Bpp); -end; - -destructor TFreeBitmap.Destroy; -begin - if FDib <> nil then - FreeImage_Unload(FDib); - inherited; -end; - -function TFreeBitmap.Dither(Algorithm: FREE_IMAGE_DITHER): Boolean; -var - dib: PFIBITMAP; -begin - if FDib <> nil then - begin - dib := FreeImage_Dither(FDib, Algorithm); - Result := Replace(dib); - end - else - Result := False; -end; - -function TFreeBitmap.DoChanging(var OldDib, NewDib: PFIBITMAP): Boolean; -begin - Result := False; - if (OldDib <> NewDib) and Assigned(FOnChanging) then - FOnChanging(Self, OldDib, NewDib, Result); -end; - -procedure TFreeBitmap.FindCloseMetadata(MDHandle: PFIMETADATA); -begin - FreeImage_FindCloseMetadata(MDHandle); -end; - -function TFreeBitmap.FindFirstMetadata(Model: FREE_IMAGE_MDMODEL; - var Tag: TFreeTag): PFIMETADATA; -begin - Result := FreeImage_FindFirstMetadata(Model, FDib, Tag.FTag); -end; - -function TFreeBitmap.FindNextMetadata(MDHandle: PFIMETADATA; - var Tag: TFreeTag): Boolean; -begin - Result := FreeImage_FindNextMetadata(MDHandle, Tag.FTag); -end; - -function TFreeBitmap.FlipHorizontal: Boolean; -begin - if FDib <> nil then - begin - Result := FreeImage_FlipHorizontal(FDib); - Change; - end - else - Result := False -end; - -function TFreeBitmap.FlipVertical: Boolean; -begin - if FDib <> nil then - begin - Result := FreeImage_FlipVertical(FDib); - Change; - end - else - Result := False -end; - -function TFreeBitmap.GetBitsPerPixel: Integer; -begin - Result := FreeImage_GetBPP(FDib) -end; - -function TFreeBitmap.GetChannel(Bitmap: TFreeBitmap; - Channel: FREE_IMAGE_COLOR_CHANNEL): Boolean; -begin - if FDib <> nil then - begin - Bitmap.Dib := FreeImage_GetChannel(FDib, Channel); - Result := Bitmap.IsValid; - end - else - Result := False -end; - -function TFreeBitmap.GetColorsUsed: Integer; -begin - Result := FreeImage_GetColorsUsed(FDib) -end; - -function TFreeBitmap.GetColorType: FREE_IMAGE_COLOR_TYPE; -begin - Result := FreeImage_GetColorType(FDib); -end; - -function TFreeBitmap.GetFileBkColor(var BkColor: PRGBQuad): Boolean; -begin - Result := FreeImage_GetBackgroundColor(FDib, BkColor) -end; - -function TFreeBitmap.GetHeight: Integer; -begin - Result := FreeImage_GetHeight(FDib) -end; - -function TFreeBitmap.GetHistogram(Histo: PDWORD; - Channel: FREE_IMAGE_COLOR_CHANNEL): Boolean; -begin - if FDib <> nil then - Result := FreeImage_GetHistogram(FDib, Histo, Channel) - else - Result := False -end; - -function TFreeBitmap.GetHorizontalResolution: Double; -begin - Result := FreeImage_GetDotsPerMeterX(FDib) / 100 -end; - -function TFreeBitmap.GetImageSize: Cardinal; -begin - Result := FreeImage_GetDIBSize(FDib); -end; - -function TFreeBitmap.GetImageType: FREE_IMAGE_TYPE; -begin - Result := FreeImage_GetImageType(FDib); -end; - -function TFreeBitmap.GetInfo: PBitmapInfo; -begin - Result := FreeImage_GetInfo(FDib^) -end; - -function TFreeBitmap.GetInfoHeader: PBITMAPINFOHEADER; -begin - Result := FreeImage_GetInfoHeader(FDib) -end; - -function TFreeBitmap.GetLine: Integer; -begin - Result := FreeImage_GetLine(FDib) -end; - -function TFreeBitmap.GetMetadata(Model: FREE_IMAGE_MDMODEL; - const Key: string; var Tag: TFreeTag): Boolean; -begin - Result := FreeImage_GetMetaData(Model, FDib, PChar(Key), Tag.FTag); -end; - -function TFreeBitmap.GetMetadataCount(Model: FREE_IMAGE_MDMODEL): Cardinal; -begin - Result := FreeImage_GetMetadataCount(Model, FDib); -end; - -function TFreeBitmap.GetPalette: PRGBQUAD; -begin - Result := FreeImage_GetPalette(FDib) -end; - -function TFreeBitmap.GetPaletteSize: Integer; -begin - Result := FreeImage_GetColorsUsed(FDib) * SizeOf(RGBQUAD) -end; - -function TFreeBitmap.GetPixelColor(X, Y: Cardinal; Value: PRGBQUAD): Boolean; -begin - Result := FreeImage_GetPixelColor(FDib, X, Y, Value) -end; - -function TFreeBitmap.GetPixelIndex(X, Y: Cardinal; - var Value: PByte): Boolean; -begin - Result := FreeImage_GetPixelIndex(FDib, X, Y, Value) -end; - -function TFreeBitmap.GetScanLine(ScanLine: Integer): PByte; -var - H: Integer; -begin - H := FreeImage_GetHeight(FDib); - if ScanLine < H then - Result := FreeImage_GetScanLine(FDib, ScanLine) - else - Result := nil; -end; - -function TFreeBitmap.GetScanWidth: Integer; -begin - Result := FreeImage_GetPitch(FDib) -end; - -function TFreeBitmap.GetTransparencyCount: Cardinal; -begin - Result := FreeImage_GetTransparencyCount(FDib) -end; - -function TFreeBitmap.GetTransparencyTable: PByte; -begin - Result := FreeImage_GetTransparencyTable(FDib) -end; - -function TFreeBitmap.GetVerticalResolution: Double; -begin - Result := FreeImage_GetDotsPerMeterY(Fdib) / 100 -end; - -function TFreeBitmap.GetWidth: Integer; -begin - Result := FreeImage_GetWidth(FDib) -end; - -function TFreeBitmap.HasFileBkColor: Boolean; -begin - Result := FreeImage_HasBackgroundColor(FDib) -end; - -function TFreeBitmap.Invert: Boolean; -begin - if FDib <> nil then - begin - Result := FreeImage_Invert(FDib); - Change; - end - else - Result := False -end; - -function TFreeBitmap.IsGrayScale: Boolean; -begin - Result := (FreeImage_GetBPP(FDib) = 8) - and (FreeImage_GetColorType(FDib) = FIC_PALETTE); -end; - -function TFreeBitmap.IsTransparent: Boolean; -begin - Result := FreeImage_IsTransparent(FDib); -end; - -function TFreeBitmap.IsValid: Boolean; -begin - Result := FDib <> nil -end; - -function TFreeBitmap.Load(const FileName: string; Flag: Integer): Boolean; -var - fif: FREE_IMAGE_FORMAT; -begin - - // check the file signature and get its format - fif := FreeImage_GetFileType(PChar(Filename), 0); - if fif = FIF_UNKNOWN then - // no signature? - // try to guess the file format from the file extention - fif := FreeImage_GetFIFFromFilename(PChar(FileName)); - - // check that the plugin has reading capabilities ... - if (fif <> FIF_UNKNOWN) and FreeImage_FIFSupportsReading(FIF) then - begin - // free the previous dib - if FDib <> nil then - FreeImage_Unload(dib); - - // load the file - FDib := FreeImage_Load(fif, PChar(FileName), Flag); - - Change; - Result := IsValid; - end else - Result := False; -end; - -function TFreeBitmap.LoadFromHandle(IO: PFreeImageIO; Handle: fi_handle; - Flag: Integer): Boolean; -var - fif: FREE_IMAGE_FORMAT; -begin - // check the file signature and get its format - fif := FreeImage_GetFileTypeFromHandle(IO, Handle, 16); - if (fif <> FIF_UNKNOWN) and FreeImage_FIFSupportsReading(fif) then - begin - // free the previous dib - if FDib <> nil then - FreeImage_Unload(FDib); - - // load the file - FDib := FreeImage_LoadFromHandle(fif, IO, Handle, Flag); - - Change; - Result := IsValid; - end else - Result := False; -end; - -function TFreeBitmap.LoadFromMemory(MemIO: TFreeMemoryIO; - Flag: Integer): Boolean; -var - fif: FREE_IMAGE_FORMAT; -begin - - // check the file signature and get its format - fif := MemIO.GetFileType; - if (fif <> FIF_UNKNOWN) and FreeImage_FIFSupportsReading(fif) then - begin - // free the previous dib - if FDib <> nil then - FreeImage_Unload(FDib); - - // load the file - FDib := MemIO.Read(fif, Flag); - - Result := IsValid; - Change; - end else - Result := False; -end; - -function TFreeBitmap.LoadFromStream(Stream: TStream; - Flag: Integer): Boolean; -var - MemIO: TFreeMemoryIO; - Data: PByte; - MemStream: TMemoryStream; - Size: Cardinal; -begin - Size := Stream.Size; - - MemStream := TMemoryStream.Create; - try - MemStream.CopyFrom(Stream, Size); - Data := MemStream.Memory; - - MemIO := TFreeMemoryIO.Create(Data, Size); - try - Result := LoadFromMemory(MemIO); - finally - MemIO.Free; - end; - finally - MemStream.Free; - end; -end; - -function TFreeBitmap.LoadU(const FileName: WideString; - Flag: Integer): Boolean; -var - fif: FREE_IMAGE_FORMAT; -begin - - // check the file signature and get its format - fif := FreeImage_GetFileTypeU(PWideChar(Filename), 0); - if fif = FIF_UNKNOWN then - // no signature? - // try to guess the file format from the file extention - fif := FreeImage_GetFIFFromFilenameU(PWideChar(FileName)); - - // check that the plugin has reading capabilities ... - if (fif <> FIF_UNKNOWN) and FreeImage_FIFSupportsReading(FIF) then - begin - // free the previous dib - if FDib <> nil then - FreeImage_Unload(dib); - - // load the file - FDib := FreeImage_LoadU(fif, PWideChar(FileName), Flag); - - Change; - Result := IsValid; - end else - Result := False; -end; - -procedure TFreeBitmap.MakeThumbnail(const Width, Height: Integer; - DestBitmap: TFreeBitmap); -type - PRGB24 = ^TRGB24; - TRGB24 = packed record - B: Byte; - G: Byte; - R: Byte; - end; -var - x, y, ix, iy: integer; - x1, x2, x3: integer; - - xscale, yscale: single; - iRed, iGrn, iBlu, iRatio: Longword; - p, c1, c2, c3, c4, c5: TRGB24; - pt, pt1: PRGB24; - iSrc, iDst, s1: integer; - i, j, r, g, b, tmpY: integer; - - RowDest, RowSource, RowSourceStart: integer; - w, h: Integer; - dxmin, dymin: integer; - ny1, ny2, ny3: integer; - dx, dy: integer; - lutX, lutY: array of integer; - - SrcBmp, DestBmp: PFIBITMAP; -begin - if not IsValid then Exit; - - if (GetWidth <= ThumbSize) and (GetHeight <= ThumbSize) then - begin - DestBitmap.Assign(Self); - Exit; - end; - - w := Width; - h := Height; - - // prepare bitmaps - if GetBitsPerPixel <> 24 then - SrcBmp := FreeImage_ConvertTo24Bits(FDib) - else - SrcBmp := FDib; - DestBmp := FreeImage_Allocate(w, h, 24); - Assert(DestBmp <> nil, 'TFreeBitmap.MakeThumbnail error'); - -{ iDst := (w * 24 + 31) and not 31; - iDst := iDst div 8; //BytesPerScanline - iSrc := (GetWidth * 24 + 31) and not 31; - iSrc := iSrc div 8; -} - // BytesPerScanline - iDst := FreeImage_GetPitch(DestBmp); - iSrc := FreeImage_GetPitch(SrcBmp); - - xscale := 1 / (w / FreeImage_GetWidth(SrcBmp)); - yscale := 1 / (h / FreeImage_GetHeight(SrcBmp)); - - // X lookup table - SetLength(lutX, w); - x1 := 0; - x2 := trunc(xscale); - for x := 0 to w - 1 do - begin - lutX[x] := x2 - x1; - x1 := x2; - x2 := trunc((x + 2) * xscale); - end; - - // Y lookup table - SetLength(lutY, h); - x1 := 0; - x2 := trunc(yscale); - for x := 0 to h - 1 do - begin - lutY[x] := x2 - x1; - x1 := x2; - x2 := trunc((x + 2) * yscale); - end; - - Dec(w); - Dec(h); - RowDest := integer(FreeImage_GetScanLine(DestBmp, 0)); - RowSourceStart := integer(FreeImage_GetScanLine(SrcBmp, 0)); - RowSource := RowSourceStart; - - for y := 0 to h do - // resampling - begin - dy := lutY[y]; - x1 := 0; - x3 := 0; - for x := 0 to w do // loop through row - begin - dx:= lutX[x]; - iRed:= 0; - iGrn:= 0; - iBlu:= 0; - RowSource := RowSourceStart; - for iy := 1 to dy do - begin - pt := PRGB24(RowSource + x1); - for ix := 1 to dx do - begin - iRed := iRed + pt.R; - iGrn := iGrn + pt.G; - iBlu := iBlu + pt.B; - inc(pt); - end; - RowSource := RowSource + iSrc; - end; - iRatio := 65535 div (dx * dy); - pt1 := PRGB24(RowDest + x3); - pt1.R := (iRed * iRatio) shr 16; - pt1.G := (iGrn * iRatio) shr 16; - pt1.B := (iBlu * iRatio) shr 16; - x1 := x1 + 3 * dx; - inc(x3,3); - end; - RowDest := RowDest + iDst; - RowSourceStart := RowSource; - end; // resampling - - if FreeImage_GetHeight(DestBmp) >= 3 then - // Sharpening... - begin - s1 := integer(FreeImage_GetScanLine(DestBmp, 0)); - iDst := integer(FreeImage_GetScanLine(DestBmp, 1)) - s1; - ny1 := Integer(s1); - ny2 := ny1 + iDst; - ny3 := ny2 + iDst; - for y := 1 to FreeImage_GetHeight(DestBmp) - 2 do - begin - for x := 0 to FreeImage_GetWidth(DestBmp) - 3 do - begin - x1 := x * 3; - x2 := x1 + 3; - x3 := x1 + 6; - - c1 := pRGB24(ny1 + x1)^; - c2 := pRGB24(ny1 + x3)^; - c3 := pRGB24(ny2 + x2)^; - c4 := pRGB24(ny3 + x1)^; - c5 := pRGB24(ny3 + x3)^; - - r := (c1.R + c2.R + (c3.R * -12) + c4.R + c5.R) div -8; - g := (c1.G + c2.G + (c3.G * -12) + c4.G + c5.G) div -8; - b := (c1.B + c2.B + (c3.B * -12) + c4.B + c5.B) div -8; - - if r < 0 then r := 0 else if r > 255 then r := 255; - if g < 0 then g := 0 else if g > 255 then g := 255; - if b < 0 then b := 0 else if b > 255 then b := 255; - - pt1 := pRGB24(ny2 + x2); - pt1.R := r; - pt1.G := g; - pt1.B := b; - end; - inc(ny1, iDst); - inc(ny2, iDst); - inc(ny3, iDst); - end; - end; // sharpening - - if SrcBmp <> FDib then - FreeImage_Unload(SrcBmp); - DestBitmap.Replace(DestBmp); -end; - -function TFreeBitmap.PasteSubImage(Src: TFreeBitmap; Left, Top, - Alpha: Integer): Boolean; -begin - if FDib <> nil then - begin - Result := FreeImage_Paste(FDib, Src.Dib, Left, Top, Alpha); - Change; - end else - Result := False; -end; - -function TFreeBitmap.Replace(NewDib: PFIBITMAP): Boolean; -begin - Result := False; - if NewDib = nil then Exit; - - if not DoChanging(FDib, NewDib) and IsValid then - FreeImage_Unload(FDib); - - FDib := NewDib; - Result := True; - Change; -end; - -function TFreeBitmap.Rescale(NewWidth, NewHeight: Integer; - Filter: FREE_IMAGE_FILTER; Dest: TFreeBitmap): Boolean; -var - Bpp: Integer; - DstDib: PFIBITMAP; -begin - Result := False; - - if FDib <> nil then - begin - Bpp := FreeImage_GetBPP(FDib); - - if Bpp < 8 then - if not ConvertToGrayscale then Exit - else - if Bpp = 16 then - // convert to 24-bit - if not ConvertTo24Bits then Exit; - - // perform upsampling / downsampling - DstDib := FreeImage_Rescale(FDib, NewWidth, NewHeight, Filter); - if Dest = nil then - Result := Replace(DstDib) - else - Result := Dest.Replace(DstDib) - end -end; - -function TFreeBitmap.Rotate(Angle: Double): Boolean; -var - Bpp: Integer; - Rotated: PFIBITMAP; -begin - Result := False; - if IsValid then - begin - Bpp := FreeImage_GetBPP(FDib); - if Bpp in [1, 8, 24, 32] then - begin - Rotated := FreeImage_RotateClassic(FDib, Angle); - Result := Replace(Rotated); - end - end; -end; - -function TFreeBitmap.RotateEx(Angle, XShift, YShift, XOrigin, - YOrigin: Double; UseMask: Boolean): Boolean; -var - Rotated: PFIBITMAP; -begin - Result := False; - if FDib <> nil then - begin - if FreeImage_GetBPP(FDib) >= 8 then - begin - Rotated := FreeImage_RotateEx(FDib, Angle, XShift, YShift, XOrigin, YOrigin, UseMask); - Result := Replace(Rotated); - end - end; -end; - -function TFreeBitmap.Save(const FileName: string; Flag: Integer): Boolean; -var - fif: FREE_IMAGE_FORMAT; -begin - Result := False; - - // try to guess the file format from the file extension - fif := FreeImage_GetFIFFromFilename(PChar(Filename)); - if CanSave(fif) then - Result := FreeImage_Save(fif, FDib, PChar(FileName), Flag); -end; - -function TFreeBitmap.SaveToHandle(fif: FREE_IMAGE_FORMAT; IO: PFreeImageIO; - Handle: fi_handle; Flag: Integer): Boolean; -begin - Result := False; - if CanSave(fif) then - Result := FreeImage_SaveToHandle(fif, FDib, IO, Handle, Flag) -end; - -function TFreeBitmap.SaveToMemory(fif: FREE_IMAGE_FORMAT; - MemIO: TFreeMemoryIO; Flag: Integer): Boolean; -begin - Result := False; - - if CanSave(fif) then - Result := MemIO.Write(fif, FDib, Flag) -end; - -function TFreeBitmap.SaveToStream(fif: FREE_IMAGE_FORMAT; Stream: TStream; - Flag: Integer): Boolean; -var - MemIO: TFreeMemoryIO; - Data: PByte; - Size: Cardinal; -begin - MemIO := TFreeMemoryIO.Create; - try - Result := SaveToMemory(fif, MemIO, Flag); - if Result then - begin - MemIO.Acquire(Data, Size); - Stream.WriteBuffer(Data^, Size); - end; - finally - MemIO.Free; - end; -end; - -function TFreeBitmap.SaveU(const FileName: WideString; - Flag: Integer): Boolean; -var - fif: FREE_IMAGE_FORMAT; -begin - Result := False; - - // try to guess the file format from the file extension - fif := FreeImage_GetFIFFromFilenameU(PWideChar(Filename)); - if CanSave(fif) then - Result := FreeImage_SaveU(fif, FDib, PWideChar(FileName), Flag); -end; - -function TFreeBitmap.SetChannel(Bitmap: TFreeBitmap; - Channel: FREE_IMAGE_COLOR_CHANNEL): Boolean; -begin - if FDib <> nil then - begin - Result := FreeImage_SetChannel(FDib, Bitmap.FDib, Channel); - Change; - end - else - Result := False -end; - -procedure TFreeBitmap.SetDib(Value: PFIBITMAP); -begin - Replace(Value); -end; - -function TFreeBitmap.SetFileBkColor(BkColor: PRGBQuad): Boolean; -begin - Result := FreeImage_SetBackgroundColor(FDib, BkColor); - Change; -end; - -procedure TFreeBitmap.SetHorizontalResolution(Value: Double); -begin - if IsValid then - begin - FreeImage_SetDotsPerMeterX(FDib, Trunc(Value * 100 + 0.5)); - Change; - end; -end; - -function TFreeBitmap.SetMetadata(Model: FREE_IMAGE_MDMODEL; - const Key: string; Tag: TFreeTag): Boolean; -begin - Result := FreeImage_SetMetadata(Model, FDib, PChar(Key), Tag.Tag); -end; - -function TFreeBitmap.SetPixelColor(X, Y: Cardinal; - Value: PRGBQUAD): Boolean; -begin - Result := FreeImage_SetPixelColor(FDib, X, Y, Value); - Change; -end; - -function TFreeBitmap.SetPixelIndex(X, Y: Cardinal; Value: PByte): Boolean; -begin - Result := FreeImage_SetPixelIndex(FDib, X, Y, Value); - Change; -end; - -function TFreeBitmap.SetSize(ImageType: FREE_IMAGE_TYPE; Width, Height, - Bpp: Integer; RedMask, GreenMask, BlueMask: Cardinal): Boolean; -var - Pal: PRGBQuad; - I: Cardinal; -begin - Result := False; - - if FDib <> nil then - FreeImage_Unload(FDib); - - FDib := FreeImage_Allocate(Width, Height, Bpp, RedMask, GreenMask, BlueMask); - if FDib = nil then Exit; - - if ImageType = FIT_BITMAP then - case Bpp of - 1, 4, 8: - begin - Pal := FreeImage_GetPalette(FDib); - for I := 0 to FreeImage_GetColorsUsed(FDib) - 1 do - begin - Pal.rgbBlue := I; - Pal.rgbGreen := I; - Pal.rgbRed := I; - Inc(Pal, SizeOf(RGBQUAD)); - end; - end; - end; - - Result := True; - Change; -end; - -procedure TFreeBitmap.SetTransparencyTable(Table: PByte; Count: Integer); -begin - FreeImage_SetTransparencyTable(FDib, Table, Count); - Change; -end; - -procedure TFreeBitmap.SetVerticalResolution(Value: Double); -begin - if IsValid then - begin - FreeImage_SetDotsPerMeterY(FDib, Trunc(Value * 100 + 0.5)); - Change; - end; -end; - -function TFreeBitmap.SplitChannels(RedChannel, GreenChannel, - BlueChannel: TFreeBitmap): Boolean; -begin - if FDib <> nil then - begin - RedChannel.FDib := FreeImage_GetChannel(FDib, FICC_RED); - GreenChannel.FDib := FreeImage_GetChannel(FDib, FICC_GREEN); - BlueChannel.FDib := FreeImage_GetChannel(FDib, FICC_BLUE); - Result := RedChannel.IsValid and GreenChannel.IsValid and BlueChannel.IsValid; - end - else - Result := False -end; - -function TFreeBitmap.Threshold(T: Byte): Boolean; -var - dib1: PFIBITMAP; -begin - if FDib <> nil then - begin - dib1 := FreeImage_Threshold(FDib, T); - Result := Replace(dib1); - end - else - Result := False -end; - -function TFreeBitmap.ToneMapping(TMO: FREE_IMAGE_TMO; FirstParam, - SecondParam: Double): Boolean; -var - NewDib: PFIBITMAP; -begin - Result := False; - if not IsValid then Exit; - - NewDib := FreeImage_ToneMapping(Fdib, TMO, FirstParam, SecondParam); - Result := Replace(NewDib); -end; - - -{ TFreeMultiBitmap } - -procedure TFreeMultiBitmap.AppendPage(Bitmap: TFreeBitmap); -begin - if IsValid then - FreeImage_AppendPage(FMPage, Bitmap.FDib); -end; - -function TFreeMultiBitmap.Close(Flags: Integer): Boolean; -begin - Result := FreeImage_CloseMultiBitmap(FMPage, Flags); - FMPage := nil; -end; - -constructor TFreeMultiBitmap.Create(KeepCacheInMemory: Boolean); -begin - inherited Create; - FMemoryCache := KeepCacheInMemory; -end; - -procedure TFreeMultiBitmap.DeletePage(Page: Integer); -begin - if IsValid then - FreeImage_DeletePage(FMPage, Page); -end; - -destructor TFreeMultiBitmap.Destroy; -begin - if FMPage <> nil then Close; - inherited; -end; - -function TFreeMultiBitmap.GetLockedPageNumbers(var Pages, - Count: Integer): Boolean; -begin - Result := False; - if not IsValid then Exit; - Result := FreeImage_GetLockedPageNumbers(FMPage, Pages, Count) -end; - -function TFreeMultiBitmap.GetPageCount: Integer; -begin - Result := 0; - if IsValid then - Result := FreeImage_GetPageCount(FMPage) -end; - -procedure TFreeMultiBitmap.InsertPage(Page: Integer; Bitmap: TFreeBitmap); -begin - if IsValid then - FreeImage_InsertPage(FMPage, Page, Bitmap.FDib); -end; - -function TFreeMultiBitmap.IsValid: Boolean; -begin - Result := FMPage <> nil -end; - -procedure TFreeMultiBitmap.LockPage(Page: Integer; DestBitmap: TFreeBitmap); -begin - if not IsValid then Exit; - - if Assigned(DestBitmap) then - begin - DestBitmap.Replace(FreeImage_LockPage(FMPage, Page)); - end; -end; - -function TFreeMultiBitmap.MovePage(Target, Source: Integer): Boolean; -begin - Result := False; - if not IsValid then Exit; - Result := FreeImage_MovePage(FMPage, Target, Source); -end; - -function TFreeMultiBitmap.Open(const FileName: string; CreateNew, - ReadOnly: Boolean; Flags: Integer): Boolean; -var - fif: FREE_IMAGE_FORMAT; -begin - Result := False; - - // try to guess the file format from the filename - fif := FreeImage_GetFIFFromFilename(PChar(FileName)); - - // check for supported file types - if (fif <> FIF_UNKNOWN) and (not fif in [FIF_TIFF, FIF_ICO, FIF_GIF]) then - Exit; - - // open the stream - FMPage := FreeImage_OpenMultiBitmap(fif, PChar(FileName), CreateNew, ReadOnly, FMemoryCache, Flags); - - Result := FMPage <> nil; -end; - -procedure TFreeMultiBitmap.UnlockPage(Bitmap: TFreeBitmap; - Changed: Boolean); -begin - if IsValid then - begin - FreeImage_UnlockPage(FMPage, Bitmap.FDib, Changed); - // clear the image so that it becomes invalid. - // don't use Bitmap.Clear method because it calls FreeImage_Unload - // just clear the pointer - Bitmap.FDib := nil; - Bitmap.Change; - end; -end; - -{ TFreeMemoryIO } - -function TFreeMemoryIO.Acquire(var Data: PByte; - var SizeInBytes: DWORD): Boolean; -begin - Result := FreeImage_AcquireMemory(FHMem, Data, SizeInBytes); -end; - -constructor TFreeMemoryIO.Create(Data: PByte; SizeInBytes: DWORD); -begin - inherited Create; - FHMem := FreeImage_OpenMemory(Data, SizeInBytes); -end; - -destructor TFreeMemoryIO.Destroy; -begin - FreeImage_CloseMemory(FHMem); - inherited; -end; - -function TFreeMemoryIO.GetFileType: FREE_IMAGE_FORMAT; -begin - Result := FreeImage_GetFileTypeFromMemory(FHMem); -end; - -function TFreeMemoryIO.IsValid: Boolean; -begin - Result := FHMem <> nil -end; - -function TFreeMemoryIO.Read(fif: FREE_IMAGE_FORMAT; - Flag: Integer): PFIBITMAP; -begin - Result := FreeImage_LoadFromMemory(fif, FHMem, Flag) -end; - -function TFreeMemoryIO.Seek(Offset: Longint; Origin: Word): Boolean; -begin - Result := FreeImage_SeekMemory(FHMem, Offset, Origin) -end; - -function TFreeMemoryIO.Tell: Longint; -begin - Result := FreeImage_TellMemory(FHMem) -end; - -function TFreeMemoryIO.Write(fif: FREE_IMAGE_FORMAT; dib: PFIBITMAP; - Flag: Integer): Boolean; -begin - Result := FreeImage_SaveToMemory(fif, dib, FHMem, Flag) -end; - -{ TFreeTag } - -function TFreeTag.Clone: TFreeTag; -var - CloneTag: PFITAG; -begin - Result := nil; - if not IsValid then Exit; - - CloneTag := FreeImage_CloneTag(FTag); - Result := TFreeTag.Create(CloneTag); -end; - -constructor TFreeTag.Create(ATag: PFITAG); -begin - inherited Create; - - if ATag <> nil then - FTag := ATag - else - FTag := FreeImage_CreateTag; -end; - -destructor TFreeTag.Destroy; -begin - if IsValid then - FreeImage_DeleteTag(FTag); - - inherited; -end; - -function TFreeTag.GetCount: Cardinal; -begin - Result := 0; - if not IsValid then Exit; - - Result := FreeImage_GetTagCount(FTag); -end; - -function TFreeTag.GetDescription: string; -begin - Result := ''; - if not IsValid then Exit; - - Result := FreeImage_GetTagDescription(FTag); -end; - -function TFreeTag.GetID: Word; -begin - Result := 0; - if not IsValid then Exit; - - Result := FreeImage_GetTagID(FTag); -end; - -function TFreeTag.GetKey: string; -begin - Result := ''; - if not IsValid then Exit; - - Result := FreeImage_GetTagKey(FTag); -end; - -function TFreeTag.GetLength: Cardinal; -begin - Result := 0; - if not IsValid then Exit; - - Result := FreeImage_GetTagLength(FTag); -end; - -function TFreeTag.GetTagType: FREE_IMAGE_MDTYPE; -begin - Result := FIDT_NOTYPE; - if not IsValid then Exit; - - Result := FreeImage_GetTagType(FTag); -end; - -function TFreeTag.GetValue: Pointer; -begin - Result := nil; - if not IsValid then Exit; - - Result := FreeImage_GetTagValue(FTag); -end; - -function TFreeTag.IsValid: Boolean; -begin - Result := FTag <> nil; -end; - -procedure TFreeTag.SetCount(const Value: Cardinal); -begin - if IsValid then - FreeImage_SetTagCount(FTag, Value); -end; - -procedure TFreeTag.SetDescription(const Value: string); -begin - if IsValid then - FreeImage_SetTagDescription(FTag, PChar(Value)); -end; - -procedure TFreeTag.SetID(const Value: Word); -begin - if IsValid then - FreeImage_SetTagID(FTag, Value); -end; - -procedure TFreeTag.SetKey(const Value: string); -begin - if IsValid then - FreeImage_SetTagKey(FTag, PChar(Value)); -end; - -procedure TFreeTag.SetLength(const Value: Cardinal); -begin - if IsValid then - FreeImage_SetTagLength(FTag, Value); -end; - -procedure TFreeTag.SetTagType(const Value: FREE_IMAGE_MDTYPE); -begin - if IsValid then - FreeImage_SetTagType(FTag, Value); -end; - -procedure TFreeTag.SetValue(const Value: Pointer); -begin - if IsValid then - FreeImage_SetTagValue(FTag, Value); -end; - -function TFreeTag.ToString(Model: FREE_IMAGE_MDMODEL; Make: PChar): string; -begin - Result := FreeImage_TagToString(Model, FTag, Make); -end; - -end. diff --git a/src/lib/FreeImage/FreeImage.pas b/src/lib/FreeImage/FreeImage.pas deleted file mode 100644 index 69c0a0d1..00000000 --- a/src/lib/FreeImage/FreeImage.pas +++ /dev/null @@ -1,771 +0,0 @@ -unit FreeImage; - -{$I switches.inc} - - -// ========================================================== -// Delphi wrapper for FreeImage 3 -// -// Design and implementation by -// - Simon Beavis -// - Peter Bystrm -// - Anatoliy Pulyaevskiy (xvel84@rambler.ru) -// -// This file is part of FreeImage 3 -// -// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY -// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES -// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE -// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED -// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT -// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY -// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL -// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER -// THIS DISCLAIMER. -// -// Use at your own risk! -// ========================================================== - -interface - -uses - {$IFDEF MSWINDOWS} - Windows, - {$ENDIF} - ctypes; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF MSWINDOWS} - {$DEFINE DLL_STDCALL} -{$ELSE} - {$DEFINE DLL_CDECL} -{$ENDIF} - -const -{$IF Defined(MSWINDOWS)} - FIDLL = 'freeimage.dll'; -{$ELSEIF Defined(DARWIN)} - FIDLL = 'libfreeimage.dylib'; -{$ELSEIF Defined(UNIX)} - FIDLL = 'libfreeimage.so'; -{$IFEND} - -{$IFNDEF MSWINDOWS} -type - // define portable types for 32-bit / 64-bit OS - BOOL = cint32; - BYTE = cuint8; - WORD = cuint16; - DWORD = cuint32; - LONG = cint32; -{$ENDIF} - -// -------------------------------------------------------------------------- -// Bitmap types ------------------------------------------------------------- -// -------------------------------------------------------------------------- - -type - FIBITMAP = record - data : Pointer; - end; - PFIBITMAP = ^FIBITMAP; - - FIMULTIBITMAP = record - data : Pointer; - end; - PFIMULTIBITMAP = ^FIMULTIBITMAP; - -// -------------------------------------------------------------------------- -// Indexes for byte arrays, masks and shifts for treating pixels as words --- -// These coincide with the order of RGBQUAD and RGBTRIPLE ------------------- -// Little Endian (x86 / MS Windows, Linux) : BGR(A) order ------------------- -// -------------------------------------------------------------------------- - -const - FI_RGBA_RED = 2; - FI_RGBA_GREEN = 1; - FI_RGBA_BLUE = 0; - FI_RGBA_ALPHA = 3; - FI_RGBA_RED_MASK = $00FF0000; - FI_RGBA_GREEN_MASK = $0000FF00; - FI_RGBA_BLUE_MASK = $000000FF; - FI_RGBA_ALPHA_MASK = $FF000000; - FI_RGBA_RED_SHIFT = 16; - FI_RGBA_GREEN_SHIFT = 8; - FI_RGBA_BLUE_SHIFT = 0; - FI_RGBA_ALPHA_SHIFT = 24; - -// -------------------------------------------------------------------------- -// The 16bit macros only include masks and shifts, -------------------------- -// since each color element is not byte aligned ----------------------------- -// -------------------------------------------------------------------------- - -const - FI16_555_RED_MASK = $7C00; - FI16_555_GREEN_MASK = $03E0; - FI16_555_BLUE_MASK = $001F; - FI16_555_RED_SHIFT = 10; - FI16_555_GREEN_SHIFT = 5; - FI16_555_BLUE_SHIFT = 0; - FI16_565_RED_MASK = $F800; - FI16_565_GREEN_MASK = $07E0; - FI16_565_BLUE_MASK = $001F; - FI16_565_RED_SHIFT = 11; - FI16_565_GREEN_SHIFT = 5; - FI16_565_BLUE_SHIFT = 0; - -// -------------------------------------------------------------------------- -// ICC profile support ------------------------------------------------------ -// -------------------------------------------------------------------------- - -const - FIICC_DEFAULT = $0; - FIICC_COLOR_IS_CMYK = $1; - -type - FIICCPROFILE = record - flags : WORD; // info flag - size : DWORD; // profile's size measured in bytes - data : Pointer; // points to a block of contiguous memory containing the profile - end; - PFIICCPROFILE = ^FIICCPROFILE; - -// -------------------------------------------------------------------------- -// Important enums ---------------------------------------------------------- -// -------------------------------------------------------------------------- - -type - FREE_IMAGE_FORMAT = cint; - FREE_IMAGE_TYPE = cint; - FREE_IMAGE_COLOR_TYPE = cint; - FREE_IMAGE_QUANTIZE = cint; - FREE_IMAGE_DITHER = cint; - FREE_IMAGE_FILTER = cint; - FREE_IMAGE_COLOR_CHANNEL = cint; - FREE_IMAGE_MDTYPE = cint; - FREE_IMAGE_MDMODEL = cint; - FREE_IMAGE_JPEG_OPERATION = cint; - FREE_IMAGE_TMO = cint; - -const - // I/O image format identifiers. - FIF_UNKNOWN = FREE_IMAGE_FORMAT(-1); - FIF_BMP = FREE_IMAGE_FORMAT(0); - FIF_ICO = FREE_IMAGE_FORMAT(1); - FIF_JPEG = FREE_IMAGE_FORMAT(2); - FIF_JNG = FREE_IMAGE_FORMAT(3); - FIF_KOALA = FREE_IMAGE_FORMAT(4); - FIF_LBM = FREE_IMAGE_FORMAT(5); - FIF_IFF = FIF_LBM; - FIF_MNG = FREE_IMAGE_FORMAT(6); - FIF_PBM = FREE_IMAGE_FORMAT(7); - FIF_PBMRAW = FREE_IMAGE_FORMAT(8); - FIF_PCD = FREE_IMAGE_FORMAT(9); - FIF_PCX = FREE_IMAGE_FORMAT(10); - FIF_PGM = FREE_IMAGE_FORMAT(11); - FIF_PGMRAW = FREE_IMAGE_FORMAT(12); - FIF_PNG = FREE_IMAGE_FORMAT(13); - FIF_PPM = FREE_IMAGE_FORMAT(14); - FIF_PPMRAW = FREE_IMAGE_FORMAT(15); - FIF_RAS = FREE_IMAGE_FORMAT(16); - FIF_TARGA = FREE_IMAGE_FORMAT(17); - FIF_TIFF = FREE_IMAGE_FORMAT(18); - FIF_WBMP = FREE_IMAGE_FORMAT(19); - FIF_PSD = FREE_IMAGE_FORMAT(20); - FIF_CUT = FREE_IMAGE_FORMAT(21); - FIF_XBM = FREE_IMAGE_FORMAT(22); - FIF_XPM = FREE_IMAGE_FORMAT(23); - FIF_DDS = FREE_IMAGE_FORMAT(24); - FIF_GIF = FREE_IMAGE_FORMAT(25); - FIF_HDR = FREE_IMAGE_FORMAT(26); - FIF_FAXG3 = FREE_IMAGE_FORMAT(27); - FIF_SGI = FREE_IMAGE_FORMAT(28); - - // Image type used in FreeImage. - FIT_UNKNOWN = FREE_IMAGE_TYPE(0); // unknown type - FIT_BITMAP = FREE_IMAGE_TYPE(1); // standard image: 1-, 4-, 8-, 16-, 24-, 32-bit - FIT_UINT16 = FREE_IMAGE_TYPE(2); // array of unsigned short: unsigned 16-bit - FIT_INT16 = FREE_IMAGE_TYPE(3); // array of short: signed 16-bit - FIT_UINT32 = FREE_IMAGE_TYPE(4); // array of unsigned long: unsigned 32-bit - FIT_INT32 = FREE_IMAGE_TYPE(5); // array of long: signed 32-bit - FIT_FLOAT = FREE_IMAGE_TYPE(6); // array of float: 32-bit IEEE floating point - FIT_DOUBLE = FREE_IMAGE_TYPE(7); // array of double: 64-bit IEEE floating point - FIT_COMPLEX = FREE_IMAGE_TYPE(8); // array of FICOMPLEX: 2 x 64-bit IEEE floating point - FIT_RGB16 = FREE_IMAGE_TYPE(9); // 48-bit RGB image: 3 x 16-bit - FIT_RGBA16 = FREE_IMAGE_TYPE(10); // 64-bit RGBA image: 4 x 16-bit - FIT_RGBF = FREE_IMAGE_TYPE(11); // 96-bit RGB float image: 3 x 32-bit IEEE floating point - FIT_RGBAF = FREE_IMAGE_TYPE(12); // 128-bit RGBA float image: 4 x 32-bit IEEE floating point - - // Image color type used in FreeImage. - FIC_MINISWHITE = FREE_IMAGE_COLOR_TYPE(0); // min value is white - FIC_MINISBLACK = FREE_IMAGE_COLOR_TYPE(1); // min value is black - FIC_RGB = FREE_IMAGE_COLOR_TYPE(2); // RGB color model - FIC_PALETTE = FREE_IMAGE_COLOR_TYPE(3); // color map indexed - FIC_RGBALPHA = FREE_IMAGE_COLOR_TYPE(4); // RGB color model with alpha channel - FIC_CMYK = FREE_IMAGE_COLOR_TYPE(5); // CMYK color model - - // Color quantization algorithms. Constants used in FreeImage_ColorQuantize. - FIQ_WUQUANT = FREE_IMAGE_QUANTIZE(0); // Xiaolin Wu color quantization algorithm - FIQ_NNQUANT = FREE_IMAGE_QUANTIZE(1); // NeuQuant neural-net quantization algorithm by Anthony Dekker - - // Dithering algorithms. Constants used FreeImage_Dither. - FID_FS = FREE_IMAGE_DITHER(0); // Floyd & Steinberg error diffusion - FID_BAYER4x4 = FREE_IMAGE_DITHER(1); // Bayer ordered dispersed dot dithering (order 2 dithering matrix) - FID_BAYER8x8 = FREE_IMAGE_DITHER(2); // Bayer ordered dispersed dot dithering (order 3 dithering matrix) - FID_CLUSTER6x6 = FREE_IMAGE_DITHER(3); // Ordered clustered dot dithering (order 3 - 6x6 matrix) - FID_CLUSTER8x8 = FREE_IMAGE_DITHER(4); // Ordered clustered dot dithering (order 4 - 8x8 matrix) - FID_CLUSTER16x16 = FREE_IMAGE_DITHER(5); // Ordered clustered dot dithering (order 8 - 16x16 matrix) - - // Lossless JPEG transformations Constants used in FreeImage_JPEGTransform - FIJPEG_OP_NONE = FREE_IMAGE_JPEG_OPERATION(0); // no transformation - FIJPEG_OP_FLIP_H = FREE_IMAGE_JPEG_OPERATION(1); // horizontal flip - FIJPEG_OP_FLIP_V = FREE_IMAGE_JPEG_OPERATION(2); // vertical flip - FIJPEG_OP_TRANSPOSE = FREE_IMAGE_JPEG_OPERATION(3); // transpose across UL-to-LR axis - FIJPEG_OP_TRANSVERSE = FREE_IMAGE_JPEG_OPERATION(4); // transpose across UR-to-LL axis - FIJPEG_OP_ROTATE_90 = FREE_IMAGE_JPEG_OPERATION(5); // 90-degree clockwise rotation - FIJPEG_OP_ROTATE_180 = FREE_IMAGE_JPEG_OPERATION(6); // 180-degree rotation - FIJPEG_OP_ROTATE_270 = FREE_IMAGE_JPEG_OPERATION(7); // 270-degree clockwise (or 90 ccw) - - // Tone mapping operators. Constants used in FreeImage_ToneMapping. - FITMO_DRAGO03 = FREE_IMAGE_TMO(0); // Adaptive logarithmic mapping (F. Drago, 2003) - FITMO_REINHARD05 = FREE_IMAGE_TMO(1); // Dynamic range reduction inspired by photoreceptor physiology (E. Reinhard, 2005) - - // Upsampling / downsampling filters. Constants used in FreeImage_Rescale. - FILTER_BOX = FREE_IMAGE_FILTER(0); // Box, pulse, Fourier window, 1st order (constant) b-spline - FILTER_BICUBIC = FREE_IMAGE_FILTER(1); // Mitchell & Netravali's two-param cubic filter - FILTER_BILINEAR = FREE_IMAGE_FILTER(2); // Bilinear filter - FILTER_BSPLINE = FREE_IMAGE_FILTER(3); // 4th order (cubic) b-spline - FILTER_CATMULLROM = FREE_IMAGE_FILTER(4); // Catmull-Rom spline, Overhauser spline - FILTER_LANCZOS3 = FREE_IMAGE_FILTER(5); // Lanczos3 filter - - // Color channels. Constants used in color manipulation routines. - FICC_RGB = FREE_IMAGE_COLOR_CHANNEL(0); // Use red, green and blue channels - FICC_RED = FREE_IMAGE_COLOR_CHANNEL(1); // Use red channel - FICC_GREEN = FREE_IMAGE_COLOR_CHANNEL(2); // Use green channel - FICC_BLUE = FREE_IMAGE_COLOR_CHANNEL(3); // Use blue channel - FICC_ALPHA = FREE_IMAGE_COLOR_CHANNEL(4); // Use alpha channel - FICC_BLACK = FREE_IMAGE_COLOR_CHANNEL(5); // Use black channel - FICC_REAL = FREE_IMAGE_COLOR_CHANNEL(6); // Complex images: use real part - FICC_IMAG = FREE_IMAGE_COLOR_CHANNEL(7); // Complex images: use imaginary part - FICC_MAG = FREE_IMAGE_COLOR_CHANNEL(8); // Complex images: use magnitude - FICC_PHASE = FREE_IMAGE_COLOR_CHANNEL(9); // Complex images: use phase - - // Tag data type information (based on TIFF specifications) - FIDT_NOTYPE = FREE_IMAGE_MDTYPE(0); // placeholder - FIDT_BYTE = FREE_IMAGE_MDTYPE(1); // 8-bit unsigned integer - FIDT_ASCII = FREE_IMAGE_MDTYPE(2); // 8-bit bytes w/ last byte null - FIDT_SHORT = FREE_IMAGE_MDTYPE(3); // 16-bit unsigned integer - FIDT_LONG = FREE_IMAGE_MDTYPE(4); // 32-bit unsigned integer - FIDT_RATIONAL = FREE_IMAGE_MDTYPE(5); // 64-bit unsigned fraction - FIDT_SBYTE = FREE_IMAGE_MDTYPE(6); // 8-bit signed integer - FIDT_UNDEFINED = FREE_IMAGE_MDTYPE(7); // 8-bit untyped data - FIDT_SSHORT = FREE_IMAGE_MDTYPE(8); // 16-bit signed integer - FIDT_SLONG = FREE_IMAGE_MDTYPE(9); // 32-bit signed integer - FIDT_SRATIONAL = FREE_IMAGE_MDTYPE(10); // 64-bit signed fraction - FIDT_FLOAT = FREE_IMAGE_MDTYPE(11); // 32-bit IEEE floating point - FIDT_DOUBLE = FREE_IMAGE_MDTYPE(12); // 64-bit IEEE floating point - FIDT_IFD = FREE_IMAGE_MDTYPE(13); // 32-bit unsigned integer (offset) - FIDT_PALETTE = FREE_IMAGE_MDTYPE(14); // 32-bit RGBQUAD - - // Metadata models supported by FreeImage - FIMD_NODATA = FREE_IMAGE_MDMODEL(-1); - FIMD_COMMENTS = FREE_IMAGE_MDMODEL(0); // single comment or keywords - FIMD_EXIF_MAIN = FREE_IMAGE_MDMODEL(1); // Exif-TIFF metadata - FIMD_EXIF_EXIF = FREE_IMAGE_MDMODEL(2); // Exif-specific metadata - FIMD_EXIF_GPS = FREE_IMAGE_MDMODEL(3); // Exif GPS metadata - FIMD_EXIF_MAKERNOTE = FREE_IMAGE_MDMODEL(4); // Exif maker note metadata - FIMD_EXIF_INTEROP = FREE_IMAGE_MDMODEL(5); // Exif interoperability metadata - FIMD_IPTC = FREE_IMAGE_MDMODEL(6); // IPTC/NAA metadata - FIMD_XMP = FREE_IMAGE_MDMODEL(7); // Abobe XMP metadata - FIMD_GEOTIFF = FREE_IMAGE_MDMODEL(8); // GeoTIFF metadata (to be implemented) - FIMD_ANIMATION = FREE_IMAGE_MDMODEL(9); // Animation metadata - FIMD_CUSTOM = FREE_IMAGE_MDMODEL(10); // Used to attach other metadata types to a dib - -//{$endif} - -type - // Handle to a metadata model - FIMETADATA = record - data: Pointer; - end; - PFIMETADATA = ^FIMETADATA; - - // Handle to a metadata tag - FITAG = record - data: Pointer; - end; - PFITAG = ^FITAG; - -// -------------------------------------------------------------------------- -// File IO routines --------------------------------------------------------- -// -------------------------------------------------------------------------- - -type - FI_Handle = Pointer; - - FI_ReadProc = function(buffer : pointer; size : cuint; count : cuint; handle : fi_handle) : cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_WriteProc = function(buffer : pointer; size, count : cuint; handle : FI_Handle) : cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_SeekProc = function(handle : fi_handle; offset : clong; origin : cint) : cint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_TellProc = function(handle : fi_handle) : clong; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - - FreeImageIO = packed record - read_proc : FI_ReadProc; // pointer to the function used to read data - write_proc: FI_WriteProc; // pointer to the function used to write data - seek_proc : FI_SeekProc; // pointer to the function used to seek - tell_proc : FI_TellProc; // pointer to the function used to aquire the current position - end; - PFreeImageIO = ^FreeImageIO; - - // Handle to a memory I/O stream - FIMEMORY = record - data: Pointer; - end; - PFIMEMORY = ^FIMEMORY; - -const - // constants used in FreeImage_Seek for Origin parameter - SEEK_SET = 0; - SEEK_CUR = 1; - SEEK_END = 2; - -// -------------------------------------------------------------------------- -// Plugin routines ---------------------------------------------------------- -// -------------------------------------------------------------------------- - -type - PPluginStruct = ^PluginStruct; - - FI_InitProc = procedure(Plugin: PPluginStruct; Format_ID: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_FormatProc = function: PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_DescriptionProc = function: PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_ExtensionListProc = function: PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_RegExprProc = function: PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_OpenProc = function(IO: PFreeImageIO; Handle: FI_Handle; Read: BOOL): Pointer; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_CloseProc = procedure(IO: PFreeImageIO; Handle: FI_Handle; Data: Pointer); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_PageCountProc = function(IO: PFreeImageIO; Handle: FI_Handle; Data: Pointer): cint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_PageCapabilityProc = function(IO: PFreeImageIO; Handle: FI_Handle; Data: Pointer): cint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_LoadProc = function(IO: PFreeImageIO; Handle: FI_Handle; Page, Flags: cint; data: pointer): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_SaveProc = function(IO: PFreeImageIO; Dib: PFIBITMAP; Handle: FI_Handle; Page, Flags: cint; Data: Pointer): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_ValidateProc = function(IO: PFreeImageIO; Handle: FI_Handle): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_MimeProc = function: PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_SupportsExportBPPProc = function(Bpp: cint): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_SupportsExportTypeProc = function(AType: FREE_IMAGE_TYPE): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - FI_SupportsICCProfilesProc = function: BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} - - PluginStruct = record - format_proc: FI_FormatProc; - description_proc: FI_DescriptionProc; - extension_proc: FI_ExtensionListProc; - regexpr_proc: FI_RegExprProc; - open_proc: FI_OpenProc; - close_proc: FI_CloseProc; - pagecount_proc: FI_PageCountProc; - pagecapability_proc: FI_PageCapabilityProc; - load_proc: FI_LoadProc; - save_proc: FI_SaveProc; - validate_proc: FI_ValidateProc; - mime_proc: FI_MimeProc; - supports_export_bpp_proc: FI_SupportsExportBPPProc; - supports_export_type_proc: FI_SupportsExportTypeProc; - supports_icc_profiles_proc: FI_SupportsICCProfilesProc; - end; - -// -------------------------------------------------------------------------- -// Load/Save flag constants ------------------------------------------------- -// -------------------------------------------------------------------------- - -const - BMP_DEFAULT = 0; - BMP_SAVE_RLE = 1; - CUT_DEFAULT = 0; - DDS_DEFAULT = 0; - FAXG3_DEFAULT = 0; - GIF_DEFAULT = 0; - ICO_DEFAULT = 0; - ICO_MAKEALPHA = 0; // convert to 32bpp and create an alpha channel from the AND-mask when loading - IFF_DEFAULT = 0; - JPEG_DEFAULT = 0; - JPEG_FAST = 1; - JPEG_ACCURATE = 2; - JPEG_QUALITYSUPERB = $0080; - JPEG_QUALITYGOOD = $0100; - JPEG_QUALITYNORMAL = $0200; - JPEG_QUALITYAVERAGE = $0400; - JPEG_QUALITYBAD = $0800; - JPEG_CMYK = $1000; // load separated CMYK "as is" (use | to combine with other flags) - KOALA_DEFAULT = 0; - LBM_DEFAULT = 0; - MNG_DEFAULT = 0; - PCD_DEFAULT = 0; - PCD_BASE = 1; // load the bitmap sized 768 x 512 - PCD_BASEDIV4 = 2; // load the bitmap sized 384 x 256 - PCD_BASEDIV16 = 3; // load the bitmap sized 192 x 128 - PCX_DEFAULT = 0; - PNG_DEFAULT = 0; - PNG_IGNOREGAMMA = 1; // avoid gamma correction - PNM_DEFAULT = 0; - PNM_SAVE_RAW = 0; // If set the writer saves in RAW format (i.e. P4, P5 or P6) - PNM_SAVE_ASCII = 1; // If set the writer saves in ASCII format (i.e. P1, P2 or P3) - PSD_DEFAULT = 0; - RAS_DEFAULT = 0; - SGI_DEFAULT = 0; - TARGA_DEFAULT = 0; - TARGA_LOAD_RGB888 = 1; // If set the loader converts RGB555 and ARGB8888 -> RGB888. - TIFF_DEFAULT = 0; - TIFF_CMYK = $0001; // reads/stores tags for separated CMYK (use | to combine with compression flags) - TIFF_PACKBITS = $0100; // save using PACKBITS compression - TIFF_DEFLATE = $0200; // save using DEFLATE compression - TIFF_ADOBE_DEFLATE = $0400; // save using ADOBE DEFLATE compression - TIFF_NONE = $0800; // save without any compression - TIFF_CCITTFAX = $1000; // save using CCITT Group 3 fax encoding - TIFF_CCITTFAX4 = $2000; // save using CCITT Group 4 fax encoding - TIFF_LZW = $4000; // save using LZW compression - TIFF_JPEG = $8000; // save using JPEG compression - WBMP_DEFAULT = 0; - XBM_DEFAULT = 0; - XPM_DEFAULT = 0; - -// -------------------------------------------------------------------------- -// Init/Error routines ------------------------------------------------------ -// -------------------------------------------------------------------------- - -procedure FreeImage_Initialise(load_local_plugins_only : BOOL = False); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_DeInitialise; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Version routines --------------------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_GetVersion : PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetCopyrightMessage : PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Message output functions ------------------------------------------------- -// -------------------------------------------------------------------------- - -procedure FreeImage_OutPutMessageProc(fif: cint; fmt: PChar); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -type FreeImage_OutputMessageFunction = function(fif: FREE_IMAGE_FORMAT; msg: PChar): pointer; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} -procedure FreeImage_SetOutputMessage(omf: FreeImage_OutputMessageFunction); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Allocate/Unload routines ------------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_Allocate(width, height, bpp: cint; red_mask: cuint = 0; green_mask: cuint = 0; blue_mask: cuint = 0): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_AllocateT(Atype: FREE_IMAGE_TYPE; Width, Height: cint; bpp: cint = 8; red_mask: cuint = 0; green_mask: cuint = 0; blue_mask: cuint = 0): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_Clone(dib: PFIBITMAP): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_Unload(dib: PFIBITMAP); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Load / Save routines ----------------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_Load(fif: FREE_IMAGE_FORMAT; const filename: PChar; flags: cint = 0): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_LoadU(fif: FREE_IMAGE_FORMAT; const filename: PWideChar; flags: cint = 0): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_LoadFromHandle(fif: FREE_IMAGE_FORMAT; io: PFreeImageIO; handle: fi_handle; flags: cint = 0): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_Save(fif: FREE_IMAGE_FORMAT; dib: PFIBITMAP; filename: PChar; flags: cint = 0): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SaveU(fif: FREE_IMAGE_FORMAT; dib: PFIBITMAP; const filename: PWideChar; flags: cint = 0): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SaveToHandle(fif: FREE_IMAGE_FORMAT; dib: PFIBITMAP; io : PFreeImageIO; handle : fi_handle; flags : cint = 0) : BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Memory I/O stream routines ----------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_OpenMemory(data: PByte = nil; size_in_bytes: DWORD = 0): PFIMEMORY; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_CloseMemory(stream: PFIMEMORY); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_LoadFromMemory(fif: FREE_IMAGE_FORMAT; stream: PFIMEMORY; flags: cint = 0): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SaveToMemory(fif: FREE_IMAGE_FORMAT; dib: PFIBITMAP; stream: PFIMEMORY; flags: cint = 0): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_TellMemory(stream: PFIMEMORY): clong; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SeekMemory(stream: PFIMEMORY; offset: clong; origin: cint): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_AcquireMemory(stream: PFIMEMORY; var data: PByte; var size_in_bytes: DWORD): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Plugin Interface --------------------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_RegisterLocalPlugin(proc_address: FI_InitProc; format, description, extension, regexpr: PChar): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_RegisterExternalPlugin(path, format, description, extension, regexpr: PChar): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFIFCount: cint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_SetPluginEnabled(fif: FREE_IMAGE_FORMAT; enable: BOOL); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_IsPluginEnabled(fif: FREE_IMAGE_FORMAT): cint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFIFFromFormat(const format: PChar): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFIFFromMime(const format: PChar): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFormatFromFIF(fif: FREE_IMAGE_FORMAT): PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFIFExtensionList(fif: FREE_IMAGE_FORMAT): PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFIFDescription(fif: FREE_IMAGE_FORMAT): PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFIFRegExpr(fif: FREE_IMAGE_FORMAT): PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFIFFromFilename(const fname: PChar): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFIFFromFilenameU(const fname:PWideChar): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_FIFSupportsReading(fif: FREE_IMAGE_FORMAT): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_FIFSupportsWriting(fif: FREE_IMAGE_FORMAT): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_FIFSupportsExportBPP(fif: FREE_IMAGE_FORMAT; bpp: cint): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_FIFSupportsICCProfiles(fif: FREE_IMAGE_FORMAT): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_FIFSupportsExportType(fif: FREE_IMAGE_FORMAT; image_type: FREE_IMAGE_TYPE): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Multipaging interface ---------------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_OpenMultiBitmap(fif: FREE_IMAGE_FORMAT; filename: PChar; create_new, read_only, keep_cache_in_memory: BOOL; flags: cint = 0): PFIMULTIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_CloseMultiBitmap(bitmap: PFIMULTIBITMAP; flags: cint = 0): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetPageCount(bitmap: PFIMULTIBITMAP): cint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_AppendPage(bitmap: PFIMULTIBITMAP; data: PFIBITMAP); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_InsertPage(bitmap: PFIMULTIBITMAP; page: cint; data: PFIBITMAP); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_DeletePage(bitmap: PFIMULTIBITMAP; page: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_LockPage(bitmap: PFIMULTIBITMAP; page: cint): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_UnlockPage(bitmap: PFIMULTIBITMAP; page: PFIBITMAP; changed: BOOL); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_MovePage(bitmap: PFIMULTIBITMAP; target, source: cint): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetLockedPageNumbers(bitmap: PFIMULTIBITMAP; var pages: cint; var count : cint): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Filetype request routines ------------------------------------------------ -// -------------------------------------------------------------------------- - -function FreeImage_GetFileType(const filename: PChar; size: cint): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFileTypeU(const filename: PWideChar; size: cint): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFileTypeFromHandle(io: PFreeImageIO; handle: FI_Handle; size: cint = 0): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetFileTypeFromMemory(stream: PFIMEMORY; size: cint = 0): FREE_IMAGE_FORMAT; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// ImageType request routine ------------------------------------------------ -// -------------------------------------------------------------------------- - -function FreeImage_GetImageType(dib: PFIBITMAP): FREE_IMAGE_TYPE; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// FreeImage helper routines ------------------------------------------------ -// -------------------------------------------------------------------------- - -function FreeImage_IsLittleEndian: BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_LookupX11Color(const szColor: PChar; var nRed, nGreen, nBlue: PByte): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_LookupSVGColor(const szColor: PChar; var nRed, nGreen, nBlue: PByte): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Pixels access routines --------------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_GetBits(dib: PFIBITMAP): PByte; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetScanLine(dib: PFIBITMAP; scanline: cint): PByte; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_GetPixelIndex(dib: PFIBITMAP; X, Y: cuint; Value: PByte): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetPixelColor(dib: PFIBITMAP; X, Y: cuint; Value: PRGBQuad): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetPixelIndex(dib: PFIBITMAP; X, Y: cuint; Value: PByte): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetPixelColor(dib: PFIBITMAP; X, Y: cuint; Value: PRGBQuad): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// DIB info routines -------------------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_GetColorsUsed(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetBPP(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetWidth(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetHeight(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetLine(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetPitch(dib : PFIBITMAP) : cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetDIBSize(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetPalette(dib: PFIBITMAP): PRGBQUAD; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_GetDotsPerMeterX(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetDotsPerMeterY(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_SetDotsPerMeterX(dib: PFIBITMAP; res: cuint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_SetDotsPerMeterY(dib: PFIBITMAP; res: cuint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_GetInfoHeader(dib: PFIBITMAP): PBITMAPINFOHEADER; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetInfo(var dib: FIBITMAP): PBITMAPINFO; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetColorType(dib: PFIBITMAP): FREE_IMAGE_COLOR_TYPE; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_GetRedMask(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetGreenMask(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetBlueMask(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_GetTransparencyCount(dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetTransparencyTable(dib: PFIBITMAP): PByte; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_SetTransparent(dib: PFIBITMAP; enabled: BOOL); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_SetTransparencyTable(dib: PFIBITMAP; table: PByte; count: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_IsTransparent(dib: PFIBITMAP): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_HasBackgroundColor(dib: PFIBITMAP): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetBackgroundColor(dib: PFIBITMAP; var bkcolor: PRGBQUAD): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetBackgroundColor(dib: PFIBITMAP; bkcolor: PRGBQUAD): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// ICC profile routines ----------------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_GetICCProfile(var dib: FIBITMAP): PFIICCPROFILE; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_CreateICCProfile(var dib: FIBITMAP; data: Pointer; size: clong): PFIICCPROFILE; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_DestroyICCProfile(var dib : FIBITMAP); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Line conversion routines ------------------------------------------------- -// -------------------------------------------------------------------------- - -procedure FreeImage_ConvertLine1To4(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine8To4(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQuad); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16To4_555(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16To4_565(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine24To4(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine32To4(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -procedure FreeImage_ConvertLine1To8(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine4To8(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16To8_555(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16To8_565(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine24To8(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine32To8(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -procedure FreeImage_ConvertLine1To16_555(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine4To16_555(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine8To16_555(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16_565_To16_555(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine24To16_555(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine32To16_555(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -procedure FreeImage_ConvertLine1To16_565(target, source : PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine4To16_565(target, source : PBYTE; width_in_pixels : cint; palette : PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine8To16_565(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16_555_To16_565(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine24To16_565(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine32To16_565(target, source : PBYTE; width_in_pixels : cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -procedure FreeImage_ConvertLine1To24(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine4To24(target, source : PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine8To24(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16To24_555(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16To24_565(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine32To24(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -procedure FreeImage_ConvertLine1To32(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine4To32(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine8To32(target, source: PBYTE; width_in_pixels: cint; palette: PRGBQUAD); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16To32_555(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine16To32_565(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertLine24To32(target, source: PBYTE; width_in_pixels: cint); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Smart conversion routines ------------------------------------------------ -// -------------------------------------------------------------------------- - -function FreeImage_ConvertTo4Bits(dib: PFIBITMAP): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ConvertTo8Bits(dib: PFIBITMAP): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ConvertToGreyscale(dib: PFIBITMAP): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ConvertTo16Bits555(dib: PFIBITMAP): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ConvertTo16Bits565(dib: PFIBITMAP): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ConvertTo24Bits(dib: PFIBITMAP): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ConvertTo32Bits(dib: PFIBITMAP): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ColorQuantize(dib: PFIBITMAP; quantize: FREE_IMAGE_QUANTIZE): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ColorQuantizeEx(dib: PFIBITMAP; quantize: FREE_IMAGE_QUANTIZE = FIQ_WUQUANT; PaletteSize: cint = 256; ReserveSize: cint = 0; ReservePalette: PRGBQuad = nil): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_Threshold(dib: PFIBITMAP; T: Byte): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_Dither(dib: PFIBITMAP; algorithm: FREE_IMAGE_DITHER): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_ConvertFromRawBits(bits: PBYTE; width, height, pitch: cint; bpp, red_mask, green_mask, blue_mask: cuint; topdown: BOOL): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_ConvertToRawBits(bits: PBYTE; dib: PFIBITMAP; pitch: cint; bpp, red_mask, green_mask, blue_mask: cuint; topdown: BOOL); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_ConvertToRGBF(dib: PFIBITMAP): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_ConvertToStandardType(src: PFIBITMAP; scale_linear: BOOL = True): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ConvertToType(src: PFIBITMAP; dst_type: FREE_IMAGE_TYPE; scale_linear: BOOL = True): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// tone mapping operators -function FreeImage_ToneMapping(dib: PFIBITMAP; tmo: FREE_IMAGE_TMO; first_param: cdouble = 0; second_param: cdouble = 0): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_TmoDrago03(src: PFIBITMAP; gamma: cdouble = 2.2; exposure: cdouble = 0): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_TmoReinhard05(src: PFIBITMAP; intensity: cdouble = 0; contrast: cdouble = 0): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// ZLib interface ----------------------------------------------------------- -// -------------------------------------------------------------------------- - -function FreeImage_ZLibCompress(target: PBYTE; target_size: DWORD; source: PBYTE; source_size: DWORD): DWORD; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ZLibUncompress(target: PBYTE; target_size: DWORD; source: PBYTE; source_size: DWORD): DWORD; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_ZLibGZip(target: PBYTE; target_size: DWORD; source: PBYTE; source_size: DWORD): DWORD; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ZLibGUnzip(target: PBYTE; target_size: DWORD; source: PBYTE; source_size: DWORD): DWORD; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_ZLibCRC32(crc: DWORD; source: PByte; source_size: DWORD): DWORD; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Metadata routines -------------------------------------------------------- -// -------------------------------------------------------------------------- - -// tag creation / destruction -function FreeImage_CreateTag: PFITAG; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_DeleteTag(tag: PFITAG); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_CloneTag(tag: PFITAG): PFITAG; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// tag getters and setters -function FreeImage_GetTagKey(tag: PFITAG): PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetTagDescription(tag: PFITAG): PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetTagID(tag: PFITAG): Word; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetTagType(tag: PFITAG): FREE_IMAGE_MDTYPE; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetTagCount(tag: PFITAG): DWORD; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetTagLength(tag: PFITAG): DWORD; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetTagValue(tag: PFITAG): Pointer; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -function FreeImage_SetTagKey(tag: PFITAG; const key: PChar): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetTagDescription(tag: PFITAG; const description: PChar): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetTagID(tag: PFITAG; id: Word): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetTagType(tag: PFITAG; atype: FREE_IMAGE_MDTYPE): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetTagCount(tag: PFITAG; count: DWORD): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetTagLength(tag: PFITAG; length: DWORD): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetTagValue(tag: PFITAG; const value: Pointer): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// iterator -function FreeImage_FindFirstMetadata(model: FREE_IMAGE_MDMODEL; dib: PFIBITMAP; var tag: PFITAG): PFIMETADATA; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_FindNextMetadata(mdhandle: PFIMETADATA; var tag: PFITAG): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -procedure FreeImage_FindCloseMetadata(mdhandle: PFIMETADATA); {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// metadata setter and getter -function FreeImage_SetMetadata(model: FREE_IMAGE_MDMODEL; dib: PFIBITMAP; const key: PChar; tag: PFITAG): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetMetadata(model: FREE_IMAGE_MDMODEL; dib: PFIBITMAP; const key: PChar; var tag: PFITAG): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// helpers -function FreeImage_GetMetadataCount(model: FREE_IMAGE_MDMODEL; dib: PFIBITMAP): cuint; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// tag to C string conversion -function FreeImage_TagToString(model: FREE_IMAGE_MDMODEL; tag: PFITAG; Make: PChar = nil): PChar; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// -------------------------------------------------------------------------- -// Image manipulation toolkit ----------------------------------------------- -// -------------------------------------------------------------------------- - -// rotation and flipping -function FreeImage_RotateClassic(dib: PFIBITMAP; angle: cdouble): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_RotateEx(dib: PFIBITMAP; angle, x_shift, y_shift, x_origin, y_origin: cdouble; use_mask: BOOL): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_FlipHorizontal(dib: PFIBITMAP): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_FlipVertical(dib: PFIBITMAP): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_JPEGTransform(const src_file: PChar; const dst_file: PChar; operation: FREE_IMAGE_JPEG_OPERATION; perfect: BOOL = False): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// upsampling / downsampling -function FreeImage_Rescale(dib: PFIBITMAP; dst_width, dst_height: cint; filter: FREE_IMAGE_FILTER): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_MakeThumbnail(dib: PFIBITMAP; max_pixel_size: cint; convert:BOOL = TRUE): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// color manipulation routines (point operations) -function FreeImage_AdjustCurve(dib: PFIBITMAP; LUT: PBYTE; channel: FREE_IMAGE_COLOR_CHANNEL): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_AdjustGamma(dib: PFIBITMAP; gamma: cdouble): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_AdjustBrightness(dib: PFIBITMAP; percentage: cdouble): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_AdjustContrast(dib: PFIBITMAP; percentage: cdouble): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_Invert(dib: PFIBITMAP): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetHistogram(dib: PFIBITMAP; histo: PDWORD; channel: FREE_IMAGE_COLOR_CHANNEL = FICC_BLACK): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// channel processing routines -function FreeImage_GetChannel(dib: PFIBITMAP; channel: FREE_IMAGE_COLOR_CHANNEL): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetChannel(dib, dib8: PFIBITMAP; channel: FREE_IMAGE_COLOR_CHANNEL): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_GetComplexChannel(src: PFIBITMAP; channel: FREE_IMAGE_COLOR_CHANNEL): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_SetComplexChannel(src: PFIBITMAP; channel: FREE_IMAGE_COLOR_CHANNEL): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -// copy / paste / composite routines - -function FreeImage_Copy(dib: PFIBITMAP; left, top, right, bottom: cint): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_Paste(dst, src: PFIBITMAP; left, top, alpha: cint): BOOL; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; -function FreeImage_Composite(fg: PFIBITMAP; useFileBkg: BOOL = False; appBkColor: PRGBQUAD = nil; bg: PFIBITMAP = nil): PFIBITMAP; {$IFDEF DLL_STDCALL} stdcall; {$ENDIF} {$IFDEF DLL_CDECL} cdecl; {$ENDIF} external FIDLL; - -{$MINENUMSIZE 1} -implementation - -end. diff --git a/src/lib/Lazarus/fileutil.inc b/src/lib/Lazarus/components/lazutils/fileutil.inc similarity index 51% rename from src/lib/Lazarus/fileutil.inc rename to src/lib/Lazarus/components/lazutils/fileutil.inc index ee8b49a6..988da482 100644 --- a/src/lib/Lazarus/fileutil.inc +++ b/src/lib/Lazarus/components/lazutils/fileutil.inc @@ -11,337 +11,6 @@ ***************************************************************************** } -{$IFDEF EnableWrapperFunctions} -function NeedRTLAnsi: boolean; -begin - Result := LazUtf8.NeedRTLAnsi; -end; - -procedure SetNeedRTLAnsi(NewValue: boolean); -begin - LazUtf8.SetNeedRTLAnsi(NewValue); -end; - -function UTF8ToSys(const s: string): string; -begin - Result := LazUtf8.UTF8ToSys(s); -end; - -function SysToUTF8(const s: string): string; -begin - Result := LazUtf8.SysToUTF8(s); -end; - -function ConsoleToUTF8(const s: string): string;// converts OEM encoded string to UTF8 (used with some Windows specific functions) -begin - Result := LazUtf8.ConsoleToUTF8(s); -end; - -function UTF8ToConsole(const s: string): string;// converts UTF8 string to console encoding (used by Write, WriteLn) -begin - Result := LazUtf8.UTF8ToConsole(s); -end; - -function ParamStrUTF8(Param: Integer): string; -begin - Result := LazUtf8.ParamStrUTF8(Param); -end; - -function GetEnvironmentStringUTF8(Index: Integer): string; -begin - Result := LazUtf8.GetEnvironmentStringUTF8(Index); -end; - -function GetEnvironmentVariableUTF8(const EnvVar: string): String; -begin - Result := LazUtf8.GetEnvironmentVariableUTF8(EnvVar); -end; - -function SysErrorMessageUTF8(ErrorCode: Integer): String; -begin - Result := LazUtf8.SysErrorMessageUTF8(ErrorCode); -end; - -function GetAppConfigDirUTF8(Global: Boolean; Create: boolean = false): string; -begin - Result := LazFileUtils.GetAppConfigDirUTF8(Global, Create); -end; - -function GetAppConfigFileUTF8(Global: Boolean; SubDir: boolean; CreateDir: boolean): string; -begin - Result := LazFileUtils.GetAppConfigFileUTF8(Global, SubDir, CreateDir); -end; - -function ExtractFileNameOnly(const AFilename: string): string; -begin - Result := LazFileUtils.ExtractFileNameOnly(AFilename); -end; - -function FileExistsUTF8(const Filename: string): boolean; -begin - Result := LazFileUtils.FileExistsUTF8(FileName); -end; - -function FileAgeUTF8(const FileName: string): Longint; -begin - Result := LazFileUtils.FileAgeUTF8(FileName); -end; - -function DirectoryExistsUTF8(const Directory: string): Boolean; inline; -begin - Result := LazFileUtils.DirectoryExistsUTF8(Directory); -end; - -function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec): Longint; -begin - Result := LazFileUtils.FindFirstUtf8(Path, Attr, Rslt); -end; - -function FindNextUTF8(var Rslt: TSearchRec): Longint; -begin - Result := LazFileUtils.FindNextUTF8(Rslt); -end; - -procedure FindCloseUTF8(var F: TSearchrec); -begin - LazFileUtils.FindCloseUtf8(F); -end; - -function FileSetDateUTF8(const FileName: String; Age: Longint): Longint; -begin - Result := LazFileUtils.FileSetDateUTF8(FileName, Age); -end; - -function FileGetAttrUTF8(const FileName: String): Longint; -begin - Result := LazFileUtils.FileGetAttrUtf8(FileName); -end; - -function FileSetAttrUTF8(const Filename: String; Attr: longint): Longint; -begin - Result := LazFileUtils.FileSetAttrUtf8(Filename, Attr); -end; - -function DeleteFileUTF8(const FileName: String): Boolean; -begin - Result := LazFileUtils.DeleteFileUtf8(FileName); -end; - -function RenameFileUTF8(const OldName, NewName: String): Boolean; -begin - Result := LazFileUtils.RenameFileUtf8(OldName, NewName); -end; - -function FileSearchUTF8(const Name, DirList: String; ImplicitCurrentDir : Boolean = True): String; -begin - Result := LazFileUtils.FileSearchUTF8(Name, DirList, ImplicitCurrentDir); -end; - -function FileIsReadOnlyUTF8(const FileName: String): Boolean; -begin - Result := LazFileUtils.FileIsReadOnlyUTF8(FileName); -end; - -function GetCurrentDirUTF8: String; -begin - Result := LazFileUtils.GetCurrentDirUtf8(); -end; - -function SetCurrentDirUTF8(const NewDir: String): Boolean; -begin - Result := LazFileUtils.SetCurrentDirUtf8(NewDir); -end; - -function CreateDirUTF8(const NewDir: String): Boolean; -begin - Result := LazFileUtils.CreateDirUtf8(NewDir); -end; - -function RemoveDirUTF8(const Dir: String): Boolean; -begin - Result := LazFileUtils.RemoveDirUtf8(Dir); -end; - -function ForceDirectoriesUTF8(const Dir: string): Boolean; -begin - Result := LazFileUtils.ForceDirectoriesUTF8(Dir); -end; - -function FileOpenUTF8(Const FileName : string; Mode : Integer) : THandle; -begin - Result := LazFileUtils.FileOpenUtf8(FileName, Mode); -end; - -function FileCreateUTF8(Const FileName : string) : THandle; -begin - Result := LazFileUtils.FileCreateUtf8(FileName); -end; - -function GetTempFilename(const Directory, Prefix: string): string; -begin - Result := LazFileUtils.GetTempFileNameUTF8(Directory, Prefix); -end; - -function FileCreateUTF8(Const FileName : string; Rights: Cardinal) : THandle; -begin - Result := LazFileUtils.FileCreateUtf8(FileName, Rights); -end; - -function CleanAndExpandFilename(const Filename: string): string; -begin - Result := LazFileutils.CleanAndExpandFilename(FileName); -end; - -function CleanAndExpandDirectory(const Filename: string): string; -begin - Result := LazFileUtils.CleanAndExpandDirectory(FileName); -end; - -function ExpandFileNameUTF8(const FileName: string): string; -begin - Result := LazFileUtils.ExpandFileNameUTF8(Filename); -end; - -function CompareFileExt(const Filename, Ext: string; CaseSensitive: boolean): integer; -begin - Result := LazFileUtils.CompareFileExt(Filename, Ext, CaseSensitive); -end; - -function CompareFileExt(const Filename, Ext: string): integer; -begin - Result := LazFileUtils.CompareFileExt(Filename, Ext); -end; - -function CompareFilenames(const Filename1, Filename2: string): integer; -begin - Result := LazFileUtils.CompareFilenames(Filename1, Filename2); -end; - -function CompareFilenamesIgnoreCase(const Filename1, Filename2: string): integer; -begin - Result := LazFileUtils.CompareFilenamesIgnoreCase(Filename1, Filename2); -end; - -function FilenameIsAbsolute(const TheFilename: string):boolean; -begin - Result := LazFileUtils.FilenameIsAbsolute(TheFileName); -end; - -function FilenameIsWinAbsolute(const TheFilename: string): boolean; -begin - Result := LazFileUtils.FilenameIsWinAbsolute(TheFileName); -end; - -function FilenameIsUnixAbsolute(const TheFilename: string): boolean; -begin - Result := LazFileUtils.FilenameIsUnixAbsolute(TheFileName); -end; - -procedure CheckIfFileIsExecutable(const AFilename: string); -begin - LazFileUtils.CheckIfFileIsExecutable(AFileName); -end; - -procedure CheckIfFileIsSymlink(const AFilename: string); -begin - LazFileUtils.CheckIfFileIsSymlink(AFilename); -end; - -function FileIsReadable(const AFilename: string): boolean; -begin - Result:= LazFileUtils.FileIsReadable(AFilename); -end; - -function FileIsWritable(const AFilename: string): boolean; -begin - Result := LazFileUtils.FileIsWritable(AFilename); -end; - -function FileIsText(const AFilename: string): boolean; -begin - Result := LazFileUtils.FileIsText(AFilename); -end; - -function FileIsText(const AFilename: string; out FileReadable: boolean): boolean; -begin - Result := LazFileUtils.FileIsText(AFileName, FileReadable); -end; - -function FileIsExecutable(const AFilename: string): boolean; -begin - Result := LazFileUtils.FileIsExecutable(AFileName); -end; - -function FileIsSymlink(const AFilename: string): boolean; -begin - Result := LazFileUtils.FileIsSymlink(AFilename); -end; - -function FileIsHardLink(const AFilename: string): boolean; -begin - Result := LazFileUtils.FileIsHardLink(AFilename); -end; - -function GetFileDescription(const AFilename: string): string; -begin - Result := LazFileUtils.GetFileDescription(AFilename); -end; - -function ReadAllLinks(const Filename: string; ExceptionOnError: boolean): string; -begin - Result:=LazFileUtils.ReadAllLinks(Filename,ExceptionOnError); -end; - -function TryReadAllLinks(const Filename: string): string; -begin - Result:=LazFileUtils.TryReadAllLinks(Filename); -end; - -function TrimFilename(const AFilename: string): string; -begin - Result := LazFileUtils.TrimFilename(AFileName); -end; - -function DirPathExists(const FileName: String): Boolean; -begin - Result := LazFileUtils.DirPathExists(FileName); -end; - -function ForceDirectory(DirectoryName: string): boolean; -begin - Result := LazFileUtils.ForceDirectory(DirectoryName); -end; - -function DirectoryIsWritable(const DirectoryName: string): boolean; -begin - Result := LazFileUtils.DirectoryIsWritable(DirectoryName); -end; - -function AppendPathDelim(const Path: string): string; -begin - Result := LazFileUtils.AppendPathDelim(Path); -end; - -function ChompPathDelim(const Path: string): string; -begin - Result := LazFileUtils.ChompPathDelim(Path); -end; - -function CreateRelativePath(const Filename, BaseDirectory: string; - UsePointDirectory: boolean; AlwaysRequireSharedBaseFolder: Boolean): string; -begin - Result := LazFileUtils.CreateRelativePath(FileName, BaseDirectory, UsePointDirectory, AlwaysRequireSharedBaseFolder); -end; - -{$IFDEF darwin} -function GetDarwinSystemFilename(Filename: string): string; -begin - Result := LazFileUtils.GetDarwinSystemFilename(Filename); -end; -{$ENDIF} - -{$ENDIF EnableWrapperFunctions} - // ToDo: For ExpandUNCFileNameUTF8 // // Don't convert to and from Sys, because this RTL routines @@ -360,7 +29,7 @@ end; function FileSize(const Filename: string): int64; begin - Result := LazFileUtils.FileSizeUtf8(FileName); + Result := FileSizeUtf8(FileName); end; function ComparePhysicalFilenames(const Filename1, Filename2: string): integer; @@ -421,29 +90,11 @@ var i: Integer; begin for i:=Low(PascalFileExt) to High(PascalFileExt) do - if LazFileUtils.CompareFileExt(Filename,PascalFileExt[i],false)=0 then + if CompareFileExt(Filename,PascalFileExt[i],false)=0 then exit(true); Result:=false; end; -function ExtractFileNameWithoutExt(const AFilename: string): string; -var - p: Integer; -begin - Result:=AFilename; - p:=length(Result); - while (p>0) do begin - case Result[p] of - PathDelim: exit; - {$ifdef windows} - '/': if ('/' in AllowDirectorySeparators) then exit; - {$endif} - '.': exit(copy(Result,1, p-1)); - end; - dec(p); - end; -end; - function DeleteDirectory(const DirectoryName: string; OnlyChildren: boolean): boolean; const //Don't follow symlinks on *nix, just delete them @@ -454,8 +105,8 @@ var CurFilename: String; begin Result:=false; - CurSrcDir:=LazFileUtils.CleanAndExpandDirectory(DirectoryName); - if LazFileUtils.FindFirstUTF8(CurSrcDir+GetAllFilesMask,DeleteMask,FileInfo)=0 then begin + CurSrcDir:=CleanAndExpandDirectory(DirectoryName); + if FindFirstUTF8(CurSrcDir+GetAllFilesMask,DeleteMask,FileInfo)=0 then begin repeat // check if special file if (FileInfo.Name='.') or (FileInfo.Name='..') or (FileInfo.Name='') then @@ -465,12 +116,12 @@ begin {$ifdef unix} and ((FileInfo.Attr and faSymLink{%H-})=0) {$endif unix} then begin if not DeleteDirectory(CurFilename,false) then exit; end else begin - if not LazFileUtils.DeleteFileUTF8(CurFilename) then exit; + if not DeleteFileUTF8(CurFilename) then exit; end; - until LazFileUtils.FindNextUTF8(FileInfo)<>0; + until FindNextUTF8(FileInfo)<>0; end; - LazFileUtils.FindCloseUTF8(FileInfo); - if (not OnlyChildren) and (not LazFileUtils.RemoveDirUTF8(CurSrcDir)) then exit; + FindCloseUTF8(FileInfo); + if (not OnlyChildren) and (not RemoveDirUTF8(CurSrcDir)) then exit; Result:=true; end; @@ -478,7 +129,7 @@ function ProgramDirectory: string; var Flags: TSearchFileInPathFlags; begin - Result:=LazUTF8.ParamStrUTF8(0); + Result:=ParamStrUTF8(0); if ExtractFilePath(Result)='' then begin // program was started via PATH {$IFDEF WINDOWS} @@ -486,65 +137,21 @@ begin {$ELSE} Flags:=[sffDontSearchInBasePath]; {$ENDIF} - Result:=SearchFileInPath(Result,'',LazUTF8.GetEnvironmentVariableUTF8('PATH'),PathSeparator,Flags); + Result:=SearchFileInPath(Result,'',GetEnvironmentVariableUTF8('PATH'),PathSeparator,Flags); end; // resolve links Result:=GetPhysicalFilename(Result,pfeOriginal); // extract file path and expand to full name - Result:=LazFileUtils.ExpandFileNameUTF8(ExtractFilePath(Result)); -end; - -function CreateAbsoluteSearchPath(const SearchPath, BaseDirectory: string): string; -var - PathLen: Integer; - EndPos: Integer; - StartPos: Integer; - CurDir: String; - NewCurDir: String; - DiffLen: Integer; - BaseDir: String; -begin - Result:=SearchPath; - if (SearchPath='') or (BaseDirectory='') then exit; - BaseDir:=LazFileUtils.AppendPathDelim(BaseDirectory); - - PathLen:=length(Result); - EndPos:=1; - while EndPos<=PathLen do begin - StartPos:=EndPos; - while (Result[StartPos]=';') do begin - inc(StartPos); - if StartPos>PathLen then exit; - end; - EndPos:=StartPos; - while (EndPos<=PathLen) and (Result[EndPos]<>';') do inc(EndPos); - CurDir:=copy(Result,StartPos,EndPos-StartPos); - if not LazFileUtils.FilenameIsAbsolute(CurDir) then begin - NewCurDir:=BaseDir+CurDir; - if NewCurDir<>CurDir then begin - DiffLen:=length(NewCurDir)-length(CurDir); - Result:=copy(Result,1,StartPos-1)+NewCurDir - +copy(Result,EndPos,PathLen-EndPos+1); - inc(EndPos,DiffLen); - inc(PathLen,DiffLen); - end; - end; - StartPos:=EndPos; - end; + Result:=ExpandFileNameUTF8(ExtractFilePath(Result)); end; -function CreateAbsolutePath(const Filename, BaseDirectory: string): string; +function ProgramDirectoryWithBundle: string; +const + BundlePostFix='.app/Contents/MacOS'; begin - if (Filename='') or LazFileUtils.FilenameIsAbsolute(Filename) then - Result:=Filename - {$IFDEF Windows} - else if (Filename[1]='\') then - // only use drive of BaseDirectory - Result:=ExtractFileDrive(BaseDirectory)+Filename - {$ENDIF} - else - Result:=LazFileUtils.AppendPathDelim(BaseDirectory)+Filename; - Result:=LazFileUtils.TrimFilename(Result); + Result:=ProgramDirectory; + if (RightStr(ChompPathDelim(Result),Length(BundlePostFix))=BundlePostFix) then + Result:=ExtractFilePath(LeftStr(Result,Length(Result)-Length(BundlePostFix))); end; function FileIsInPath(const Filename, Path: string): boolean; @@ -553,11 +160,11 @@ var ExpPath: String; l: integer; begin - ExpFile:=LazFileUtils.CleanAndExpandFilename(Filename); - ExpPath:=LazFileUtils.CleanAndExpandDirectory(Path); + ExpFile:=CleanAndExpandFilename(Filename); + ExpPath:=CleanAndExpandDirectory(Path); l:=length(ExpPath); Result:=(l>0) and (length(ExpFile)>l) and (ExpFile[l] in AllowDirectorySeparators) - and (LazFileUtils.CompareFilenames(ExpPath,LeftStr(ExpFile,l))=0); + and (CompareFilenames(ExpPath,LeftStr(ExpFile,l))=0); end; function FileIsInDirectory(const Filename, Directory: string): boolean; @@ -568,18 +175,33 @@ var LenDir: Integer; p: LongInt; begin - ExpFile:=LazFileUtils.CleanAndExpandFilename(Filename); - ExpDir:=LazFileUtils.CleanAndExpandDirectory(Directory); + ExpFile:=CleanAndExpandFilename(Filename); + ExpDir:=CleanAndExpandDirectory(Directory); LenFile:=length(ExpFile); LenDir:=length(ExpDir); p:=LenFile; while (p>0) and not (ExpFile[p] in AllowDirectorySeparators) do dec(p); Result:=(p=LenDir) and (p 3 Do Begin - SrcHandle := LazFileUtils.FileOpenUTF8(SrcFilename, fmOpenRead or fmShareDenyWrite); - if (THandle(SrcHandle)=feInvalidHandle) then Begin + SrcHandle := FileOpenUTF8(SrcFilename, fmOpenRead or fmShareDenyWrite); + if THandle(SrcHandle)=feInvalidHandle then Begin Inc(TryCount); Sleep(10); End @@ -615,7 +237,7 @@ begin exit; end; try - DestHandle := LazFileUtils.FileCreateUTF8(DestFileName); + DestHandle := FileCreateUTF8(DestFileName); if (THandle(DestHandle)=feInvalidHandle) then begin if ExceptionOnError then @@ -640,14 +262,15 @@ begin FileClose(DestHandle); end; if (cffPreserveTime in Flags) then - LazFileUtils.FileSetDateUTF8(DestFilename, FileGetDate(SrcHandle)); + FileSetDateUTF8(DestFilename, FileGetDate(SrcHandle)); Result := True; finally FileClose(SrcHandle); end; end; -function CopyFile(const SrcFilename, DestFilename: string; PreserveTime: Boolean; ExceptionOnError: Boolean): boolean; +function CopyFile(const SrcFilename, DestFilename: string; + PreserveTime: boolean; ExceptionOnError: Boolean): boolean; // Flags parameter can be used for the same thing. var Flags: TCopyFileFlags; @@ -666,10 +289,10 @@ type FSourceDir: string; FTargetDir: string; FFlags: TCopyFileFlags; - FCopyFailedCount:Integer; + FCopyFailedCount: Integer; protected procedure DoFileFound; override; - procedure DoDirectoryFound; override; + //procedure DoDirectoryFound; override; end; procedure TCopyDirTree.DoFileFound; @@ -681,18 +304,12 @@ begin if not CopyFile(FileName, NewLoc, FFlags) then Inc(FCopyFailedCount); end; - +{ procedure TCopyDirTree.DoDirectoryFound; -var - NewPath:String; begin - NewPath:=StringReplace(FileName, FSourceDir, FTargetDir, []); - // ToDo: make directories also respect cffPreserveTime flag. - if not LazFileUtils.DirectoryExistsUTF8(NewPath) then - if not LazFileUtils.ForceDirectoriesUTF8(NewPath) then - Inc(FCopyFailedCount); + // Directory is already created by the cffCreateDestDirectory flag. end; - +} function CopyDirTree(const SourceDir, TargetDir: string; Flags: TCopyFileFlags=[]): Boolean; var Searcher: TCopyDirTree; @@ -704,16 +321,12 @@ begin Flags:=Flags+[cffCreateDestDirectory]; Searcher.FFlags:=Flags; Searcher.FCopyFailedCount:=0; - Searcher.FSourceDir:=LazFileUtils.TrimFilename(SetDirSeparators(SourceDir)); - Searcher.FTargetDir:=LazFileUtils.TrimFilename(SetDirSeparators(TargetDir)); + Searcher.FSourceDir:=TrimFilename(SetDirSeparators(SourceDir)); + Searcher.FTargetDir:=TrimFilename(SetDirSeparators(TargetDir)); // Don't even try to copy to a subdirectory of SourceDir. {$ifdef CaseInsensitiveFilenames} - {$ifdef ACP_RTL} if AnsiStartsText(Searcher.FSourceDir, Searcher.FTargetDir) then Exit; - {$else ACP_RTL} - if Utf8StartsText(Searcher.FSourceDir, Searcher.FTargetDir) then Exit; - {$endif} {$ELSE} if AnsiStartsStr(Searcher.FSourceDir, Searcher.FTargetDir) then Exit; {$ENDIF} @@ -742,7 +355,10 @@ begin {$ENDIF} end; -function ReadFileToString(const Filename: String): String; +function ReadFileToString(const Filename: string): string; +// Read and return the contents of a text file in one slurp. +// Note: FileSize() returns 0 for virtual files at least in Unix like systems. +// Then use different ways to read contents, eg. TStringList.LoadFromFile(); var SrcHandle: THandle; ReadCount: LongInt; @@ -753,8 +369,8 @@ begin try Setlength(s, FileSize(Filename)); if s='' then exit; - SrcHandle := LazFileUtils.FileOpenUTF8(Filename, fmOpenRead or fmShareDenyWrite); - if (THandle(SrcHandle)=feInvalidHandle) then + SrcHandle := FileOpenUTF8(Filename, fmOpenRead or fmShareDenyWrite); + if THandle(SrcHandle)=feInvalidHandle then exit; try ReadCount:=FileRead(SrcHandle,s[1],length(s)); @@ -769,10 +385,10 @@ begin end; end; -function SearchFileInPath(const Filename, BasePath, SearchPath, - Delimiter: string; Flags: TSearchFileInPathFlags): string; +function SearchFileInPath(const Filename, BasePath: string; SearchPath: string; + const Delimiter: string; Flags: TSearchFileInPathFlags): string; var - p, StartPos, l: integer; + p, StartPos, l, QuoteStart: integer; CurPath, Base: string; begin //debugln('[SearchFileInPath] Filename="',Filename,'" BasePath="',BasePath,'" SearchPath="',SearchPath,'" Delimiter="',Delimiter,'"'); @@ -781,58 +397,83 @@ begin exit; end; // check if filename absolute - if LazFileUtils.FilenameIsAbsolute(Filename) then begin - if LazFileUtils.FileExistsUTF8(Filename) then begin - Result:=LazFileUtils.CleanAndExpandFilename(Filename); + if FilenameIsAbsolute(Filename) then begin + if FileExistsUTF8(Filename) then begin + Result:=CleanAndExpandFilename(Filename); exit; end else begin Result:=''; exit; end; end; - Base:=LazFileUtils.CleanAndExpandDirectory(BasePath); + Base:=CleanAndExpandDirectory(BasePath); // search in current directory - if (not (sffDontSearchInBasePath in Flags)) - and LazFileUtils.FileExistsUTF8(Base+Filename) then begin - Result:=LazFileUtils.CleanAndExpandFilename(Base+Filename); - exit; - end; + if (not (sffDontSearchInBasePath in Flags)) and FileExistsUTF8(Base+Filename) then + exit(CleanAndExpandFilename(Base+Filename)); // search in search path StartPos:=1; l:=length(SearchPath); while StartPos<=l do begin p:=StartPos; - while (p<=l) and (pos(SearchPath[p],Delimiter)<1) do inc(p); - CurPath:=LazFileUtils.TrimFilename(copy(SearchPath,StartPos,p-StartPos)); - if CurPath<>'' then begin - if not LazFileUtils.FilenameIsAbsolute(CurPath) then - CurPath:=Base+CurPath; - Result:=LazFileUtils.CleanAndExpandFilename(LazFileUtils.AppendPathDelim(CurPath)+Filename); - if LazFileUtils.FileExistsUTF8(Result) then exit; + while (p<=l) and (pos(SearchPath[p],Delimiter)<1) do + begin + if (SearchPath[p]='"') and (sffDequoteSearchPath in Flags) then + begin + // For example: Windows allows set path=C:\"a;b c"\d;%path% + QuoteStart:=p; + repeat + inc(p); + until (p>l) or (SearchPath[p]='"'); + if p<=l then + begin + system.delete(SearchPath,p,1); + system.delete(SearchPath,QuoteStart,1); + dec(l,2); + dec(p,2); + end; + end; + inc(p); end; + CurPath:=copy(SearchPath,StartPos,p-StartPos); + CurPath:=TrimFilename(CurPath); StartPos:=p+1; + if CurPath='' then continue; + if not FilenameIsAbsolute(CurPath) then + CurPath:=Base+CurPath; + Result:=CleanAndExpandFilename(AppendPathDelim(CurPath)+Filename); + if not FileExistsUTF8(Result) then + continue; + if (sffFile in Flags) and DirectoryExistsUTF8(Result) then + continue; + if (sffExecutable in Flags) and not FileIsExecutable(Result) then + continue; + exit; end; Result:=''; end; function SearchAllFilesInPath(const Filename, BasePath, SearchPath, Delimiter: string; Flags: TSearchFileInPathFlags): TStrings; - + procedure Add(NewFilename: string); var i: Integer; begin - NewFilename:=LazFileUtils.TrimFilename(NewFilename); - if not LazFileUtils.FileExistsUTF8(NewFilename) then exit; - if Result=nil then begin - Result:=TStringList.Create; - end else begin + NewFilename:=TrimFilename(NewFilename); + if Result<>nil then for i:=0 to Result.Count-1 do - if LazFileUtils.CompareFilenames(Result[i],NewFilename)=0 then exit; - end; + if CompareFilenames(Result[i],NewFilename)=0 then exit; + if not FileExistsUTF8(NewFilename) then + exit; + if (sffFile in Flags) and DirectoryExistsUTF8(NewFilename) then + exit; + if (sffExecutable in Flags) and not FileIsExecutable(NewFilename) then + exit; + if Result=nil then + Result:=TStringList.Create; Result.Add(NewFilename); end; - + var p, StartPos, l: integer; CurPath, Base: string; @@ -840,14 +481,14 @@ begin Result:=nil; if (Filename='') then exit; // check if filename absolute - if LazFileUtils.FilenameIsAbsolute(Filename) then begin - Add(LazFileUtils.CleanAndExpandFilename(Filename)); + if FilenameIsAbsolute(Filename) then begin + Add(CleanAndExpandFilename(Filename)); exit; end; - Base:=LazFileUtils.CleanAndExpandDirectory(BasePath); + Base:=CleanAndExpandDirectory(BasePath); // search in current directory if (not (sffDontSearchInBasePath in Flags)) then begin - Add(LazFileUtils.CleanAndExpandFilename(Base+Filename)); + Add(CleanAndExpandFilename(Base+Filename)); end; // search in search path StartPos:=1; @@ -855,11 +496,11 @@ begin while StartPos<=l do begin p:=StartPos; while (p<=l) and (pos(SearchPath[p],Delimiter)<1) do inc(p); - CurPath:=LazFileUtils.TrimFilename(copy(SearchPath,StartPos,p-StartPos)); + CurPath:=TrimFilename(copy(SearchPath,StartPos,p-StartPos)); if CurPath<>'' then begin - if not LazFileUtils.FilenameIsAbsolute(CurPath) then + if not FilenameIsAbsolute(CurPath) then CurPath:=Base+CurPath; - Add(LazFileUtils.CleanAndExpandFilename(LazFileUtils.AppendPathDelim(CurPath)+Filename)); + Add(CleanAndExpandFilename(AppendPathDelim(CurPath)+Filename)); end; StartPos:=p+1; end; @@ -880,7 +521,7 @@ var Ambiguous: Boolean; begin Result:=Filename; - if not LazFileUtils.FileExistsUTF8(Filename) then exit; + if not FileExistsUTF8(Filename) then exit; //Sanitize result first (otherwise result can contain things like foo/\bar on Windows) Result := ResolveDots(Result); // check every directory and filename @@ -908,14 +549,14 @@ begin CurFile:=copy(Result,StartPos,EndPos-StartPos); AliasFile:=''; Ambiguous:=false; - if LazFileUtils.FindFirstUTF8(CurDir+GetAllFilesMask,faAnyFile,FileInfo)=0 then + if FindFirstUTF8(CurDir+GetAllFilesMask,faAnyFile,FileInfo)=0 then begin repeat // check if special file if (FileInfo.Name='.') or (FileInfo.Name='..') or (FileInfo.Name='') then continue; - if LazFileUtils.CompareFilenamesIgnoreCase(FileInfo.Name,CurFile)=0 then begin + if CompareFilenamesIgnoreCase(FileInfo.Name,CurFile)=0 then begin //debugln('FindDiskFilename ',FileInfo.Name,' ',CurFile); if FileInfo.Name=CurFile then begin // file found, has already the correct name @@ -931,9 +572,9 @@ begin end; end; end; - until LazFileUtils.FindNextUTF8(FileInfo)<>0; + until FindNextUTF8(FileInfo)<>0; end; - LazFileUtils.FindCloseUTF8(FileInfo); + FindCloseUTF8(FileInfo); if (AliasFile<>'') and (not Ambiguous) then begin // better filename found -> replace Result:=CurDir+AliasFile+copy(Result,EndPos,length(Result)); @@ -951,14 +592,14 @@ var begin Result:=''; CurDir:=ExtractFilePath(ResolveDots(Filename)); - if LazFileUtils.FindFirstUTF8(CurDir+GetAllFilesMask,faAnyFile, FileInfo)=0 then begin + if FindFirstUTF8(CurDir+GetAllFilesMask,faAnyFile, FileInfo)=0 then begin ShortFilename:=ExtractFilename(Filename); repeat // check if special file if (FileInfo.Name='.') or (FileInfo.Name='..') or (FileInfo.Name='') then continue; - if LazFileUtils.CompareFilenamesIgnoreCase(FileInfo.Name,ShortFilename)<>0 then + if CompareFilenamesIgnoreCase(FileInfo.Name,ShortFilename)<>0 then continue; if FileInfo.Name=ShortFilename then begin // fits exactly @@ -968,34 +609,32 @@ begin end; // fits case insensitive Result:=CurDir+FileInfo.Name; - until LazFileUtils.FindNextUTF8(FileInfo)<>0; + until FindNextUTF8(FileInfo)<>0; end; - LazFileUtils.FindCloseUTF8(FileInfo); + FindCloseUTF8(FileInfo); end; function FindDefaultExecutablePath(const Executable: string; const BaseDir: string): string; -const - Flags : TSearchFileInPathFlags = [{$IFDEF Unix}sffDontSearchInBasePath{$ENDIF}]; var Env: string; begin - if LazFileUtils.FilenameIsAbsolute(Executable) then begin + if FilenameIsAbsolute(Executable) then begin Result:=Executable; - if LazFileUtils.FileExistsUTF8(Result) then exit; + if FileExistsUTF8(Result) then exit; {$IFDEF Windows} if ExtractFileExt(Result)='' then begin Result:=Result+'.exe'; - if LazFileUtils.FileExistsUTF8(Result) then exit; + if FileExistsUTF8(Result) then exit; end; {$ENDIF} end else begin - Env:=LazUTF8.GetEnvironmentVariableUTF8('PATH'); - Result:=SearchFileInPath(Executable, BaseDir, Env, PathSeparator, Flags); + Env:=GetEnvironmentVariableUTF8('PATH'); + Result:=SearchFileInPath(Executable, BaseDir, Env, PathSeparator, sffFindProgramInPath); if Result<>'' then exit; {$IFDEF Windows} if ExtractFileExt(Executable)='' then begin - Result:=SearchFileInPath(Executable+'.exe', BaseDir, Env, PathSeparator, Flags); + Result:=SearchFileInPath(Executable+'.exe', BaseDir, Env, PathSeparator, sffFindProgramInPath); if Result<>'' then exit; end; {$ENDIF} @@ -1017,12 +656,15 @@ begin end; procedure FindAllFiles(AList: TStrings; const SearchPath: String; - SearchMask: String; SearchSubDirs: Boolean; DirAttr: Word); + const SearchMask: String; SearchSubDirs: Boolean; DirAttr: Word; + MaskSeparator: char; PathSeparator: char); var Searcher: TListFileSearcher; begin Searcher := TListFileSearcher.Create(AList); Searcher.DirectoryAttribute := DirAttr; + Searcher.MaskSeparator := MaskSeparator; + Searcher.PathSeparator := PathSeparator; try Searcher.Search(SearchPath, SearchMask, SearchSubDirs); finally @@ -1030,11 +672,12 @@ begin end; end; -function FindAllFiles(const SearchPath: String; SearchMask: String; - SearchSubDirs: Boolean; DirAttr: Word): TStringList; +function FindAllFiles(const SearchPath: String; const SearchMask: String; + SearchSubDirs: Boolean; DirAttr: Word; + MaskSeparator: char; PathSeparator: char): TStringList; begin Result := TStringList.Create; - FindAllFiles(Result, SearchPath, SearchMask, SearchSubDirs, DirAttr); + FindAllFiles(Result, SearchPath, SearchMask, SearchSubDirs, DirAttr, MaskSeparator, PathSeparator); end; { TListDirectoriesSearcher } @@ -1051,19 +694,20 @@ begin end; function FindAllDirectories(const SearchPath : string; - SearchSubDirs: Boolean = True): TStringList; + SearchSubDirs: Boolean; PathSeparator: char): TStringList; begin Result := TStringList.Create; - FindAllDirectories(Result, SearchPath, SearchSubDirs); + FindAllDirectories(Result, SearchPath, SearchSubDirs, PathSeparator); end; procedure FindAllDirectories(AList: TStrings; const SearchPath: String; - SearchSubDirs: Boolean = true); + SearchSubDirs: Boolean; PathSeparator: char); var Searcher :TFileSearcher; begin Assert(AList <> nil); Searcher := TListDirectoriesSearcher.Create(AList); + Searcher.PathSeparator := PathSeparator; try Searcher.Search(SearchPath, AllFilesMask, SearchSubDirs); finally @@ -1114,13 +758,14 @@ constructor TFileSearcher.Create; begin inherited Create; FMaskSeparator := ';'; + FPathSeparator := ';'; FFollowSymLink := True; FFileAttribute := faAnyFile; FDirectoryAttribute := faDirectory; FSearching := False; end; -procedure TFileSearcher.Search(ASearchPath: String; ASearchMask: String; +procedure TFileSearcher.Search(const ASearchPath: String; const ASearchMask: String; ASearchSubDirs: Boolean; CaseSensitive: Boolean = False); var MaskList: TMaskList; @@ -1133,7 +778,7 @@ var begin P := APath + AllDirectoryEntriesMask; - if LazFileUtils.FindFirstUTF8(P, FileAttribute, PathInfo) = 0 then + if FindFirstUTF8(P, FileAttribute, PathInfo) = 0 then try repeat // skip special files @@ -1161,19 +806,19 @@ var DoDirectoryFound; end; - until (LazFileUtils.FindNextUTF8(PathInfo) <> 0) or not FSearching; + until (FindNextUTF8(PathInfo) <> 0) or not FSearching; finally - LazFileUtils.FindCloseUTF8(PathInfo); + FindCloseUTF8(PathInfo); end; if ASearchSubDirs or (ALevel > 0) then // search recursively in directories - if LazFileUtils.FindFirstUTF8(P, DirectoryAttribute, PathInfo) = 0 then + if FindFirstUTF8(P, DirectoryAttribute, PathInfo) = 0 then try repeat if (PathInfo.Name = '.') or (PathInfo.Name = '..') or (PathInfo.Name = '') or ((PathInfo.Attr and faDirectory) = 0) or - (not FFollowSymLink and LazFileUtils.FileIsSymlink(APath + PathInfo.Name)) + (not FFollowSymLink and FileIsSymlink(APath + PathInfo.Name)) then Continue; FPath := APath; @@ -1182,23 +827,27 @@ var DoDirectoryEnter; if not FSearching then Break; - DoSearch(LazFileUtils.AppendPathDelim(APath + PathInfo.Name), Succ(ALevel)); + DoSearch(AppendPathDelim(APath + PathInfo.Name), Succ(ALevel)); - until (LazFileUtils.FindNextUTF8(PathInfo) <> 0); + until (FindNextUTF8(PathInfo) <> 0); finally - LazFileUtils.FindCloseUTF8(PathInfo); + FindCloseUTF8(PathInfo); end; end; var - p: SizeInt; - Dir: String; + p1, p2: SizeInt; i: Integer; + Dir: String; OtherDir: String; + MaskOptions: TMaskOptions; begin if FSearching then RaiseSearchingError; - - MaskList := TMaskList.Create(ASearchMask, FMaskSeparator, CaseSensitive); + if CaseSensitive then + MaskOptions := [moCaseSensitive] + else + MaskOptions := []; + MaskList := TMaskList.Create(ASearchMask, FMaskSeparator, MaskOptions); // empty mask = all files mask if MaskList.Count = 0 then FreeAndNil(MaskList); @@ -1206,18 +855,20 @@ begin FSearching := True; SearchDirectories:=TStringList.Create; try - while ASearchPath<>'' do begin - p:=Pos(';',ASearchPath); - if p<1 then - p:=length(ASearchPath)+1; - Dir:=LazFileUtils.TrimFilename(LeftStr(ASearchPath,p-1)); - Delete(ASearchPath,1,p); + p1:=1; + while p1<=Length(ASearchPath) do + begin + p2:=PosEx(FPathSeparator,ASearchPath,p1); + if p2<1 then + p2:=length(ASearchPath)+1; + Dir:=ResolveDots(Copy(ASearchPath,p1,p2-p1)); + p1:=p2+1; if Dir='' then continue; - Dir:=LazFileUtils.ChompPathDelim(Dir); + Dir:=ChompPathDelim(Dir); for i:=SearchDirectories.Count-1 downto 0 do begin OtherDir:=SearchDirectories[i]; - if (LazFileUtils.CompareFilenames(Dir,OtherDir)=0) + if (CompareFilenames(Dir,OtherDir)=0) or (ASearchSubDirs and (FileIsInPath(Dir,OtherDir))) then begin // directory Dir is already searched @@ -1237,7 +888,7 @@ begin else begin for i:=0 to SearchDirectories.Count-1 do - DoSearch(LazFileUtils.AppendPathDelim(SearchDirectories[i]), 0); + DoSearch(AppendPathDelim(SearchDirectories[i]), 0); end; finally SearchDirectories.Free; @@ -1245,3 +896,4 @@ begin if MaskList <> nil then MaskList.Free; end; end; + diff --git a/src/lib/Lazarus/components/lazutils/fileutil.pas b/src/lib/Lazarus/components/lazutils/fileutil.pas new file mode 100644 index 00000000..e7321dcf --- /dev/null +++ b/src/lib/Lazarus/components/lazutils/fileutil.pas @@ -0,0 +1,242 @@ +{ + ***************************************************************************** + This file is part of LazUtils. + + See the file COPYING.modifiedLGPL.txt, included in this distribution, + for details about the license. + ***************************************************************************** +} + +{ **************************************************************************** +BB: 2013-05-19 + +Note to developers: + +This unit should contain functions and procedures to +maintain compatibility with Delphi's FileUtil unit. + +File routines that specifically deal with UTF8 filenames should go into +the LazFileUtils unit. + +***************************************************************************** } +unit FileUtil; + +{$mode objfpc}{$H+} +{$i lazutils_defines.inc} + +interface + +uses + Classes, SysUtils, StrUtils, + // LazUtils + Masks, LazUTF8, LazFileUtils; + +{$IF defined(Windows) or defined(darwin) or defined(HASAMIGA)} +{$define CaseInsensitiveFilenames} +{$ENDIF} +{$IF defined(CaseInsensitiveFilenames) or defined(darwin)} +{$define NotLiteralFilenames} +{$ENDIF} + +const + UTF8FileHeader = #$ef#$bb#$bf; + FilenamesCaseSensitive = {$IFDEF CaseInsensitiveFilenames}false{$ELSE}true{$ENDIF};// lower and upper letters are treated the same + FilenamesLiteral = {$IFDEF NotLiteralFilenames}false{$ELSE}true{$ENDIF};// file names can be compared using = string operator + +// basic functions similar to the RTL but working with UTF-8 instead of the +// system encoding + +// AnsiToUTF8 and UTF8ToAnsi need a widestring manager under Linux, BSD, MacOSX +// but normally these OS use UTF-8 as system encoding so the widestringmanager +// is not needed. + +// file and directory operations +function ComparePhysicalFilenames(const Filename1, Filename2: string): integer; +function CompareFilenames(Filename1: PChar; Len1: integer; + Filename2: PChar; Len2: integer; ResolveLinks: boolean): integer; overload; +function ExtractShortPathNameUTF8(Const FileName : String) : String; +function DeleteDirectory(const DirectoryName: string; OnlyChildren: boolean): boolean; +function ProgramDirectory: string; +function ProgramDirectoryWithBundle: string; + +function ExpandUNCFileNameUTF8(const FileName: string): string; +function FileSize(const Filename: string): int64; overload; inline; +function FilenameIsPascalUnit(const Filename: string): boolean; +function FileIsInPath(const Filename, Path: string): boolean; +function FileIsInDirectory(const Filename, Directory: string): boolean; + +function ExtractFileNameWithoutExt(const AFilename: string): string; deprecated 'Use the function from unit LazFileUtils'; +function CreateAbsoluteSearchPath(const SearchPath, BaseDirectory: string): string; deprecated 'Use the function from unit LazFileUtils'; +function CreateAbsolutePath(const Filename, BaseDirectory: string): string; deprecated 'Use the function from unit LazFileUtils'; + +function GetAllFilesMask: string; inline; +function GetExeExt: string; inline; +function ReadFileToString(const Filename: string): string; + +// file search +type + TSearchFileInPathFlag = ( + sffDontSearchInBasePath, // do not search in BasePath, search only in SearchPath. + sffSearchLoUpCase, + sffFile, // must be file, not directory + sffExecutable, // file must be executable + sffDequoteSearchPath // ansi dequote + ); + TSearchFileInPathFlags = set of TSearchFileInPathFlag; +const + sffFindProgramInPath = [ + {$IFDEF Unix}sffDontSearchInBasePath,{$ENDIF} + {$IFDEF Windows}sffDequoteSearchPath,{$ENDIF} + sffFile, + sffExecutable + ]; + +function SearchFileInPath(const Filename, BasePath: string; + SearchPath: string; const Delimiter: string; + Flags: TSearchFileInPathFlags): string; overload; +function SearchAllFilesInPath(const Filename, BasePath, SearchPath, + Delimiter: string; Flags: TSearchFileInPathFlags): TStrings; +function FindDiskFilename(const Filename: string): string; +function FindDiskFileCaseInsensitive(const Filename: string): string; +function FindDefaultExecutablePath(const Executable: string; const BaseDir: string = ''): string; + +type + + { TFileIterator } + + TFileIterator = class + private + FPath: String; + FLevel: Integer; + FFileInfo: TSearchRec; + FSearching: Boolean; + function GetFileName: String; + public + procedure Stop; + function IsDirectory: Boolean; + public + property FileName: String read GetFileName; + property FileInfo: TSearchRec read FFileInfo; + property Level: Integer read FLevel; + property Path: String read FPath; + property Searching: Boolean read FSearching; + end; + + TFileFoundEvent = procedure (FileIterator: TFileIterator) of object; + TDirectoryFoundEvent = procedure (FileIterator: TFileIterator) of object; + TDirectoryEnterEvent = procedure (FileIterator: TFileIterator) of object; + + { TFileSearcher } + + TFileSearcher = class(TFileIterator) + private + FMaskSeparator: char; + FPathSeparator: char; + FFollowSymLink: Boolean; + FOnFileFound: TFileFoundEvent; + FOnDirectoryFound: TDirectoryFoundEvent; + FOnDirectoryEnter: TDirectoryEnterEvent; + FFileAttribute: Word; + FDirectoryAttribute: Word; + procedure RaiseSearchingError; + protected + procedure DoDirectoryEnter; virtual; + procedure DoDirectoryFound; virtual; + procedure DoFileFound; virtual; + public + constructor Create; + procedure Search(const ASearchPath: String; const ASearchMask: String = ''; + ASearchSubDirs: Boolean = True; CaseSensitive: Boolean = False); + public + property MaskSeparator: char read FMaskSeparator write FMaskSeparator; + property PathSeparator: char read FPathSeparator write FPathSeparator; + property FollowSymLink: Boolean read FFollowSymLink write FFollowSymLink; + property FileAttribute: Word read FFileAttribute write FFileAttribute default faAnyfile; + property DirectoryAttribute: Word read FDirectoryAttribute write FDirectoryAttribute default faDirectory; + property OnDirectoryFound: TDirectoryFoundEvent read FOnDirectoryFound write FOnDirectoryFound; + property OnFileFound: TFileFoundEvent read FOnFileFound write FOnFileFound; + property OnDirectoryEnter: TDirectoryEnterEvent read FOnDirectoryEnter write FOnDirectoryEnter; + end; + + { TListFileSearcher } + + TListFileSearcher = class(TFileSearcher) + private + FList: TStrings; + protected + procedure DoFileFound; override; + public + constructor Create(AList: TStrings); + end; + + { TListDirectoriesSearcher } + + TListDirectoriesSearcher = class(TFileSearcher) + private + FDirectoriesList :TStrings; + protected + procedure DoDirectoryFound; override; + public + constructor Create(AList: TStrings); + end; + +function FindAllFiles(const SearchPath: String; const SearchMask: String = ''; + SearchSubDirs: Boolean = True; DirAttr: Word = faDirectory; + MaskSeparator: char = ';'; PathSeparator: char = ';'): TStringList; overload; +procedure FindAllFiles(AList: TStrings; const SearchPath: String; + const SearchMask: String = ''; SearchSubDirs: Boolean = True; DirAttr: Word = faDirectory; + MaskSeparator: char = ';'; PathSeparator: char = ';'); overload; + +function FindAllDirectories(const SearchPath: string; + SearchSubDirs: Boolean = True; PathSeparator: char = ';'): TStringList; overload; +procedure FindAllDirectories(AList: TStrings; const SearchPath: String; + SearchSubDirs: Boolean = true; PathSeparator: char = ';'); overload; + +// flags for copy +type + TCopyFileFlag = ( + cffOverwriteFile, + cffCreateDestDirectory, + cffPreserveTime + ); + TCopyFileFlags = set of TCopyFileFlag; + +// Copy a file and a whole directory tree +function CopyFile(const SrcFilename, DestFilename: string; + Flags: TCopyFileFlags=[cffOverwriteFile]; ExceptionOnError: Boolean=False): boolean; +function CopyFile(const SrcFilename, DestFilename: string; PreserveTime: boolean; ExceptionOnError: Boolean=False): boolean; +function CopyDirTree(const SourceDir, TargetDir: string; Flags: TCopyFileFlags=[]): Boolean; + +// filename parts +const + PascalFileExt: array[1..3] of string = ('.pas','.pp','.p'); + PascalSourceExt: array[1..6] of string = ('.pas','.pp','.p','.lpr','.dpr','.dpk'); + + AllDirectoryEntriesMask = '*'; + +implementation + +uses +{$IFDEF windows} + Windows; +{$ELSE} + {$IFDEF HASAMIGA} + AmigaDOS; + {$ELSE} + Unix; + {$ENDIF} +{$ENDIF} + +{$I fileutil.inc} +{$IFDEF windows} + {$i winfileutil.inc} +{$ELSE} + {$IFDEF HASAMIGA} + {$i unixfileutil.inc} // Reuse UNIX code for Amiga + {$ELSE} + {$i unixfileutil.inc} + {$ENDIF} +{$ENDIF} + +end. + diff --git a/src/lib/Lazarus/fpcadds.pas b/src/lib/Lazarus/components/lazutils/fpcadds.pas similarity index 78% rename from src/lib/Lazarus/fpcadds.pas rename to src/lib/Lazarus/components/lazutils/fpcadds.pas index 2190ec07..aa0fd34d 100644 --- a/src/lib/Lazarus/fpcadds.pas +++ b/src/lib/Lazarus/components/lazutils/fpcadds.pas @@ -25,24 +25,21 @@ interface function StrToWord(const s: string): word; -function AlignToPtr(const p: Pointer): Pointer; -function AlignToInt(const p: Pointer): Pointer; +function AlignToPtr(const p: Pointer): Pointer; inline; +function AlignToInt(const p: Pointer): Pointer; inline; implementation function StrToWord(const s: string): word; var - p: Integer; + i: Integer; begin Result:=0; - p:=1; - while (p<=length(s)) do begin - Result:=Result*10+ord(s[p])-ord('0'); - inc(p); - end; + for i:=1 to Length(s) do + Result:=Result*10+ord(s[i])-ord('0'); end; -function AlignToPtr(const p: Pointer): Pointer; +function AlignToPtr(const p: Pointer): Pointer; inline; begin {$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT} Result := Align(p, SizeOf(Pointer)); @@ -51,7 +48,7 @@ function AlignToPtr(const p: Pointer): Pointer; {$ENDIF} end; -function AlignToInt(const p: Pointer): Pointer; +function AlignToInt(const p: Pointer): Pointer; inline; begin {$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT} Result := Align(p, SizeOf(integer)); diff --git a/src/lib/Lazarus/lazfileutils.inc b/src/lib/Lazarus/components/lazutils/lazfileutils.inc similarity index 83% rename from src/lib/Lazarus/lazfileutils.inc rename to src/lib/Lazarus/components/lazutils/lazfileutils.inc index 9d35a015..698fe69f 100644 --- a/src/lib/Lazarus/lazfileutils.inc +++ b/src/lib/Lazarus/components/lazutils/lazfileutils.inc @@ -3,29 +3,51 @@ function ResolveDots(const AFilename: string): string; //trim double path delims and expand special dirs like .. and . //on Windows change also '/' to '\' except for filenames starting with '\\?\' -var SrcPos, DestPos, l, DirStart: integer; + + {$ifdef windows} + function IsDriveDelim(const Path: string; p: integer): boolean; inline; + begin + Result:=(p=2) and (Path[2]=DriveDelim) and (Path[1] in ['a'..'z','A'..'Z']); + end; + {$endif} + + function IsPathDelim(const Path: string; p: integer): boolean; + begin + if (p<=0) or (Path[p]=PathDelim) then exit(true); + {$ifdef windows} + if IsDriveDelim(Path,p) then + exit(true); + {$endif} + Result:=false; + end; + +var SrcPos, DestPos, Len, DirStart: integer; c: char; MacroPos: LongInt; begin + Len:=length(AFilename); + if Len=0 then exit(''); + Result:=AFilename; + {$ifdef windows} //Special case: everything is literal after this, even dots (this does not apply to '//?/') - if (Pos('\\?\', AFilename) = 1) then Exit; + if (length(AFilename)>=4) and (AFilename[1]='\') and (AFilename[2]='\') + and (AFilename[3]='?') and (AFilename[4]='\') then + exit; {$endif} - l:=length(AFilename); SrcPos:=1; DestPos:=1; - // trim double path delimiters and special dirs . and .. - while (SrcPos<=l) do begin + while (SrcPos<=Len) do begin c:=AFilename[SrcPos]; {$ifdef windows} //change / to \. The WinApi accepts both, but it leads to strange effects in other places if (c in AllowDirectorySeparators) then c := PathDelim; {$endif} - // check for double path delims + // check for duplicate path delims if (c=PathDelim) then begin inc(SrcPos); {$IFDEF Windows} @@ -34,7 +56,7 @@ begin if (DestPos>1) {$ENDIF} and (Result[DestPos-1]=PathDelim) then begin - // skip second PathDelim + // skip duplicate PathDelim continue; end; Result[DestPos]:=c; @@ -43,15 +65,17 @@ begin end; // check for special dirs . and .. if (c='.') then begin - if (SrcPos skip inc(SrcPos,2); + while (SrcPos<=Len) and (AFilename[SrcPos] in AllowDirectorySeparators) do + inc(SrcPos); continue; end else if (AFilename[SrcPos+1]='.') - and (SrcPos+1=l) or (AFilename[SrcPos+2]=PathDelim) then + and ((SrcPos+1=Len) or (AFilename[SrcPos+2] in AllowDirectorySeparators)) then begin // special dir .. // 1. .. -> copy @@ -69,11 +93,10 @@ begin inc(SrcPos,2); continue; {$IFDEF Windows} - end else if (DestPos=3) and (Result[2]=':') - and (Result[1] in ['a'..'z','A'..'Z']) then begin + end else if (DestPos=3) and IsDriveDelim(Result,2) then begin // 3. C:.. -> copy - end else if (DestPos=4) and (Result[2]=':') and (Result[3]=PathDelim) - and (Result[1] in ['a'..'z','A'..'Z']) then begin + end else if (DestPos=4) and (Result[3]=PathDelim) + and IsDriveDelim(Result,2) then begin // 4. C:\.. -> skip .., keep C:\ inc(SrcPos,2); continue; @@ -87,13 +110,17 @@ begin // */. if (DestPos>3) and (Result[DestPos-2]='.') and (Result[DestPos-3]='.') - and ((DestPos=4) or (Result[DestPos-4]=PathDelim)) then begin + and IsPathDelim(Result,DestPos-4) then begin // 6. ../.. -> copy because if the first '..' was not resolved, the next can't neither end else begin // 7. xxxdir/.. -> trim dir and skip .. DirStart:=DestPos-2; while (DirStart>1) and (Result[DirStart-1]<>PathDelim) do dec(DirStart); + {$ifdef windows} + if (DirStart=1) and IsDriveDelim(Result,2) then + inc(DirStart,2); + {$endif} MacroPos:=DirStart; while MacroPosl then begin + if SrcPos>Len then begin // '..' at end of filename - if (DestPos>1) and (Result[DestPos-1]<>PathDelim) then begin + if (DestPos>1) and (Result[DestPos-1]=PathDelim) then begin // foo/dir/.. -> foo dec(DestPos); end else if (DestPos=1) then begin @@ -120,7 +147,7 @@ begin end; end else if DestPos=1 then begin // e.g. 'foo/../' - while (SrcPos<=l) and (AFilename[SrcPos] in AllowDirectorySeparators) do + while (SrcPos<=Len) and (AFilename[SrcPos] in AllowDirectorySeparators) do inc(SrcPos); end; continue; @@ -133,10 +160,18 @@ begin if DestPos=1 then begin Result:='.'; exit; - end else begin - // skip - break; end; + if (DestPos>2) and (Result[DestPos-1]=PathDelim) + {$ifdef windows} + and not IsDriveDelim(Result,DestPos-2) + {$endif} + then begin + // foo/. -> foo + // C:foo\. -> C:foo + // C:\. -> C:\ + dec(DestPos); + end; + break; end; end; // copy directory @@ -144,7 +179,7 @@ begin Result[DestPos]:=c; inc(DestPos); inc(SrcPos); - if (SrcPos>l) then break; + if (SrcPos>Len) then break; c:=AFilename[SrcPos]; {$ifdef windows} //change / to \. The WinApi accepts both, but it leads to strange effects in other places @@ -155,7 +190,10 @@ begin end; // trim result if DestPos<=length(AFilename) then - SetLength(Result,DestPos-1); + if (DestPos=1) then + Result:='.' + else + SetLength(Result,DestPos-1); end; function FilenameIsWinAbsolute(const TheFilename: string): boolean; @@ -175,6 +213,20 @@ begin Result:=(TheFilename<>'') and (TheFilename[1]='/'); end; +function CreateAbsolutePath(const Filename, BaseDirectory: string): string; +begin + if (Filename='') or FilenameIsAbsolute(Filename) then + Result:=Filename + {$IFDEF Windows} + else if (Filename[1]='\') then + // only use drive of BaseDirectory + Result:=ExtractFileDrive(BaseDirectory)+Filename + {$ENDIF} + else + Result:=AppendPathDelim(BaseDirectory)+Filename; + Result:=TrimFilename(Result); +end; + { Returns True if it is possible to create a relative path from Source to Dest @@ -207,9 +259,8 @@ end; - Dest = /foo Source = /bar AlwaysRequireSharedBaseFolder = True Result = False - Dest = /foo Source = /bar AlwaysRequireSharedBaseFolder = False Result = True RelPath = ../foo } - function TryCreateRelativePath(const Dest, Source: String; UsePointDirectory: boolean; - AlwaysRequireSharedBaseFolder: Boolean; out RelPath: String): Boolean; + AlwaysRequireSharedBaseFolder: Boolean; out RelPath: String): Boolean; Const MaxDirs = 129; Type @@ -378,7 +429,7 @@ begin end; function CreateRelativePath(const Filename, BaseDirectory: string; - UsePointDirectory: boolean; AlwaysRequireSharedBaseFolder: Boolean): string; + UsePointDirectory: boolean; AlwaysRequireSharedBaseFolder: Boolean): string; var RelPath: String; begin @@ -408,3 +459,4 @@ begin if (faSymLink{%H-} and Attr) > 0 then Result[8] := 'L'; end; end; + diff --git a/src/lib/Lazarus/lazfileutils.pas b/src/lib/Lazarus/components/lazutils/lazfileutils.pas similarity index 85% rename from src/lib/Lazarus/lazfileutils.pas rename to src/lib/Lazarus/components/lazutils/lazfileutils.pas index df0f3bb7..350ed5a1 100644 --- a/src/lib/Lazarus/lazfileutils.pas +++ b/src/lib/Lazarus/components/lazutils/lazfileutils.pas @@ -29,9 +29,7 @@ interface function CompareFilenames(const Filename1, Filename2: string): integer; overload; function CompareFilenamesIgnoreCase(const Filename1, Filename2: string): integer; function CompareFileExt(const Filename, Ext: string; - CaseSensitive: boolean): integer; overload; -function CompareFileExt(const Filename, Ext: string): integer; overload; - + CaseSensitive: boolean = False): integer; function CompareFilenameStarts(const Filename1, Filename2: string): integer; function CompareFilenames(Filename1: PChar; Len1: integer; Filename2: PChar; Len2: integer): integer; overload; @@ -42,6 +40,7 @@ function CompareFilenamesP(Filename1, Filename2: PChar; function DirPathExists(DirectoryName: string): boolean; function DirectoryIsWritable(const DirectoryName: string): boolean; function ExtractFileNameOnly(const AFilename: string): string; +function ExtractFileNameWithoutExt(const AFilename: string): string; function FilenameIsAbsolute(const TheFilename: string):boolean; function FilenameIsWinAbsolute(const TheFilename: string):boolean; function FilenameIsUnixAbsolute(const TheFilename: string):boolean; @@ -59,19 +58,44 @@ function FilenameIsTrimmed(const TheFilename: string): boolean; function FilenameIsTrimmed(StartPos: PChar; NameLen: integer): boolean; function TrimFilename(const AFilename: string): string; function ResolveDots(const AFilename: string): string; -Procedure ForcePathDelims(Var FileName: string); -Function GetForcedPathDelims(Const FileName: string): String; function CleanAndExpandFilename(const Filename: string): string; // empty string returns current directory function CleanAndExpandDirectory(const Filename: string): string; // empty string returns current directory function TrimAndExpandFilename(const Filename: string; const BaseDir: string = ''): string; // empty string returns empty string function TrimAndExpandDirectory(const Filename: string; const BaseDir: string = ''): string; // empty string returns empty string +function CreateAbsolutePath(const Filename, BaseDirectory: string): string; function TryCreateRelativePath(const Dest, Source: String; UsePointDirectory: boolean; - AlwaysRequireSharedBaseFolder: Boolean; out RelPath: String): Boolean; + AlwaysRequireSharedBaseFolder: Boolean; out RelPath: String): Boolean; function CreateRelativePath(const Filename, BaseDirectory: string; - UsePointDirectory: boolean = false; AlwaysRequireSharedBaseFolder: Boolean = True): string; + UsePointDirectory: boolean = false; AlwaysRequireSharedBaseFolder: Boolean = True): string; function FileIsInPath(const Filename, Path: string): boolean; +function PathIsInPath(const Path, Directory: string): boolean; +// Storten a file name for display. +function ShortDisplayFilename(const aFileName: string; aLimit: Integer = 80): string; + +type + TPathDelimSwitch = ( + pdsNone, // no change + pdsSystem, // switch to current PathDelim + pdsUnix, // switch to slash / + pdsWindows // switch to backslash \ + ); +const + PathDelimSwitchToDelim: array[TPathDelimSwitch] of char = ( + PathDelim, // pdsNone + PathDelim, // pdsSystem + '/', // pdsUnix + '\' // pdsWindows + ); + +// Path delimiters +procedure ForcePathDelims(Var FileName: string); +function GetForcedPathDelims(const FileName: string): string; function AppendPathDelim(const Path: string): string; function ChompPathDelim(const Path: string): string; +function SwitchPathDelims(const Filename: string; Switch: TPathDelimSwitch): string; +function SwitchPathDelims(const Filename: string; Switch: boolean): string; +function CheckPathDelim(const OldPathDelim: string; out Changed: boolean): TPathDelimSwitch; +function IsCurrentPathDelim(Switch: TPathDelimSwitch): boolean; // search paths function CreateAbsoluteSearchPath(const SearchPath, BaseDirectory: string): string; @@ -148,10 +172,16 @@ function GetDarwinNormalizedFilename(Filename: string; nForm:Integer=2): string; function SHGetFolderPathUTF8(ID : Integer) : String; {$ENDIF} +// Command line procedure SplitCmdLineParams(const Params: string; ParamList: TStrings; ReadBackslash: boolean = false); function StrToCmdLineParam(const Param: string): string; function MergeCmdLineParams(ParamList: TStrings): string; +// ToDo: Study if they are needed or if the above functions could be used instead. +procedure SplitCmdLine(const CmdLine: string; + out ProgramFilename, Params: string); +function PrepareCmdLineOption(const Option: string): string; + type TInvalidateFileStateCacheEvent = procedure(const Filename: string); @@ -265,11 +295,6 @@ function CompareFileExt(const Filename, Ext: string; CaseSensitive: boolean): in if Result > 0 then Result := 1; end; -function CompareFileExt(const Filename, Ext: string): integer; -begin - Result := CompareFileExt(Filename, Ext, False); -end; - function ExtractFileNameOnly(const AFilename: string): string; var StartPos: Integer; @@ -288,6 +313,24 @@ function ExtractFileNameOnly(const AFilename: string): string; Result:=copy(AFilename,StartPos,ExtPos-StartPos); end; +function ExtractFileNameWithoutExt(const AFilename: string): string; +var + p: Integer; +begin + Result:=AFilename; + p:=length(Result); + while (p>0) do begin + case Result[p] of + PathDelim: exit; + {$ifdef windows} + '/': if ('/' in AllowDirectorySeparators) then exit; + {$endif} + '.': exit(copy(Result,1, p-1)); + end; + dec(p); + end; +end; + {$IFDEF darwin} function GetDarwinSystemFilename(Filename: string): string; var @@ -498,15 +541,19 @@ function DirectoryIsWritable(const DirectoryName: string): boolean; end; function ForceDirectory(DirectoryName: string): boolean; -var i: integer; +var + i: integer; Dir: string; begin DirectoryName:=AppendPathDelim(DirectoryName); i:=1; while i<=length(DirectoryName) do begin if DirectoryName[i] in AllowDirectorySeparators then begin + // optimize paths like \foo\\bar\\foobar + while (i'') and not DirPathExists(Dir) then begin Result:=CreateDirUTF8(Dir); if not Result then exit; end; @@ -516,7 +563,6 @@ function ForceDirectory(DirectoryName: string): boolean; Result:=true; end; - function FileIsText(const AFilename: string): boolean; var FileReadable: Boolean; @@ -529,10 +575,11 @@ function FileIsText(const AFilename: string; out FileReadable: boolean): boolean var Buf: string; Len: integer; - NewLine: boolean; p: PChar; ZeroAllowed: Boolean; fHandle: THandle; +const + BufSize = 2048; begin Result:=false; FileReadable:=true; @@ -540,7 +587,7 @@ function FileIsText(const AFilename: string; out FileReadable: boolean): boolean if (THandle(fHandle) <> feInvalidHandle) then begin try - Len:=1024; + Len:=BufSize; SetLength(Buf,Len+1); Len := FileRead(fHandle,Buf[1],Len); @@ -560,7 +607,6 @@ function FileIsText(const AFilename: string; out FileReadable: boolean): boolean inc(p,2); ZeroAllowed:=true; end; - NewLine:=false; while true do begin case p^ of #0: @@ -572,12 +618,10 @@ function FileIsText(const AFilename: string; out FileReadable: boolean): boolean // #12: form feed // #26: end of file #1..#8,#11,#14..#25,#27..#31: exit; - #10,#13: NewLine:=true; end; inc(p); end; - if NewLine or (Len<1024) then - Result:=true; + Result:=true; end else Result:=true; finally @@ -659,26 +703,6 @@ function TrimFilename(const AFilename: string): string; Result := ResolveDots(Result); end; -procedure ForcePathDelims(var FileName: string); -var - i: Integer; -begin - for i:=1 to length(FileName) do - {$IFDEF Windows} - if Filename[i]='/' then - Filename[i]:='\'; - {$ELSE} - if Filename[i]='\' then - Filename[i]:='/'; - {$ENDIF} -end; - -function GetForcedPathDelims(const FileName: string): String; -begin - Result:=FileName; - ForcePathDelims(Result); -end; - {------------------------------------------------------------------------------ function CleanAndExpandFilename(const Filename: string): string; ------------------------------------------------------------------------------} @@ -709,21 +733,13 @@ function TrimAndExpandDirectory(const Filename: string; const BaseDir: string): Result:=TrimFilename(AppendPathDelim(ExpandFileNameUTF8(Result,BaseDir))); end; - - -{------------------------------------------------------------------------------ - function FileIsInPath(const Filename, Path: string): boolean; - ------------------------------------------------------------------------------} function FileIsInPath(const Filename, Path: string): boolean; var ExpFile: String; ExpPath: String; l: integer; begin - if Path='' then begin - Result:=false; - exit; - end; + if Path='' then exit(false); ExpFile:=ResolveDots(Filename); ExpPath:=AppendPathDelim(ResolveDots(Path)); l:=length(ExpPath); @@ -731,6 +747,71 @@ function FileIsInPath(const Filename, Path: string): boolean; and (CompareFilenames(ExpPath,LeftStr(ExpFile,l))=0); end; +function PathIsInPath(const Path, Directory: string): boolean; +// Note: Under Windows this treats C: as C:\ +var + ExpPath: String; + ExpDir: String; + l: integer; +begin + if Path='' then exit(false); + ExpPath:=AppendPathDelim(ResolveDots(Path)); + ExpDir:=AppendPathDelim(ResolveDots(Directory)); + l:=length(ExpDir); + Result:=(l>0) and (length(ExpPath)>=l) and (ExpPath[l]=PathDelim) + and (CompareFilenames(ExpDir,LeftStr(ExpPath,l))=0); +end; + +function ShortDisplayFilename(const aFileName: string; aLimit: Integer): string; +// Shorten a long filename for display. +// Add '...' after the 2. path delimiter, then the end part of filename. +var + StartLen, EndLen, SepCnt: Integer; +begin + if Length(aFileName) > aLimit then + begin + StartLen := 1; + SepCnt := 0; + while StartLen < Length(aFileName) - (aLimit div 2) do + begin + if aFileName[StartLen] in AllowDirectorySeparators then + begin + Inc(SepCnt); + if SepCnt = 2 then Break; + end; + Inc(StartLen); + end; + EndLen := aLimit - StartLen - 3; + Result := Copy(aFileName, 1, StartLen) + '...' + + Copy(aFileName, Length(aFileName)-EndLen+1, EndLen); + end + else + Result := aFileName; +end; + + +// Path delimiters + +procedure ForcePathDelims(var FileName: string); +var + i: Integer; +begin + for i:=1 to length(FileName) do + {$IFDEF Windows} + if Filename[i]='/' then + Filename[i]:='\'; + {$ELSE} + if Filename[i]='\' then + Filename[i]:='/'; + {$ENDIF} +end; + +function GetForcedPathDelims(const FileName: string): string; +begin + Result:=FileName; + ForcePathDelims(Result); +end; + function AppendPathDelim(const Path: string): string; begin if (Path<>'') and not (Path[length(Path)] in AllowDirectorySeparators) then @@ -769,8 +850,55 @@ function ChompPathDelim(const Path: string): string; SetLength(Result,Len); end; -function CreateAbsoluteSearchPath(const SearchPath, BaseDirectory: string - ): string; +function SwitchPathDelims(const Filename: string; Switch: TPathDelimSwitch): string; +var + i: Integer; + p: Char; +begin + Result:=Filename; + case Switch of + pdsSystem: p:=PathDelim; + pdsUnix: p:='/'; + pdsWindows: p:='\'; + else exit; + end; + for i:=1 to length(Result) do + if Result[i] in ['/','\'] then + Result[i]:=p; +end; + +function SwitchPathDelims(const Filename: string; Switch: boolean): string; +begin + if Switch then + Result:=SwitchPathDelims(Filename,pdsSystem) + else + Result:=Filename; +end; + +function CheckPathDelim(const OldPathDelim: string; out Changed: boolean): TPathDelimSwitch; +begin + Changed:=OldPathDelim<>PathDelim; + if Changed then begin + if OldPathDelim='/' then + Result:=pdsUnix + else if OldPathDelim='\' then + Result:=pdsWindows + else + Result:=pdsSystem; + end else begin + Result:=pdsNone; + end; +end; + +function IsCurrentPathDelim(Switch: TPathDelimSwitch): boolean; +begin + Result:=(Switch in [pdsNone,pdsSystem]) + or ((Switch=pdsUnix) and (PathDelim='/')) + or ((Switch=pdsWindows) and (PathDelim='\')); +end; + + +function CreateAbsoluteSearchPath(const SearchPath, BaseDirectory: string): string; var PathLen: Integer; EndPos: Integer; @@ -1198,6 +1326,7 @@ function StrToCmdLineParam(const Param: string): string; const NoQuot = ' '; AnyQuot = '*'; + SysQuot = {$IFDEF Windows}'"'{$ELSE}''''{$ENDIF}; var Quot: Char; p: PChar; @@ -1217,7 +1346,7 @@ function StrToCmdLineParam(const Param: string): string; if iquote) do + SkipChar; + // go past last character or quoted string + l:=p-s; + inc(p); + end else begin + while (p<=length(CmdLine)) and (CmdLine[p]>' ') do + SkipChar; + l:=p-s; + end; + ProgramFilename:=Copy(CmdLine,s,l); + while (p<=length(CmdLine)) and (CmdLine[p]<=' ') do inc(p); + Params:=copy(CmdLine,p,length(CmdLine)); +end; + +function PrepareCmdLineOption(const Option: string): string; +// If there is a space in the option add " " around the whole option +var + i: integer; +begin + Result:=Option; + if (Result='') or (Result[1] in ['"','''']) then exit; + for i:=1 to length(Result) do begin + case Result[i] of + ' ','''': + begin + Result:=AnsiQuotedStr(Result,'"'); + exit; + end; + '"': + begin + Result:=AnsiQuotedStr(Result,''''); + exit; + end; + end; + end; +end; +{ +function AddCmdLineParameter(const CmdLine, AddParameter: string): string; +begin + Result:=CmdLine; + if (Result<>'') and (Result[length(Result)]<>' ') then + Result:=Result+' '; + Result:=Result+AddParameter; +end; +} { Returns - DriveLetter + : + PathDelim on Windows (if present) or @@ -1347,3 +1552,4 @@ finalization end. end. + diff --git a/src/lib/Lazarus/lazutf8.pas b/src/lib/Lazarus/components/lazutils/lazutf8.pas similarity index 91% rename from src/lib/Lazarus/lazutf8.pas rename to src/lib/Lazarus/components/lazutils/lazutf8.pas index fd779717..9d84c49c 100644 --- a/src/lib/Lazarus/lazutf8.pas +++ b/src/lib/Lazarus/components/lazutils/lazutf8.pas @@ -33,7 +33,7 @@ interface {$ifdef windows} Windows, {$endif} - Classes, SysUtils; + Classes, SysUtils, strutils; // AnsiToUTF8 and UTF8ToAnsi need a widestring manager under Linux, BSD, MacOSX // but normally these OS use UTF-8 as system encoding so the widestringmanager @@ -67,15 +67,16 @@ procedure GetFormatSettingsUTF8; procedure GetLocaleFormatSettingsUTF8(LCID: Integer; var aFormatSettings: TFormatSettings); {$endif} -Function GetEnvironmentVariableCountUTF8: Integer; -function GetEnvironmentStringUTF8(Index: Integer): string; +Function GetEnvironmentVariableCountUTF8: Integer; inline; +function GetEnvironmentStringUTF8(Index: Integer): string; inline; function GetEnvironmentVariableUTF8(const EnvVar: string): String; function SysErrorMessageUTF8(ErrorCode: Integer): String; // Returns the size of one codepoint in bytes. -function UTF8CharacterLength(p: PChar): integer; inline; -// Fast version of UTF8CharacterLength. Assumes the UTF-8 codepoint is valid. -function UTF8CharacterLengthFast(p: PChar): integer; inline; +function UTF8CodepointSize(p: PChar): integer; inline; +function UTF8CharacterLength(p: PChar): integer; deprecated 'Use UTF8CodepointSize instead.'; +// Fast version of UTF8CodepointSize. Assumes the UTF-8 codepoint is valid. +function UTF8CodepointSizeFast(p: PChar): integer; inline; function UTF8Length(const s: string): PtrInt; inline; function UTF8Length(p: PChar; ByteCount: PtrInt): PtrInt; @@ -84,70 +85,74 @@ function UTF8LengthFast(const s: string): PtrInt; inline; function UTF8LengthFast(p: PChar; ByteCount: PtrInt): PtrInt; // Functions dealing with unicode number U+xxx. -function UTF8CharacterToUnicode(p: PChar; out CharLen: integer): Cardinal; +function UTF8CodepointToUnicode(p: PChar; out CodepointLen: integer): Cardinal; +function UTF8CharacterToUnicode(p: PChar; out CharLen: integer): Cardinal; deprecated 'Use UTF8CodepointToUnicode instead.'; function UnicodeToUTF8(CodePoint: cardinal): string; // UTF32 to UTF8 function UnicodeToUTF8(CodePoint: cardinal; Buf: PChar): integer; // UTF32 to UTF8 -function UnicodeToUTF8SkipErrors(CodePoint: cardinal; Buf: PChar): integer; // UTF32 to UTF8 +function UnicodeToUTF8SkipErrors(CodePoint: cardinal; Buf: PChar): integer; inline; // UTF32 to UTF8 function UnicodeToUTF8Inline(CodePoint: cardinal; Buf: PChar): integer; inline; // UTF32 to UTF8 function UTF8ToDoubleByteString(const s: string): string; function UTF8ToDoubleByte(UTF8Str: PChar; Len: PtrInt; DBStr: PByte): PtrInt; function UTF8FindNearestCharStart(UTF8Str: PChar; Len: SizeInt; BytePos: SizeInt): SizeInt; -function Utf8TryFindCodepointStart(AString: PChar; var CurPos: PChar; out CharLen: Integer): Boolean; +function Utf8TryFindCodepointStart(AString: PChar; var CurPos: PChar; out CodepointLen: Integer): Boolean; function Utf8TryFindCodepointStart(const AString: String; var Index: Integer; out CharLen: Integer): Boolean; -// find the n-th UTF8 character, ignoring BIDI -function UTF8CharStart(UTF8Str: PChar; Len, CharIndex: PtrInt): PChar; -// find the byte index of the n-th UTF8 character, ignoring BIDI (byte len of substr) -function UTF8CharToByteIndex(UTF8Str: PChar; Len, CharIndex: PtrInt): PtrInt; +// find the n-th UTF8 codepoint, ignoring BIDI +function UTF8CodepointStart(UTF8Str: PChar; Len, CodepointIndex: PtrInt): PChar; +function UTF8CharStart(UTF8Str: PChar; Len, CharIndex: PtrInt): PChar; deprecated 'Use UTF8CodepointStart instead.'; +// find the byte index of the n-th UTF8 codepoint, ignoring BIDI (byte len of substr) +function UTF8CodepointToByteIndex(UTF8Str: PChar; Len, CodepointIndex: PtrInt): PtrInt; +function UTF8CharToByteIndex(UTF8Str: PChar; Len, CharIndex: PtrInt): PtrInt; deprecated 'Use UTF8CodepointToByteIndex instead.'; procedure UTF8FixBroken(P: PChar); overload; procedure UTF8FixBroken(var S: string); overload; -function UTF8CharacterStrictLength(P: PChar): integer; +function UTF8CodepointStrictSize(P: PChar): integer; +function UTF8CharacterStrictLength(P: PChar): integer; deprecated 'Use UTF8CodepointStrictSize instead.'; function UTF8CStringToUTF8String(SourceStart: PChar; SourceLen: PtrInt) : string; function UTF8Pos(const SearchForText, SearchInText: string; StartPos: SizeInt = 1): PtrInt; function UTF8PosP(SearchForText: PChar; SearchForTextLen: SizeInt; SearchInText: PChar; SearchInTextLen: SizeInt): PChar; function UTF8Copy(const s: string; StartCharIndex, CharCount: PtrInt): string; -{$IFnDEF NO_CP_RTL} procedure UTF8Delete(var s: Utf8String; StartCharIndex, CharCount: PtrInt); -{$ENDIF} procedure UTF8Delete(var s: String; StartCharIndex, CharCount: PtrInt); -{$IFnDEF NO_CP_RTL} procedure UTF8Insert(const source: Utf8String; var s: Utf8String; StartCharIndex: PtrInt); -{$ENDIF} procedure UTF8Insert(const source: String; var s: String; StartCharIndex: PtrInt); function UTF8StringReplace(const S, OldPattern, NewPattern: String; - Flags: TReplaceFlags; ALanguage: string=''): String; + Flags: TReplaceFlags; ALanguage: string=''): String; inline; +function UTF8StringReplace(const S, OldPattern, NewPattern: String; + Flags: TReplaceFlags; out Count: Integer; ALanguage: string=''): String; function UTF8LowerCase(const AInStr: string; ALanguage: string=''): string; -function UTF8LowerString(const s: string): string; +function UTF8LowerString(const s: string): string; inline; function UTF8UpperCase(const AInStr: string; ALanguage: string=''): string; -function UTF8UpperString(const s: string): string; +function UTF8UpperString(const s: string): string; inline; function UTF8SwapCase(const AInStr: string; ALanguage: string=''): string; -function FindInvalidUTF8Character(p: PChar; Count: PtrInt; - StopOnNonUTF8: Boolean = true): PtrInt; +// Capitalize the first letters of every word +function UTF8ProperCase(const AInStr: string; const WordDelims: TSysCharSet): string; +function FindInvalidUTF8Codepoint(p: PChar; Count: PtrInt; StopOnNonUTF8: Boolean = true): PtrInt; +function FindInvalidUTF8Character(p: PChar; Count: PtrInt; StopOnNonUTF8: Boolean = true): PtrInt; deprecated 'Use FindInvalidUTF8Codepoint instead.'; function UTF8StringOfChar(AUtf8Char: String; N: Integer): String; function UTF8AddChar(AUtf8Char: String; const S: String; N: Integer): String; function UTF8AddCharR(AUtf8Char: String; const S: String; N: Integer): String; -function UTF8PadLeft(const S: String; const N: Integer; const AUtf8Char: String = #32): String; -function UTF8PadRight(const S: String; const N: Integer; const AUtf8Char: String = #32): String; +function UTF8PadLeft(const S: String; const N: Integer; const AUtf8Char: String = #32): String; inline; +function UTF8PadRight(const S: String; const N: Integer; const AUtf8Char: String = #32): String; inline; function UTF8PadCenter(const S: String; const N: Integer; const AUtf8Char: String = #32): String; -function UTF8LeftStr(const AText: String; const ACount: Integer): String; +function UTF8LeftStr(const AText: String; const ACount: Integer): String; inline; function UTF8RightStr(const AText: String; const ACount: Integer): String; function UTF8QuotedStr(const S, Quote: string): string; //Utf8 version of MidStr is just Utf8Copy with same parameters, so it is not implemented here -function Utf8StartsText(const ASubText, AText: string): Boolean; -function Utf8EndsText(const ASubText, AText: string): Boolean; -function Utf8ReverseString(p: PChar; const ByteCount: LongInt): string; -function Utf8ReverseString(const AText: string): string; inline; -function Utf8RPos(const Substr, Source: string): integer; +function UTF8StartsText(const ASubText, AText: string): Boolean; +function UTF8EndsText(const ASubText, AText: string): Boolean; +function UTF8ReverseString(p: PChar; const ByteCount: LongInt): string; +function UTF8ReverseString(const AText: string): string; inline; +function UTF8RPos(const Substr, Source: string): PtrInt; -function UTF8WrapText(S, BreakStr :string; BreakChars :TSysCharSet; MaxCol: integer): string; overload; -function UTF8WrapText(S :string; MaxCol :integer) :string; overload; +function UTF8WrapText(S, BreakStr: string; BreakChars: TSysCharSet; MaxCol: integer): string; overload; +function UTF8WrapText(S: string; MaxCol: integer): string; overload; type TEscapeMode = (emPascal, emHexPascal, emHexC, emC, emAsciiControlNames); -function ValidUTF8String(const s: String): String; inline; deprecated 'Use Utf8EscapeControlChars() instead.'; // deprecated in 1.7 + function Utf8EscapeControlChars(S: String; EscapeMode: TEscapeMode = emPascal): String; type @@ -162,8 +167,6 @@ function Utf8EscapeControlChars(S: String; EscapeMode: TEscapeMode = emPascal): TUTF8TrimFlags = set of TUTF8TrimFlag; function UTF8Trim(const s: string; Flags: TUTF8TrimFlags = []): string; -procedure AssignUTF8ListToAnsi(UTF8List, AnsiList: TStrings); - //compare functions function UTF8CompareStr(const S1, S2: string): PtrInt; inline; @@ -189,9 +192,9 @@ function ConvertUTF16ToUTF8(Dest: PChar; DestCharCount: SizeUInt; Src: PWideChar; SrcWideCharCount: SizeUInt; Options: TConvertOptions; out ActualCharCount: SizeUInt): TConvertResult; -function UTF8ToUTF16(const S: AnsiString): UnicodeString; overload; +function UTF8ToUTF16(const S: AnsiString): UnicodeString; overload; inline; function UTF8ToUTF16(const P: PChar; ByteCnt: SizeUInt): UnicodeString; overload; -function UTF16ToUTF8(const S: UnicodeString): AnsiString; overload; +function UTF16ToUTF8(const S: UnicodeString): AnsiString; overload; inline; function UTF16ToUTF8(const P: PWideChar; WideCnt: SizeUInt): AnsiString; overload; // locale @@ -202,7 +205,7 @@ procedure LazGetShortLanguageID(var Lang: String); FPUpChars: array[char] of char; procedure ReplaceSubstring(var s: string; StartPos, Count: SizeInt; - const Insertion: string); + const Insertion: string); deprecated 'Use it from unit LazStringUtils'; // Deprecated in 2.1 / 29.10.2020 / Remove in 2.3 implementation @@ -315,10 +318,13 @@ function SysToUTF8(const s: string): string; end; function SysToUTF8(const AFormatSettings: TFormatSettings): TFormatSettings; +{$IFNDEF UTF8_RTL} var i: Integer; +{$ENDIF} begin Result := AFormatSettings; + {$IFNDEF UTF8_RTL} Result.CurrencyString := SysToUTF8(AFormatSettings.CurrencyString); for i:=1 to 12 do begin Result.LongMonthNames[i] := SysToUTF8(AFormatSettings.LongMonthNames[i]); @@ -328,6 +334,7 @@ function SysToUTF8(const AFormatSettings: TFormatSettings): TFormatSettings; Result.LongDayNames[i] := SysToUTF8(AFormatSettings.LongDayNames[i]); Result.ShortDayNames[i] := SysToUTF8(AFormatSettings.ShortDayNames[i]); end; + {$ENDIF} end; function UTF8ToSys(const AFormatSettings: TFormatSettings): TFormatSettings; @@ -350,21 +357,21 @@ function UTF8ToSys(const AFormatSettings: TFormatSettings): TFormatSettings; {$ENDIF} end; -function GetEnvironmentVariableCountUTF8: Integer; +function GetEnvironmentVariableCountUTF8: Integer; inline; begin - {$IF defined(FPC_RTL_UNICODE) or not defined(Windows)} + {$IF defined(FPC_RTL_UNICODE) or not defined(MSWindows)} //also WinCE, issue #0031788 Result:=SysUtils.GetEnvironmentVariableCount; {$ELSE} Result:=GetGetEnvironmentVariableCountWide; {$ENDIF} end; -function GetEnvironmentStringUTF8(Index: Integer): string; +function GetEnvironmentStringUTF8(Index: Integer): string; inline; begin {$IFDEF FPC_RTL_UNICODE} Result:=UTF16ToUTF8(SysUtils.GetEnvironmentString(Index)); {$ELSE} - {$IFDEF Windows} + {$IFDEF MSWindows} //not for WinCE, issue #0031788 Result:=UTF16ToUTF8(GetEnvironmentStringWide(Index)); {$ELSE} // by default the environment is in console encoding @@ -394,7 +401,7 @@ function SysErrorMessageUTF8(ErrorCode: Integer): String; Result := SysToUTF8(SysUtils.SysErrorMessage(ErrorCode)); end; -function UTF8CharacterLengthFull(p: PChar): integer; +function UTF8CodepointSizeFull(p: PChar): integer; begin case p^ of #0..#191: // %11000000 @@ -432,27 +439,34 @@ function UTF8CharacterLengthFull(p: PChar): integer; end; end; -function UTF8CharacterLength(p: PChar): integer; inline; +function UTF8CodepointSize(p: PChar): integer; inline; begin if p=nil then exit(0); if p^<#192 then exit(1); - Result:=UTF8CharacterLengthFull(p); + Result:=UTF8CodepointSizeFull(p); +end; + +function UTF8CharacterLength(p: PChar): integer; +begin + Result := UTF8CodepointSize(p); end; -function UTF8CharacterLengthFast(p: PChar): integer; +function UTF8CodepointSizeFast(p: PChar): integer; begin case p^ of #0..#191 : Result := 1; #192..#223 : Result := 2; #224..#239 : Result := 3; #240..#247 : Result := 4; - #248..#255 : Result := 1; + //#248..#255 : Result := 1; // Theoretically UTF-8 supports length 1-7, but since 2003, RFC 3629 limits // it to 1-4 bytes. // This is an inline function, so keep the function short. //#248..#251 : Result := 5; //#252, #253 : Result := 6; //#254 : Result := 7; + + else Result := 1; // An optimization + prevents compiler warning about uninitialized Result. end; end; @@ -468,7 +482,7 @@ function UTF8Length(p: PChar; ByteCount: PtrInt): PtrInt; Result:=0; while (ByteCount>0) do begin inc(Result); - CharLen:=UTF8CharacterLength(p); + CharLen:=UTF8CodepointSize(p); inc(p,CharLen); dec(ByteCount,CharLen); end; @@ -482,58 +496,59 @@ function UTF8LengthFast(const s: string): PtrInt; // Ported from: // http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html // The code uses CPU's native data size. In a 64-bit CPU it means 8 bytes at once. +// The UTF-8 data is assumed to be valid. function UTF8LengthFast(p: PChar; ByteCount: PtrInt): PtrInt; const - {$IfDef CPU64} - ONEMASK=$0101010101010101; - {$Else} - ONEMASK=$01010101; - {$EndIf} +{$ifdef CPU32} + ONEMASK =$01010101; + EIGHTYMASK=$80808080; +{$endif} +{$ifdef CPU64} + ONEMASK =$0101010101010101; + EIGHTYMASK=$8080808080808080; +{$endif} var - b: Byte; - pu: PPtrUInt; - pb: PByte absolute pu; - ui: PtrUInt absolute pu; - u: PtrUInt; - i: Integer; + pnx: PPtrInt absolute p; // To get contents of text in PtrInt blocks. x refers to 32 or 64 bits + pn8: pint8 absolute pnx; // To read text as Int8 in the initial and final loops + ix: PtrInt absolute pnx; // To read text as PtrInt in the block loop + nx: PtrInt; // values processed in block loop + i,cnt,e: PtrInt; begin - pu := PPtrUInt(p); Result := 0; + e := ix+ByteCount; // End marker // Handle any initial misaligned bytes. - for i := 1 to ui and (sizeof(u) - 1) do + cnt := (not (ix-1)) and (sizeof(PtrInt)-1); + if cnt>ByteCount then + cnt := ByteCount; + for i := 1 to cnt do begin - b := pb^; // Is this byte NOT the first byte of a character? - Result += (b shr 7) and ((not b) shr 6); - inc(pb); + Result += (pn8^ shr 7) and ((not pn8^) shr 6); + inc(pn8); end; - // Handle complete blocks. - for i := 1 to ByteCount div sizeof(u) do + // Handle complete blocks + for i := 1 to (ByteCount-cnt) div sizeof(PtrInt) do begin - u := pu^; - // Result bytes which are NOT the first byte of a character. - u := ((u and (ONEMASK * $80)) shr 7) and ((not u) shr 6); - {$PUSH}{$Q-} // "u * ONEMASK" causes an arithmetic overflow. - Result += (u * ONEMASK) >> ((sizeof(u) - 1) * 8); - {$POP} - inc(pu); + // Count bytes which are NOT the first byte of a character. + nx := ((pnx^ and EIGHTYMASK) shr 7) and ((not pnx^) shr 6); + {$push}{$overflowchecks off} // "nx * ONEMASK" causes an arithmetic overflow. + Result += (nx * ONEMASK) >> ((sizeof(PtrInt) - 1) * 8); + {$pop} + inc(pnx); end; // Take care of any left-over bytes. - for i := 1 to ({%H-}PtrUInt(p)+ByteCount) and (sizeof(u) - 1) do + while ix0 - If there is an encoding error the Result is 0 and CharLen=1. +function UTF8CodepointToUnicode(p: PChar; out CodepointLen: integer): Cardinal; +{ if p=nil then CodepointLen=0 otherwise CodepointLen>0 + If there is an encoding error the Result is 0 and CodepointLen=1. Use UTF8FixBroken to fix UTF-8 encoding. It does not check if the codepoint is defined in the Unicode tables. } @@ -542,12 +557,12 @@ function UTF8CharacterToUnicode(p: PChar; out CharLen: integer): Cardinal; if ord(p^)<%11000000 then begin // regular single byte character (#0 is a normal char, this is pascal ;) Result:=ord(p^); - CharLen:=1; + CodepointLen:=1; end else if ((ord(p^) and %11100000) = %11000000) then begin // starts with %110 => could be double byte character if (ord(p[1]) and %11000000) = %10000000 then begin - CharLen:=2; + CodepointLen:=2; Result:=((ord(p^) and %00011111) shl 6) or (ord(p[1]) and %00111111); if Result<(1 shl 7) then begin // wrong encoded, could be an XSS attack @@ -555,14 +570,14 @@ function UTF8CharacterToUnicode(p: PChar; out CharLen: integer): Cardinal; end; end else begin Result:=ord(p^); - CharLen:=1; + CodepointLen:=1; end; end else if ((ord(p^) and %11110000) = %11100000) then begin // starts with %1110 => could be triple byte character if ((ord(p[1]) and %11000000) = %10000000) and ((ord(p[2]) and %11000000) = %10000000) then begin - CharLen:=3; + CodepointLen:=3; Result:=((ord(p^) and %00011111) shl 12) or ((ord(p[1]) and %00111111) shl 6) or (ord(p[2]) and %00111111); @@ -572,7 +587,7 @@ function UTF8CharacterToUnicode(p: PChar; out CharLen: integer): Cardinal; end; end else begin Result:=ord(p^); - CharLen:=1; + CodepointLen:=1; end; end else if ((ord(p^) and %11111000) = %11110000) then begin @@ -580,7 +595,7 @@ function UTF8CharacterToUnicode(p: PChar; out CharLen: integer): Cardinal; if ((ord(p[1]) and %11000000) = %10000000) and ((ord(p[2]) and %11000000) = %10000000) and ((ord(p[3]) and %11000000) = %10000000) then begin - CharLen:=4; + CodepointLen:=4; Result:=((ord(p^) and %00001111) shl 18) or ((ord(p[1]) and %00111111) shl 12) or ((ord(p[2]) and %00111111) shl 6) @@ -591,20 +606,25 @@ function UTF8CharacterToUnicode(p: PChar; out CharLen: integer): Cardinal; end; end else begin Result:=ord(p^); - CharLen:=1; + CodepointLen:=1; end; end else begin // invalid character Result:=ord(p^); - CharLen:=1; + CodepointLen:=1; end; end else begin Result:=0; - CharLen:=0; + CodepointLen:=0; end; end; +function UTF8CharacterToUnicode(p: PChar; out CharLen: integer): Cardinal; +begin + Result := UTF8CodepointToUnicode(p, CharLen); +end; + function UnicodeToUTF8(CodePoint: cardinal; Buf: PChar): integer; procedure RaiseInvalidUnicode; @@ -618,7 +638,7 @@ function UnicodeToUTF8(CodePoint: cardinal; Buf: PChar): integer; RaiseInvalidUnicode; end; -function UnicodeToUTF8SkipErrors(CodePoint: cardinal; Buf: PChar): integer; +function UnicodeToUTF8SkipErrors(CodePoint: cardinal; Buf: PChar): integer; inline; begin Result:=UnicodeToUTF8Inline(CodePoint,Buf); end; @@ -694,7 +714,7 @@ function UTF8ToDoubleByte(UTF8Str: PChar; Len: PtrInt; DBStr: PByte): PtrInt; DestPos:=DBStr; Result:=0; while Len>0 do begin - u:=UTF8CharacterToUnicode(SrcPos,CharLen); + u:=UTF8CodepointToUnicode(SrcPos,CharLen); DestPos^:=byte((u shr 8) and $ff); inc(DestPos); DestPos^:=byte(u and $ff); @@ -716,36 +736,36 @@ function UTF8ToDoubleByte(UTF8Str: PChar; Len: PtrInt; DBStr: PByte): PtrInt; - Returns: True if the character pointed to by Curpos is part of a valid UTF8 codepoint (1 to 4 bytes), otherwise it returns False. } -function Utf8TryFindCodepointStart(AString: PChar; var CurPos: PChar; out CharLen: Integer): Boolean; +function Utf8TryFindCodepointStart(AString: PChar; var CurPos: PChar; out CodepointLen: Integer): Boolean; var SavedPos: PChar; begin Result := False; - CharLen := 0; + CodepointLen := 0; if (not (Assigned(AString) and Assigned(CurPos))) or (CurPos < AString) then Exit; SavedPos := CurPos; - //Note: UTF8CharacterStrictLength will NOT "look" beyond the terminating #0 of a PChar, so this is safe with AnsiStrings - CharLen := UTF8CharacterStrictLength(CurPos); - if (CharLen > 0) then Exit(True); + //Note: UTF8CodepointStrictSize will NOT "look" beyond the terminating #0 of a PChar, so this is safe with AnsiStrings + CodepointLen := UTF8CodepointStrictSize(CurPos); + if (CodepointLen > 0) then Exit(True); if (CurPos > AString) then begin Dec(CurPos); //-1 //is it second byte of 2..4 byte codepoint? - CharLen := UTF8CharacterStrictLength(CurPos); - if (CharLen > 1) then Exit(True); + CodepointLen := UTF8CodepointStrictSize(CurPos); + if (CodepointLen > 1) then Exit(True); if (CurPos > AString) then begin Dec(CurPos); //-2 //is it third byte of 3..4 byte codepoint? - CharLen := UTF8CharacterStrictLength(CurPos); - if (CharLen > 2) then Exit(True); + CodepointLen := UTF8CodepointStrictSize(CurPos); + if (CodepointLen > 2) then Exit(True); if (CurPos > AString) then begin Dec(CurPos); //-3 //is it fouth byte of 4 byte codepoint? - CharLen := UTF8CharacterStrictLength(CurPos); - if (CharLen = 4) then Exit(True); + CodepointLen := UTF8CodepointStrictSize(CurPos); + if (CodepointLen = 4) then Exit(True); end; end; end; @@ -781,35 +801,45 @@ function UTF8FindNearestCharStart(UTF8Str: PChar; Len: SizeInt; BytePos: SizeInt { Len is the length in bytes of UTF8Str - CharIndex is the position of the desired char (starting at 0), in chars + CodepointIndex is the position of the desired codepoint (starting at 0), in chars } -function UTF8CharStart(UTF8Str: PChar; Len, CharIndex: PtrInt): PChar; +function UTF8CodepointStart(UTF8Str: PChar; Len, CodepointIndex: PtrInt): PChar; var CharLen: LongInt; begin Result:=UTF8Str; if Result<>nil then begin - while (CharIndex>0) and (Len>0) do begin - CharLen:=UTF8CharacterLength(Result); + while (CodepointIndex>0) and (Len>0) do begin + CharLen:=UTF8CodepointSize(Result); dec(Len,CharLen); - dec(CharIndex); + dec(CodepointIndex); inc(Result,CharLen); end; - if (CharIndex<>0) or (Len<0) then + if (CodepointIndex<>0) or (Len<0) then Result:=nil; end; end; -function UTF8CharToByteIndex(UTF8Str: PChar; Len, CharIndex: PtrInt): PtrInt; +function UTF8CharStart(UTF8Str: PChar; Len, CharIndex: PtrInt): PChar; +begin + Result := UTF8CodepointStart(UTF8Str, Len, CharIndex); +end; + +function UTF8CodepointToByteIndex(UTF8Str: PChar; Len, CodepointIndex: PtrInt): PtrInt; var p: PChar; begin - p := UTF8CharStart(UTF8Str, Len, CharIndex); + p := UTF8CodepointStart(UTF8Str, Len, CodepointIndex); if p = nil then Result := -1 else Result := p - UTF8Str; end; +function UTF8CharToByteIndex(UTF8Str: PChar; Len, CharIndex: PtrInt): PtrInt; +begin + Result := UTF8CodepointToByteIndex(UTF8Str, Len, CharIndex); +end; + { fix any broken UTF8 sequences with spaces } procedure UTF8FixBroken(P: PChar); var @@ -879,30 +909,33 @@ procedure UTF8FixBroken(P: PChar); procedure UTF8FixBroken(var S: string); begin if S='' then exit; - if FindInvalidUTF8Character(PChar(S),length(S))<0 then exit; + if FindInvalidUTF8Codepoint(PChar(S),length(S))<0 then exit; UniqueString(S); UTF8FixBroken(PChar(S)); end; -function UTF8CharacterStrictLength(P: PChar): integer; +function UTF8CodepointStrictSize(P: PChar): integer; +var + c: Char; begin if p=nil then exit(0); - if ord(p^)<%10000000 then begin + c:=p^; + if ord(c)<%10000000 then begin // regular single byte character exit(1); end - else if ord(p^)<%11000000 then begin + else if ord(c)<%11000000 then begin // invalid single byte character exit(0); end - else if ((ord(p^) and %11100000) = %11000000) then begin + else if ((ord(c) and %11100000) = %11000000) then begin // should be 2 byte character if (ord(p[1]) and %11000000) = %10000000 then exit(2) else exit(0); end - else if ((ord(p^) and %11110000) = %11100000) then begin + else if ((ord(c) and %11110000) = %11100000) then begin // should be 3 byte character if ((ord(p[1]) and %11000000) = %10000000) and ((ord(p[2]) and %11000000) = %10000000) then @@ -910,7 +943,7 @@ function UTF8CharacterStrictLength(P: PChar): integer; else exit(0); end - else if ((ord(p^) and %11111000) = %11110000) then begin + else if ((ord(c) and %11111000) = %11110000) then begin // should be 4 byte character if ((ord(p[1]) and %11000000) = %10000000) and ((ord(p[2]) and %11000000) = %10000000) @@ -922,6 +955,11 @@ function UTF8CharacterStrictLength(P: PChar): integer; exit(0); end; +function UTF8CharacterStrictLength(P: PChar): integer; +begin + Result := UTF8CodepointStrictSize(P); +end; + function UTF8CStringToUTF8String(SourceStart: PChar; SourceLen: PtrInt) : string; var Source: PChar; @@ -1002,7 +1040,7 @@ function UTF8Pos(const SearchForText, SearchInText: string; else if StartPos>1 then begin // skip - StartPosP:=UTF8CharStart(PChar(SearchInText),Length(SearchInText),StartPos-1); + StartPosP:=UTF8CodepointStart(PChar(SearchInText),Length(SearchInText),StartPos-1); if StartPosP=nil then exit; // search p:=UTF8PosP(PChar(SearchForText),length(SearchForText), @@ -1043,12 +1081,12 @@ function UTF8Copy(const s: string; StartCharIndex, CharCount: PtrInt): string; EndBytePos: PChar; MaxBytes: PtrInt; begin - StartBytePos:=UTF8CharStart(PChar(s),length(s),StartCharIndex-1); + StartBytePos:=UTF8CodepointStart(PChar(s),length(s),StartCharIndex-1); if StartBytePos=nil then Result:='' else begin MaxBytes:=PtrInt(PChar(s)+length(s)-StartBytePos); - EndBytePos:=UTF8CharStart(StartBytePos,MaxBytes,CharCount); + EndBytePos:=UTF8CodepointStart(StartBytePos,MaxBytes,CharCount); if EndBytePos=nil then Result:=copy(s,StartBytePos-PChar(s)+1,MaxBytes) else @@ -1056,7 +1094,6 @@ function UTF8Copy(const s: string; StartCharIndex, CharCount: PtrInt): string; end; end; -{$IFnDEF NO_CP_RTL} procedure UTF8Delete(var s: Utf8String; StartCharIndex, CharCount: PtrInt); var tmp: String; @@ -1074,7 +1111,6 @@ procedure UTF8Delete(var s: Utf8String; StartCharIndex, CharCount: PtrInt); tmp := ''; SetCodePage(RawByteString(s), CP_UTF8, False); end; -{$ENDIF NO_ACP_RTL} procedure UTF8Delete(var s: String; StartCharIndex, CharCount: PtrInt); var @@ -1082,11 +1118,11 @@ procedure UTF8Delete(var s: String; StartCharIndex, CharCount: PtrInt); EndBytePos: PChar; MaxBytes: PtrInt; begin - StartBytePos:=UTF8CharStart(PChar(s),length(s),StartCharIndex-1); + StartBytePos:=UTF8CodepointStart(PChar(s),length(s),StartCharIndex-1); if StartBytePos <> nil then begin MaxBytes:=PtrInt(PChar(s)+length(s)-StartBytePos); - EndBytePos:=UTF8CharStart(StartBytePos,MaxBytes,CharCount); + EndBytePos:=UTF8CodepointStart(StartBytePos,MaxBytes,CharCount); if EndBytePos=nil then Delete(s,StartBytePos-PChar(s)+1,MaxBytes) else @@ -1094,30 +1130,36 @@ procedure UTF8Delete(var s: String; StartCharIndex, CharCount: PtrInt); end; end; -{$IFnDEF NO_CP_RTL} {It's simper to copy the code from the variant with String parameters than writing a wrapper} procedure UTF8Insert(const source: UTF8String; var s: UTF8string; StartCharIndex: PtrInt); var StartBytePos: PChar; begin - StartBytePos:=UTF8CharStart(PChar(s),length(s),StartCharIndex-1); + StartBytePos:=UTF8CodepointStart(PChar(s),length(s),StartCharIndex-1); if StartBytePos <> nil then Insert(source, s, StartBytePos-PChar(s)+1); end; -{$ENDIF NO_CP_RTL} procedure UTF8Insert(const source: String; var s: String; StartCharIndex: PtrInt); var StartBytePos: PChar; begin - StartBytePos:=UTF8CharStart(PChar(s),length(s),StartCharIndex-1); + StartBytePos:=UTF8CodepointStart(PChar(s),length(s),StartCharIndex-1); if StartBytePos <> nil then Insert(source, s, StartBytePos-PChar(s)+1); end; function UTF8StringReplace(const S, OldPattern, NewPattern: String; - Flags: TReplaceFlags; ALanguage: string): String; + Flags: TReplaceFlags; ALanguage: string): String; inline; +var + DummyCount: Integer; +begin + Result := Utf8StringReplace(S, OldPattern, NewPattern, Flags, DummyCount, ALanguage); +end; + +function UTF8StringReplace(const S, OldPattern, NewPattern: String; + Flags: TReplaceFlags; out Count: Integer; ALanguage: string=''): String; // same algorithm as StringReplace, but using UTF8LowerCase // for case insensitive search var @@ -1126,6 +1168,7 @@ function UTF8StringReplace(const S, OldPattern, NewPattern: String; begin Srch := S; OldP := OldPattern; + Count := 0; if rfIgnoreCase in Flags then begin Srch := UTF8LowerCase(Srch,ALanguage); @@ -1143,6 +1186,7 @@ function UTF8StringReplace(const S, OldPattern, NewPattern: String; end else begin + Inc(Count); Result := Result + Copy(RemS,1,P-1) + NewPattern; P := P + Length(OldP); RemS := Copy(RemS, P, Length(RemS)-P+1); @@ -1189,6 +1233,34 @@ function UTF8SwapCase(const AInStr: string; ALanguage: string=''): string; Result[I] := xLowerCase[I]; end; +function UTF8ProperCase(const AInStr: string; const WordDelims: TSysCharSet): string; +var + P, PE : PChar; + CharLen: Integer; + Capital: string; +begin + Result := UTF8LowerCase(AInStr); + UniqueString(Result); + P := PChar(Result); + PE := P+Length(Result); + while (P $24DA + else if (c2 = #$93) and (c3 in [#$80..#$8F]) then new_c3 := chr(ord(c3) + $1A) { $2C00..$2C2E Result:=u+48; E2 B0 80..E2 B0 AE @@ -2335,7 +2407,7 @@ function UTF8LowerCase(const AInStr: string; ALanguage: string=''): string; SetLength(Result,OutStr - PChar(Result)); end; -function UTF8LowerString(const s: string): string; +function UTF8LowerString(const s: string): string; inline; begin Result:=UTF8LowerCase(s); end; @@ -2418,7 +2490,7 @@ function UTF8UpperCase(const AInStr: string; ALanguage: string=''): string; { Now everything else } else begin - CharLen := UTF8CharacterLength(@AInStr[InCounter]); + CharLen := UTF8CodepointSize(@AInStr[InCounter]); CharProcessed := False; NewCharLen := CharLen; @@ -2723,14 +2795,13 @@ function UTF8UpperCase(const AInStr: string; ALanguage: string=''): string; SetLength(Result,OutCounter); end; -function UTF8UpperString(const s: string): string; +function UTF8UpperString(const s: string): string; inline; begin Result:=UTF8UpperCase(s); end; -function FindInvalidUTF8Character(p: PChar; Count: PtrInt; - StopOnNonUTF8: Boolean): PtrInt; +function FindInvalidUTF8Codepoint(p: PChar; Count: PtrInt; StopOnNonUTF8: Boolean): PtrInt; // return -1 if ok var CharLen: Integer; @@ -2797,9 +2868,9 @@ function FindInvalidUTF8Character(p: PChar; Count: PtrInt; Result:=-1; end; -function ValidUTF8String(const s: String): String; inline; +function FindInvalidUTF8Character(p: PChar; Count: PtrInt; StopOnNonUTF8: Boolean = true): PtrInt; begin - Result := Utf8EscapeControlChars(s, emPascal); + Result := FindInvalidUTF8Codepoint(p, Count, StopOnNonUTF8); end; { @@ -2814,15 +2885,15 @@ function Utf8EscapeControlChars(S: String; EscapeMode: TEscapeMode = emPascal): const //lookuptables are about 1.8 to 1.3 times faster than a function using IntToStr or IntToHex PascalEscapeStrings: Array[#0..#31] of string = ( - '#0' , '#1' , '#2' , '#3' , '#4' , '#5' , '#6' , '#7' , - '#8' , '#9' , '#10', '#11', '#12', '#13', '#14', '#15', + '#00', '#01', '#02', '#03', '#04', '#05', '#06', '#07', + '#08', '#09', '#10', '#11', '#12', '#13', '#14', '#15', '#16', '#17', '#18', '#19', '#20', '#21', '#22', '#23', '#24', '#25', '#26', '#27', '#28', '#29', '#30', '#31'); CEscapeStrings: Array[#0..#31] of string = ( - '\0' , '\0x01', '\0x02', '\0x03', '\0x04', '\0x05', '\0x06', '\0x07', - '\0x08', '\t' , '\r' , '\0x0B', '\0x0C', '\n' , '\0x0E', '\0x0F', + '\0' , '\0x01', '\0x02', '\0x03', '\0x04', '\0x05', '\0x06', '\a' , + '\b' , '\t' , '\r' , '\v' , '\f' , '\n' , '\0x0E', '\0x0F', '\0x10', '\0x11', '\0x12', '\0x13', '\0x14', '\0x15', '\0x16', '\0x17', - '\0x18', '\0x19', '\0x1A', '\0x1B', '\0x1C', '\0x1D', '\0x1E', '\0x1F'); + '\0x18', '\0x19', '\0x1A', '\e' , '\0x1C', '\0x1D', '\0x1E', '\0x1F'); HexEscapeCStrings: Array[#0..#31] of string = ( '\0x00', '\0x01', '\0x02', '\0x03', '\0x04', '\0x05', '\0x06', '\0x07', '\0x08', '\0x09', '\0x0A', '\0x0B', '\0x0C', '\0x0D', '\0x0E', '\0x0F', @@ -2842,7 +2913,7 @@ function Utf8EscapeControlChars(S: String; EscapeMode: TEscapeMode = emPascal): Ch: Char; i: Integer; begin - if FindInvalidUTF8Character(PChar(S), Length(S)) <> -1 then + if FindInvalidUTF8Codepoint(PChar(S), Length(S)) <> -1 then begin UTF8FixBroken(S); end; @@ -2866,7 +2937,7 @@ function Utf8EscapeControlChars(S: String; EscapeMode: TEscapeMode = emPascal): end; end; -function Utf8StringOfChar(AUtf8Char: String; N: Integer): String; +function UTF8StringOfChar(AUtf8Char: String; N: Integer): String; var UCharLen, i: Integer; C1, C2, C3: Char; @@ -2912,7 +2983,7 @@ function Utf8StringOfChar(AUtf8Char: String; N: Integer): String; end; end; -function Utf8AddChar(AUtf8Char: String; const S: String; N: Integer): String; +function UTF8AddChar(AUtf8Char: String; const S: String; N: Integer): String; var L : Integer; begin @@ -2923,7 +2994,7 @@ function Utf8AddChar(AUtf8Char: String; const S: String; N: Integer): String; Result := Utf8StringOfChar(AUtf8Char, N-l) + Result; end; -function Utf8AddCharR(AUtf8Char: String; const S: String; N: Integer): String; +function UTF8AddCharR(AUtf8Char: String; const S: String; N: Integer): String; var L : Integer; begin @@ -2934,12 +3005,12 @@ function Utf8AddCharR(AUtf8Char: String; const S: String; N: Integer): String; Result := Result + Utf8StringOfChar(AUtf8Char, N-l); end; -function UTF8PadLeft(const S: String; const N: Integer; const AUtf8Char: String = #32): String; +function UTF8PadLeft(const S: String; const N: Integer; const AUtf8Char: String = #32): String; inline; begin Result := Utf8AddChar(AUtf8Char, S, N); end; -function UTF8PadRight(const S: String; const N: Integer; const AUtf8Char: String = #32): String; +function UTF8PadRight(const S: String; const N: Integer; const AUtf8Char: String = #32): String; inline; begin Result := Utf8AddCharR(AUtf8Char, S, N); end; @@ -2958,12 +3029,12 @@ function UTF8PadCenter(const S: String; const N: Integer; const AUtf8Char: Strin Result := S; end; -function Utf8LeftStr(const AText: String; const ACount: Integer): String; +function UTF8LeftStr(const AText: String; const ACount: Integer): String; inline; begin Result := Utf8Copy(AText,1,ACount); end; -function Utf8RightStr(const AText: String; const ACount: Integer): String; +function UTF8RightStr(const AText: String; const ACount: Integer): String; var j,l:integer; begin @@ -2999,7 +3070,7 @@ function UTF8QuotedStr(const S, Quote: string): string; Result+=copy(S,CopyPos-PChar(S)+1,p-CopyPos)+Quote; end; -function Utf8StartsText(const ASubText, AText: string): Boolean; +function UTF8StartsText(const ASubText, AText: string): Boolean; var TextLen, SubTextLen: PtrInt; begin @@ -3013,7 +3084,7 @@ function Utf8StartsText(const ASubText, AText: string): Boolean; end; end; -function Utf8EndsText(const ASubText, AText: string): Boolean; +function UTF8EndsText(const ASubText, AText: string): Boolean; var TextLen, SubTextLen: PtrInt; begin @@ -3027,7 +3098,7 @@ function Utf8EndsText(const ASubText, AText: string): Boolean; end; end; -function Utf8ReverseString(p: PChar; const ByteCount: LongInt): string; +function UTF8ReverseString(p: PChar; const ByteCount: LongInt): string; var CharLen, rBytePos: LongInt; begin @@ -3035,51 +3106,41 @@ function Utf8ReverseString(p: PChar; const ByteCount: LongInt): string; rBytePos := ByteCount + 1; while (rBytePos > 1) do begin - CharLen:=UTF8CharacterLength(p); + CharLen:=UTF8CodepointSize(p); Dec(rBytePos, CharLen); System.Move(p^, Result[rBytePos], CharLen); Inc(p, CharLen); end; end; -function Utf8ReverseString(const AText: string): string; inline; +function UTF8ReverseString(const AText: string): string; inline; begin Result := UTF8ReverseString(PChar(AText), length(AText)); end; -function Utf8RPos(const Substr, Source: string): integer; +function UTF8RPos(const Substr, Source: string): PtrInt; var - RevSubstr, RevSource: string; - pRev: integer; + pRev: PtrInt; begin - if (Pos(Substr, Source) = 0) then - Result := 0 - else - begin - RevSubstr := UTF8ReverseString(Substr); - RevSource := UTF8ReverseString(Source); - pRev := UTF8Pos(RevSubstr, RevSource); - Result := UTF8Length(Source) -pRev -UTF8Length(Substr) +2; - end; + pRev := RPos(Substr, Source); // Scan from the end. + Result := UTF8Length(PChar(Source), pRev); // Length of the leading part. end; -function UTF8WrapText(S, BreakStr :string; BreakChars :TSysCharSet; MaxCol: integer): string; +function UTF8WrapText(S, BreakStr: string; BreakChars: TSysCharSet; MaxCol: integer): string; var - P :PChar; - CharLen :integer; - RightSpace : Integer = 0; - N :integer = 0; - i : Integer; - j : Integer; - Len :integer = 0; - ResultLen, RP :Integer; + P : PChar; + RightSpace : integer = 0; + N : integer = 0; + Len : integer = 0; + i, j : integer; + CharLen, ResultLen, RP : integer; begin Result := ''; if (S = '') or (MaxCol = 0) or (BreakStr = '') or (BreakChars = []) then Exit; P := PChar(S); while P^ <> #0 do begin - CharLen := UTF8CharacterLength(P); + CharLen := UTF8CodepointSize(P); i := 1; j := 0; ResultLen := Length(Result); @@ -3112,7 +3173,7 @@ function UTF8WrapText(S, BreakStr :string; BreakChars :TSysCharSet; MaxCol: inte end; end; -function UTF8WrapText(S :string; MaxCol: integer): string; +function UTF8WrapText(S: string; MaxCol: integer): string; begin Result := UTF8WrapText(S, LineEnding, [' ', '-', #9], MaxCol); end; @@ -3154,7 +3215,7 @@ function UTF8Trim(const s: string; Flags: TUTF8TrimFlags): string; #128..#255: begin if KeepAllNonASCII then break; - u:=UTF8CharacterToUnicode(p,l); + u:=UTF8CodepointToUnicode(p,l); if (l<=1) then break; // invalid character case u of 128..159, // C1 set of control codes @@ -3202,7 +3263,7 @@ function UTF8Trim(const s: string; Flags: TUTF8TrimFlags): string; begin if KeepAllNonASCII then break; StartP:=UTF8FindNearestCharStart(PChar(Result),length(Result),p-PChar(Result)); - u:=UTF8CharacterToUnicode(PChar(Result)+StartP,l); + u:=UTF8CodepointToUnicode(PChar(Result)+StartP,l); if (l<=1) then break; // invalid character case u of 128..159, // C1 set of control codes @@ -3228,16 +3289,6 @@ function UTF8Trim(const s: string; Flags: TUTF8TrimFlags): string; end; end; -procedure AssignUTF8ListToAnsi(UTF8List, AnsiList: TStrings); -var - i: Integer; -begin - AnsiList.Clear; - if UTF8List=nil then exit; - for i:=0 to UTF8List.Count-1 do - AnsiList.Add(UTF8ToSys(UTF8List[i])); -end; - {------------------------------------------------------------------------------ Name: UTF8CompareStr Params: S1, S2 - UTF8 encoded strings @@ -3729,7 +3780,7 @@ function ConvertUTF16ToUTF8(Dest: PChar; DestCharCount: SizeUInt; Avoid copying the result string since on windows a widestring requires a full copy ------------------------------------------------------------------------------} -function UTF8ToUTF16(const S: AnsiString): UnicodeString; +function UTF8ToUTF16(const S: AnsiString): UnicodeString; inline; begin Result:=UTF8ToUTF16(PChar(S),length(S)); end; @@ -3755,7 +3806,7 @@ function UTF8ToUTF16(const P: PChar; ByteCnt: SizeUInt): UnicodeString; Converts the specified UTF-16 encoded string (system endian) to UTF-8 encoded ------------------------------------------------------------------------------} -function UTF16ToUTF8(const S: UnicodeString): AnsiString; +function UTF16ToUTF8(const S: UnicodeString): AnsiString; inline; begin Result := UTF16ToUTF8(PWideChar(S),length(S)); end; @@ -3851,6 +3902,7 @@ procedure LazGetShortLanguageID(var Lang: String); procedure ReplaceSubstring(var s: string; StartPos, Count: SizeInt; const Insertion: string); +// This was moved to LazStringUtils and a deprecated copy was left here. Will be removed. var MaxCount: SizeInt; InsertionLen: SizeInt; @@ -3915,3 +3967,4 @@ finalization FinalizeLazUTF8; end. + diff --git a/src/lib/Lazarus/lazutf8classes.pas b/src/lib/Lazarus/components/lazutils/lazutf8classes.pas similarity index 72% rename from src/lib/Lazarus/lazutf8classes.pas rename to src/lib/Lazarus/components/lazutils/lazutf8classes.pas index 91ff42b9..fabd074b 100644 --- a/src/lib/Lazarus/lazutf8classes.pas +++ b/src/lib/Lazarus/components/lazutils/lazutf8classes.pas @@ -19,14 +19,7 @@ interface { TFileStreamUTF8 } - TFileStreamUTF8 = class(TFileStream) - private - FFileName: string; - public - constructor Create(const AFileName: string; Mode: Word); - constructor Create(const AFileName: string; Mode: Word; Rights: Cardinal); - property FileName: string Read FFilename; - end; + TFileStreamUTF8 = TFileStream; { TStringListUTF8 } @@ -124,38 +117,6 @@ procedure TMemoryStreamUTF8.SaveToFile(const FileName: string); end; end; -constructor TFileStreamUTF8.Create(const AFileName: string; Mode: Word); -begin - Create(AFileName,Mode,438); - { Rights 438 is the default in the FCL TFileStream - Under Unix: - 438 = &666 = owner/group/others can read/write - Note: the real rights are "Rights and not umask" - Under Windows Rights is not used. - } -end; - -constructor TFileStreamUTF8.Create(const AFileName: string; Mode: Word; Rights: Cardinal); -var - lHandle: THandle; -begin - FFileName:=AFileName; - if (Mode and fmCreate) > 0 then - lHandle:=FileCreateUTF8(AFileName,Mode,Rights) - else - lHandle:=FileOpenUTF8(AFileName,Mode); - - if (THandle(lHandle)=feInvalidHandle) then - begin - if Mode=fmcreate then - raise EFCreateError.createfmt({SFCreateError}'Unable to create file "%s"',[AFileName]) - else - raise EFOpenError.Createfmt({SFOpenError}'Unable to open file "%s"',[AFilename]); - end - else - THandleStream(Self).Create(lHandle); -end; - function TStringListUTF8.DoCompareText(const s1, s2: string): PtrInt; begin if CaseSensitive then @@ -189,3 +150,4 @@ procedure TStringListUTF8.SaveToFile(const FileName: string); end; end. + diff --git a/src/lib/Lazarus/components/lazutils/lazutils_defines.inc b/src/lib/Lazarus/components/lazutils/lazutils_defines.inc new file mode 100644 index 00000000..ddf91420 --- /dev/null +++ b/src/lib/Lazarus/components/lazutils/lazutils_defines.inc @@ -0,0 +1,13 @@ +// Add defines here. This file should be included in all LazUtils units headers + + +{$undef UTF8_RTL} // FPC >= 2.7.1 with codepages and default string = CP_UTF8 +{$undef ACP_RTL} // FPC >= 2.7.1 with codepages and default string = CP_ACP + + +{$ifndef DisableUTF8RTL} + {$define UTF8_RTL} +{$else DisableUTF8RTL} + {$define ACP_RTL} +{$endif DisableUTF8RTL} + diff --git a/src/lib/Lazarus/lazutilsstrconsts.pas b/src/lib/Lazarus/components/lazutils/lazutilsstrconsts.pas similarity index 96% rename from src/lib/Lazarus/lazutilsstrconsts.pas rename to src/lib/Lazarus/components/lazutils/lazutilsstrconsts.pas index 8162a1a9..703c7df2 100644 --- a/src/lib/Lazarus/lazutilsstrconsts.pas +++ b/src/lib/Lazarus/components/lazutils/lazutilsstrconsts.pas @@ -39,6 +39,8 @@ interface lrsCanNotExecute = 'can not execute %s'; lrsListMustBeEmpty = 'List must be empty'; lrsListIndexExceedsBounds = 'List index exceeds bounds (%d)'; + lrsERRORInCode = 'ERROR in code: '; + lrsCreatingGdbCatchableError = 'Creating gdb catchable error:'; // XPath lrsNodeSet = 'node set'; @@ -65,3 +67,4 @@ interface implementation end. + diff --git a/src/lib/Lazarus/masks.pas b/src/lib/Lazarus/components/lazutils/masks.pas similarity index 72% rename from src/lib/Lazarus/masks.pas rename to src/lib/Lazarus/components/lazutils/masks.pas index 5426b56d..918be5a7 100644 --- a/src/lib/Lazarus/masks.pas +++ b/src/lib/Lazarus/components/lazutils/masks.pas @@ -13,11 +13,12 @@ interface uses - // For Smart Linking: Do not use the LCL! Classes, SysUtils, Contnrs, LazUtilsStrConsts, LazUtf8; type TMaskCharType = (mcChar, mcCharSet, mcAnyChar, mcAnyText); + TMaskOption = (moCaseSensitive, moDisableSets); + TMaskOptions = set of TMaskOption; TCharSet = set of Char; PCharSet = ^TCharSet; @@ -42,12 +43,13 @@ TMaskString = record TMask = class private FMask: TMaskString; - fCaseSensitive: Boolean; fInitialMask: String; - procedure InitMaskString(const AValue: String; const CaseSensitive: Boolean); + fOptions: TMaskOptions; + procedure InitMaskString(const AValue: String); procedure ClearMaskString; public - constructor Create(const AValue: String; const CaseSensitive: Boolean = False); + constructor Create(const AValue: String; const CaseSensitive: Boolean); deprecated 'use overload with Options parameter'; + constructor Create(const AValue: String; const AOptions: TMaskOptions = []); destructor Destroy; override; function Matches(const AFileName: String): Boolean; @@ -69,7 +71,8 @@ TMaskList = class function GetCount: Integer; function GetItem(Index: Integer): TMask; public - constructor Create(const AValue: String; ASeparator: Char = ';'; const CaseSensitive: Boolean = False); + constructor Create(const AValue: String; ASeparator: Char; const CaseSensitive: Boolean); deprecated 'use overload with Options parameter'; + constructor Create(const AValue: String; ASeparator: Char = ';'; const AOptions: TMaskOptions = []); destructor Destroy; override; function Matches(const AFileName: String): Boolean; @@ -79,10 +82,19 @@ TMaskList = class property Items[Index: Integer]: TMask read GetItem; end; -function MatchesMask(const FileName, Mask: String; const CaseSensitive: Boolean = False): Boolean; -function MatchesWindowsMask(const FileName, Mask: String; const CaseSensitive: Boolean = False): Boolean; -function MatchesMaskList(const FileName, Mask: String; Separator: Char = ';'; const CaseSensitive: Boolean = False): Boolean; -function MatchesWindowsMaskList(const FileName, Mask: String; Separator: Char = ';'; const CaseSensitive: Boolean = False): Boolean; +function MatchesMask(const FileName, Mask: String; const CaseSensitive: Boolean): Boolean; deprecated 'use overload with Options parameter'; +function MatchesMask(const FileName, Mask: String; const Options: TMaskOptions = []): Boolean; +function MatchesWindowsMask(const FileName, Mask: String; const CaseSensitive: Boolean): Boolean; deprecated 'use overload with Options parameter'; +function MatchesWindowsMask(const FileName, Mask: String; const Options: TMaskOptions = []): Boolean; + +function MatchesMaskList(const FileName, Mask: String): Boolean; +function MatchesMaskList(const FileName, Mask: String; Separator: Char): Boolean; +function MatchesMaskList(const FileName, Mask: String; Separator: Char; const CaseSensitive: Boolean): Boolean; deprecated 'use overload with Options parameter'; +function MatchesMaskList(const FileName, Mask: String; Separator: Char; const Options: TMaskOptions): Boolean; +function MatchesWindowsMaskList(const FileName, Mask: String): Boolean; +function MatchesWindowsMaskList(const FileName, Mask: String; Separator: Char): Boolean; +function MatchesWindowsMaskList(const FileName, Mask: String; Separator: Char; const CaseSensitive: Boolean): Boolean; deprecated 'use overload with Options parameter'; +function MatchesWindowsMaskList(const FileName, Mask: String; Separator: Char; const Options: TMaskOptions): Boolean; implementation @@ -96,9 +108,9 @@ function GetCodePoint(const S: String; const Index: PtrInt): TUTF8Char; Res: AnsiString; //intermediate needed for PChar -> String -> ShortString assignement begin Result := ''; - p := UTF8CharStart(PChar(S), Length(S), Index - 1); //zero-based call + p := UTF8CodepointStart(PChar(S), Length(S), Index - 1); //zero-based call //determine the length in bytes of this UTF-8 character - PLen := UTF8CharacterLength(p); + PLen := UTF8CodepointSize(p); Res := p; //Set correct length for Result (otherwise it returns all chars up to the end of the original string) SetLength(Res,PLen); @@ -107,10 +119,18 @@ function GetCodePoint(const S: String; const Index: PtrInt): TUTF8Char; function MatchesMask(const FileName, Mask: String; const CaseSensitive: Boolean): Boolean; +begin + if CaseSensitive then + Result := MatchesMask(FileName, Mask, [moCaseSensitive]) + else + Result := MatchesMask(FileName, Mask, []) +end; + +function MatchesMask(const FileName, Mask: String; const Options: TMaskOptions): Boolean; var AMask: TMask; begin - AMask := TMask.Create(Mask, CaseSensitive); + AMask := TMask.Create(Mask, Options); try Result := AMask.Matches(FileName); finally @@ -118,11 +138,11 @@ function MatchesMask(const FileName, Mask: String; const CaseSensitive: Boolean) end; end; -function MatchesWindowsMask(const FileName, Mask: String; const CaseSensitive: Boolean): Boolean; +function MatchesWindowsMask(const FileName, Mask: String; const Options: TMaskOptions): Boolean; var AMask: TMask; begin - AMask := TMask.Create(Mask, CaseSensitive); + AMask := TMask.Create(Mask, Options); try Result := AMask.MatchesWindowsMask(FileName); finally @@ -130,11 +150,37 @@ function MatchesWindowsMask(const FileName, Mask: String; const CaseSensitive: B end; end; +function MatchesWindowsMask(const FileName, Mask: String; const CaseSensitive: Boolean): Boolean; +begin + if CaseSensitive then + Result := MatchesWindowsMask(FileName, Mask, [moCaseSensitive]) + else + Result := MatchesWindowsMask(FileName, Mask, []) +end; + +function MatchesMaskList(const FileName, Mask: String): Boolean; +begin + Result := MatchesMaskList(FileName, Mask, ';', []); +end; + +function MatchesMaskList(const FileName, Mask: String; Separator: Char): Boolean; +begin + Result := MatchesMaskList(FileName, Mask, Separator, []); +end; + function MatchesMaskList(const FileName, Mask: String; Separator: Char; const CaseSensitive: Boolean): Boolean; +begin + if CaseSensitive then + Result := MatchesMaskList(FileName, Mask, Separator, [moCaseSensitive]) + else + Result := MatchesMaskList(FileName, Mask, Separator, []); +end; + +function MatchesMaskList(const FileName, Mask: String; Separator: Char; const Options: TMaskOptions): Boolean; var AMaskList: TMaskList; begin - AMaskList := TMaskList.Create(Mask, Separator, CaseSensitive); + AMaskList := TMaskList.Create(Mask, Separator, Options); try Result := AMaskList.Matches(FileName); finally @@ -142,11 +188,30 @@ function MatchesMaskList(const FileName, Mask: String; Separator: Char; const Ca end; end; + +function MatchesWindowsMaskList(const FileName, Mask: String): Boolean; +begin + Result := MatchesWindowsMaskList(FileName, Mask, ';', []); +end; + +function MatchesWindowsMaskList(const FileName, Mask: String; Separator: Char): Boolean; +begin + Result := MatchesWindowsMaskList(FileName, Mask, Separator, []); +end; + function MatchesWindowsMaskList(const FileName, Mask: String; Separator: Char; const CaseSensitive: Boolean): Boolean; +begin + if CaseSensitive then + Result := MatchesWindowsMaskList(FileName, Mask, Separator, [moCaseSensitive]) + else + Result := MatchesWindowsMaskList(FileName, Mask, Separator, []); +end; + +function MatchesWindowsMaskList(const FileName, Mask: String; Separator: Char; const Options: TMaskOptions): Boolean; var AMaskList: TMaskList; begin - AMaskList := TMaskList.Create(Mask, Separator, CaseSensitive); + AMaskList := TMaskList.Create(Mask, Separator, Options); try Result := AMaskList.MatchesWindowsMask(FileName); finally @@ -154,9 +219,10 @@ function MatchesWindowsMaskList(const FileName, Mask: String; Separator: Char; c end; end; + { TMask } -procedure TMask.InitMaskString(const AValue: String; const CaseSensitive: Boolean); +procedure TMask.InitMaskString(const AValue: String); var I: Integer; SkipAnyText: Boolean; @@ -231,7 +297,7 @@ procedure TMask.InitMaskString(const AValue: String; const CaseSensitive: Boolea if (I > Utf8Length(AValue)) then CharSetError; CP := GetCodePoint(AValue, I); if (Length(CP) <> 1) then CharSetError; - if fCaseSensitive then + if (moCaseSensitive in fOptions) then begin //writeln('MaskUtf8: Set: ' + Last + '-' + (CP[1])); for C := Last to CP[1] do @@ -240,7 +306,7 @@ procedure TMask.InitMaskString(const AValue: String; const CaseSensitive: Boolea else begin //writeln('MaskUtf8: Set: ' + Last + '-' + UpCase(CP[1])); - for C := Last to UpCase(CP[1]) do + for C := Last to LowerCase(CP[1]) do Include(CharSet, C) end; Inc(I); @@ -252,10 +318,10 @@ procedure TMask.InitMaskString(const AValue: String; const CaseSensitive: Boolea end; else begin - if fCaseSensitive then + if (moCaseSensitive in fOptions) then Last := CP[1] else - Last := UpCase(CP[1]); + Last := LowerCase(CP[1]); Include(CharSet, Last); Inc(I); end; @@ -280,7 +346,7 @@ procedure TMask.InitMaskString(const AValue: String; const CaseSensitive: Boolea with FMask.Chars[High(FMask.Chars)] do begin CharType := mcChar; - if fCaseSensitive then + if (moCaseSensitive in fOptions) then CharValue := GetCodePoint(AValue,I) else CharValue := Utf8LowerCase(GetCodePoint(AValue,I)); @@ -293,7 +359,6 @@ procedure TMask.InitMaskString(const AValue: String; const CaseSensitive: Boolea end; begin - fCaseSensitive:=CaseSensitive; SetLength(FMask.Chars, 0); FMask.MinLength := 0; FMask.MaxLength := 0; @@ -305,7 +370,12 @@ procedure TMask.InitMaskString(const AValue: String; const CaseSensitive: Boolea case GetCodePoint(AValue,I) of '*': AddAnyText; '?': AddAnyChar; - '[': AddCharSet; + '[': begin + if not (moDisableSets in FOptions) then + AddCharSet + else + AddChar; + end else AddChar; end; end; @@ -320,12 +390,20 @@ procedure TMask.ClearMaskString; Dispose(FMask.Chars[I].SetValue); end; +constructor TMask.Create(const AValue: String; const AOptions: TMaskOptions); +begin + fInitialMask := AValue; + fOptions := AOptions; + InitMaskString(AValue); +end; + constructor TMask.Create(const AValue: String; const CaseSensitive: Boolean); begin - fInitialMask := AValue; - fCaseSensitive := CaseSensitive; - InitMaskString(AValue, CaseSensitive); + if CaseSensitive then + Create(AValue, [moCaseSensitive]) + else + Create(AValue, []); end; destructor TMask.Destroy; @@ -404,7 +482,8 @@ function TMask.Matches(const AFileName: String): Boolean; end; if (L < FMask.MinLength) or (L > FMask.MaxLength) then Exit; - if fCaseSensitive then + if (moCaseSensitive in fOptions) then + //if fCaseSensitive then S := AFileName else begin @@ -430,11 +509,11 @@ function TMask.MatchesWindowsMask(const AFileName: String): Boolean; begin NewMaskValue := Utf8Copy(fInitialMask,1,Utf8Length(fInitialMask)-2); ClearMaskString; - InitMaskString(NewMaskValue, fCaseSensitive); + InitMaskString(NewMaskValue); Result := Matches(AFileName); //Restore initial state of FMask ClearMaskString; - InitMaskString(fInitialMask, fCaseSensitive); + InitMaskString(fInitialMask); end //else if (Length(fInitialMask) > 1) and (RightStr(fInitialMask,2) = '*.') then else if (Utf8Length(fInitialMask) > 1) and (GetCodePoint(fInitialMask,Utf8Length(fInitialMask)) = '.') then @@ -448,11 +527,11 @@ function TMask.MatchesWindowsMask(const AFileName: String): Boolean; begin NewMaskValue := Utf8Copy(fInitialMask,1,Utf8Length(fInitialMask)-1); ClearMaskString; - InitMaskString(NewMaskValue, fCaseSensitive); + InitMaskString(NewMaskValue); Result := Matches(AFileName); //Restore initial state of FMask ClearMaskString; - InitMaskString(fInitialMask, fCaseSensitive); + InitMaskString(fInitialMask); end else begin @@ -463,7 +542,8 @@ function TMask.MatchesWindowsMask(const AFileName: String): Boolean; //foo.* (but not '.*') begin //First see if we have 'foo' - if fCaseSensitive then + if (moCaseSensitive in fOptions) then + //if fCaseSensitive then Result := (AFileName = Utf8Copy(fInitialMask,1,Utf8Length(fInitialMask)-2)) else Result := (Utf8CompareText(AFileName,Utf8Copy(fInitialMask,1,Utf8Length(fInitialMask)-2)) = 0); @@ -504,27 +584,35 @@ function TMaskList.GetItem(Index: Integer): TMask; Result := TMask(FMasks.Items[Index]); end; + function TMaskList.GetCount: Integer; begin Result := FMasks.Count; end; -constructor TMaskList.Create(const AValue: String; ASeparator: Char; const CaseSensitive: Boolean); +constructor TMaskList.Create(const AValue: String; ASeparator: Char; const AOptions: TMaskOptions); var S: TParseStringList; I: Integer; begin FMasks := TObjectList.Create(True); - S := TParseStringList.Create(AValue, ASeparator); try for I := 0 to S.Count - 1 do - FMasks.Add(TMask.Create(S[I], CaseSensitive)); + FMasks.Add(TMask.Create(S[I], AOptions)); finally S.Free; end; end; +constructor TMaskList.Create(const AValue: String; ASeparator: Char; const CaseSensitive: Boolean); +begin + if CaseSensitive then + Create(AValue, ASeparator, [moCaseSensitive]) + else + Create(AValue, ASeparator, []); +end; + destructor TMaskList.Destroy; begin FMasks.Free; @@ -565,3 +653,4 @@ function TMaskList.MatchesWindowsMask(const AFileName: String): Boolean; end; end. + diff --git a/src/lib/Lazarus/unixfileutil.inc b/src/lib/Lazarus/components/lazutils/unixfileutil.inc similarity index 99% rename from src/lib/Lazarus/unixfileutil.inc rename to src/lib/Lazarus/components/lazutils/unixfileutil.inc index 197b0133..27dbfcf6 100644 --- a/src/lib/Lazarus/unixfileutil.inc +++ b/src/lib/Lazarus/components/lazutils/unixfileutil.inc @@ -5,3 +5,4 @@ function ExtractShortPathNameUTF8(const FileName: String): String; begin Result:=SysToUTF8(SysUtils.ExtractShortPathName(UTF8ToSys(FileName))); end; + diff --git a/src/lib/Lazarus/unixlazfileutils.inc b/src/lib/Lazarus/components/lazutils/unixlazfileutils.inc similarity index 100% rename from src/lib/Lazarus/unixlazfileutils.inc rename to src/lib/Lazarus/components/lazutils/unixlazfileutils.inc diff --git a/src/lib/Lazarus/unixlazutf8.inc b/src/lib/Lazarus/components/lazutils/unixlazutf8.inc similarity index 99% rename from src/lib/Lazarus/unixlazutf8.inc rename to src/lib/Lazarus/components/lazutils/unixlazutf8.inc index 4295c10c..6c6a8856 100644 --- a/src/lib/Lazarus/unixlazutf8.inc +++ b/src/lib/Lazarus/components/lazutils/unixlazutf8.inc @@ -47,3 +47,4 @@ procedure FinalizeLazUTF8; begin //dummy procedure end; + diff --git a/src/lib/Lazarus/winfileutil.inc b/src/lib/Lazarus/components/lazutils/winfileutil.inc similarity index 99% rename from src/lib/Lazarus/winfileutil.inc rename to src/lib/Lazarus/components/lazutils/winfileutil.inc index 1ff3b24e..09481f86 100644 --- a/src/lib/Lazarus/winfileutil.inc +++ b/src/lib/Lazarus/components/lazutils/winfileutil.inc @@ -21,3 +21,6 @@ begin Result:=LazUTF8.SysToUTF8(SysUtils.ExtractShortPathName(LazUTF8.UTF8ToSys(FileName))); {$endif} end; + + + diff --git a/src/lib/Lazarus/winlazfileutils.inc b/src/lib/Lazarus/components/lazutils/winlazfileutils.inc similarity index 62% rename from src/lib/Lazarus/winlazfileutils.inc rename to src/lib/Lazarus/components/lazutils/winlazfileutils.inc index e24b9701..e7e7f58b 100644 --- a/src/lib/Lazarus/winlazfileutils.inc +++ b/src/lib/Lazarus/components/lazutils/winlazfileutils.inc @@ -18,114 +18,34 @@ end; // ******** Start of WideString specific implementations ************ -const - ShareModes: array[0..4] of Integer = ( - 0, - 0, - FILE_SHARE_READ, - FILE_SHARE_WRITE, - FILE_SHARE_READ or FILE_SHARE_WRITE); - - AccessModes: array[0..2] of Cardinal = ( - GENERIC_READ, - GENERIC_WRITE, - GENERIC_READ or GENERIC_WRITE); - -function WinToDosTime(Var Wtime : TFileTime; var DTime:longint):longbool; -var - lft : TFileTime; -begin - WinToDosTime:=FileTimeToLocalFileTime(WTime,lft{%H-}) - {$ifndef WinCE} - and FileTimeToDosDateTime(lft,Longrec(Dtime).Hi,LongRec(DTIME).lo) - {$endif} - ; -end; - -Function DosToWinTime(DosTime:longint; Var Wintime : TFileTime):longbool; -var - lft : TFileTime; -begin - DosToWinTime:= - {$ifndef wince} - DosDateTimeToFileTime(longrec(DosTime).hi,longrec(DosTime).lo,@lft) and - {$endif} - LocalFileTimeToFileTime(lft,Wintime); ; -end; - function GetCurrentDirUtf8: String; -{$ifndef WinCE} var - w : WideString; - res : Integer; - {$endif} + U: UnicodeString; begin - {$ifdef WinCE} - Result := '\'; - // Previously we sent an exception here, which is correct, but this causes - // trouble with code which isnt tested for WinCE, so lets just send a dummy result instead - // Exception.Create('[GetCurrentDirWide] The concept of the current directory doesn''t exist in Windows CE'); - {$else} - res:=GetCurrentDirectoryW(0, nil); - SetLength(w, res); - res:=Windows.GetCurrentDirectoryW(res, @w[1]); - SetLength(w, res); - Result:=UTF8Encode(w); - {$endif} + System.GetDir(0, U{%H-}); + // Need to do an explicit encode to utf8, if compiled with "-dDisableUtf8RTL" + Result := UTF8Encode(U); end; procedure GetDirUtf8(DriveNr: Byte; var Dir: String); -{This procedure may not be threadsafe, because SetCurrentDirectory isn't} -{$ifndef WinCE} var - w, D: WideString; - SavedDir: WideString; - res : Integer; -{$endif} + U: UnicodeString; begin - {$ifdef WinCE} - Dir := '\'; - // Previously we sent an exception here, which is correct, but this causes - // trouble with code which isnt tested for WinCE, so lets just send a dummy result instead - // Exception.Create('[GetCurrentDirWide] The concept of the current directory doesn''t exist in Windows CE'); - {$else} - //writeln('GetDirWide START'); - if not (DriveNr = 0) then - begin - res := GetCurrentDirectoryW(0, nil); - SetLength(SavedDir, res); - res:=Windows.GetCurrentDirectoryW(res, @SavedDir[1]); - SetLength(SavedDir,res); - - D := WideChar(64 + DriveNr) + ':'; - if not SetCurrentDirectoryW(@D[1]) then - begin - Dir := Char(64 + DriveNr) + ':\'; - SetCurrentDirectoryW(@SavedDir[1]); - Exit; - end; - end; - res := GetCurrentDirectoryW(0, nil); - SetLength(w, res); - res := GetCurrentDirectoryW(res, @w[1]); - SetLength(w, res); - Dir:=UTF8Encode(w); - if not (DriveNr = 0) then SetCurrentDirectoryW(@SavedDir[1]); - //writeln('GetDirWide END'); - {$endif} + {$PUSH} + {$IOCHECKS OFF} + GetDir(DriveNr, U{%H-}); + if IOResult <> 0 then + U := UnicodeString(Chr(DriveNr + Ord('A') - 1) + ':\'); + {$POP} + // Need to do an explicit encode to utf8, if compiled with "-dDisableUtf8RTL" + Dir := UTF8Encode(U); end; - function FileOpenUtf8(Const FileName : string; Mode : Integer) : THandle; - begin - Result := CreateFileW(PWideChar(UTF8Decode(FileName)), dword(AccessModes[Mode and 3]), - dword(ShareModes[(Mode and $F0) shr 4]), nil, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, 0); - //if fail api return feInvalidHandle (INVALIDE_HANDLE=feInvalidHandle=-1) + Result := SysUtils.FileOpen(FileName, Mode); end; - function FileCreateUTF8(Const FileName : string) : THandle; begin Result := FileCreateUtf8(FileName, fmShareExclusive, 0); @@ -136,100 +56,62 @@ begin Result := FileCreateUtf8(FileName, fmShareExclusive, Rights); end; -function FileCreateUtf8(Const FileName : string; ShareMode: Integer; {%H-}Rights: Cardinal) : THandle; +function FileCreateUtf8(Const FileName : string; ShareMode: Integer; Rights: Cardinal) : THandle; begin - Result := CreateFileW(PWideChar(UTF8Decode(FileName)), GENERIC_READ or GENERIC_WRITE, - dword(ShareModes[(ShareMode and $F0) shr 4]), nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + Result := SysUtils.FileCreate(FileName, ShareMode, Rights); end; - function FileGetAttrUtf8(const FileName: String): Longint; begin - Result:=Integer(Windows.GetFileAttributesW(PWideChar(UTF8Decode(FileName)))); + Result := SysUtils.FileGetAttr(FileName); end; function FileSetAttrUtf8(const Filename: String; Attr: longint): Longint; begin - if Windows.SetFileAttributesW(PWideChar(UTF8Decode(FileName)), Attr) then - Result:=0 - else - Result := Integer(Windows.GetLastError); + Result := SysUtils.FileSetAttr(FileName, Attr); end; function FileAgeUtf8(const FileName: String): Longint; -var - Hnd: THandle; - FindData: TWin32FindDataW; begin - Result := -1; - Hnd := FindFirstFileW(PWideChar(UTF8ToUTF16(FileName)), FindData{%H-}); - if Hnd <> Windows.INVALID_HANDLE_VALUE then - begin - Windows.FindClose(Hnd); - if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then - If WinToDosTime(FindData.ftLastWriteTime,Result) then - exit; - end; + Result := SysUtils.FileAge(FileName); end; function FileSetDateUtf8(const FileName: String; Age: Longint): Longint; -var - FT:TFileTime; - fh: HANDLE; begin - try - fh := CreateFileW(PWideChar(UTF8ToUTF16(FileName)), - FILE_WRITE_ATTRIBUTES, - 0, nil, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, 0); - if (fh <> feInvalidHandle) and (DosToWinTime(Age,FT{%H-}) and SetFileTime(fh, nil, nil, @FT)) then - Result := 0 - else - Result := GetLastError; - finally - if (fh <> feInvalidHandle) then FileClose(fh); - end; + Result := SysUtils.FileSetDate(FileName, Age); end; - function FileSizeUtf8(const Filename: string): int64; var - FindData: TWIN32FindDataW; - FindHandle: THandle; - Str: WideString; -begin - // Fix for the bug 14360: - // Don't assign the widestring to TSearchRec.name because it is of type - // string, which will generate a conversion to the system encoding - Str := UTF8Decode(Filename); - FindHandle := Windows.FindFirstFileW(PWideChar(Str), FindData{%H-}); - if FindHandle = Windows.Invalid_Handle_value then + R: TSearchRec; +begin + if SysUtils.FindFirst(FileName, faAnyFile, R) = 0 then begin + Result := R.Size; + SysUtils.FindClose(R); + end + else Result := -1; - exit; - end; - Result := (int64(FindData.nFileSizeHigh) shl 32) + FindData.nFileSizeLow; - Windows.FindClose(FindHandle); end; function CreateDirUtf8(const NewDir: String): Boolean; begin - Result:=Windows.CreateDirectoryW(PWideChar(UTF8Decode(NewDir)), nil); + Result := SysUtils.CreateDir(NewDir); end; function RemoveDirUtf8(const Dir: String): Boolean; begin - Result:=Windows.RemoveDirectoryW(PWideChar(UTF8Decode(Dir))); + Result := SysUtils.RemoveDir(Dir); end; function DeleteFileUtf8(const FileName: String): Boolean; begin - Result:=Windows.DeleteFileW(PWideChar(UTF8Decode(FileName))); + Result := SysUtils.DeleteFile(FileName); end; function RenameFileUtf8(const OldName, NewName: String): Boolean; begin - Result:=MoveFileW(PWideChar(UTF8Decode(OldName)), PWideChar(UTF8Decode(NewName))); + Result := SysUtils.RenameFile(OldName, NewName); end; function SetCurrentDirUtf8(const NewDir: String): Boolean; @@ -237,124 +119,18 @@ begin {$ifdef WinCE} raise Exception.Create('[SetCurrentDirWide] The concept of the current directory doesn''t exist in Windows CE'); {$else} - Result:=Windows.SetCurrentDirectoryW(PWidechar(UTF8Decode(NewDir))); + Result:=Windows.SetCurrentDirectoryW(PWidechar(UnicodeString(NewDir))); {$endif} end; -{$IF DEFINED(WinCE) OR (FPC_FULLVERSION>=30000)} - {$define FindData_W} -{$IFEND} - -function FindMatch(var f: TSearchRec) : Longint; -begin - { Find file with correct attribute } - While (F.FindData.dwFileAttributes and cardinal(F.ExcludeAttr))<>0 do - begin - if FindNextUTF8(F)<>0 then - begin - Result:=GetLastError; - exit; - end; - end; - { Convert some attributes back } - WinToDosTime(F.FindData.ftLastWriteTime,F.Time); - f.size:=F.FindData.NFileSizeLow+(qword(maxdword)+1)*F.FindData.NFileSizeHigh; - f.attr:=F.FindData.dwFileAttributes; - { The structures are different at this point - in win32 it is the ansi structure with a utf-8 string - in wince it is a wide structure } - {$ifdef FindData_W} - {$IFDEF ACP_RTL} - f.Name:=String(UnicodeString(F.FindData.cFileName)); - {$ELSE} - f.Name:=UTF8Encode(UnicodeString(F.FindData.cFileName)); - {$ENDIF} - {$else} - f.Name:=F.FindData.cFileName; - {$endif} - Result:=0; -end; - -{$IFNDEF FindData_W} - -{ This function does not really convert from wide to ansi, but from wide to - a utf-8 encoded ansi version of the data structures in win32 and does - nothing in wince - - See FindMatch also } -procedure FindWideToAnsi(const wide: TWIN32FINDDATAW; var ansi: TWIN32FINDDATA); -var - ws: WideString; - an: AnsiString; -begin - SetLength(ws, length(wide.cAlternateFileName)); - Move(wide.cAlternateFileName[0], ws[1], length(ws)*2); - an := AnsiString(ws); // no need to utf8 for cAlternateFileName (it's always ansi encoded) - Move(an[1], ansi.cAlternateFileName, sizeof(ansi.cAlternateFileName)); - - ws := PWideChar(@wide.cFileName[0]); - an := UTF8Encode(ws); - ansi.cFileName := an; - if length(an) 3) and (Fn[1] = PathDelim) and (Fn[2] = PathDelim) and (Fn[3] = '?') and (Fn[4] = PathDelim) //Do NOT use AllowDirectorySeparators here! - then Exit; + then Exit(Fn); ForcePathDelims(Fn); IsAbs := FileNameIsWinAbsolute(Fn); if not IsAbs then @@ -635,28 +411,14 @@ begin end; end; - - function FileExistsUTF8(const Filename: string): boolean; -var - Attr: Longint; begin - Attr := FileGetAttrUTF8(FileName); - if Attr <> -1 then - Result:= (Attr and FILE_ATTRIBUTE_DIRECTORY) = 0 - else - Result:=False; + Result := SysUtils.FileExists(Filename); end; function DirectoryExistsUTF8(const Directory: string): boolean; -var - Attr: Longint; begin - Attr := FileGetAttrUTF8(Directory); - if Attr <> -1 then - Result := (Attr and FILE_ATTRIBUTE_DIRECTORY) > 0 - else - Result := False; + Result := SysUtils.DirectoryExists(Directory); end; function FileIsExecutable(const AFilename: string): boolean; diff --git a/src/lib/Lazarus/winlazutf8.inc b/src/lib/Lazarus/components/lazutils/winlazutf8.inc similarity index 96% rename from src/lib/Lazarus/winlazutf8.inc rename to src/lib/Lazarus/components/lazutils/winlazutf8.inc index dac98855..83201b2b 100644 --- a/src/lib/Lazarus/winlazutf8.inc +++ b/src/lib/Lazarus/components/lazutils/winlazutf8.inc @@ -222,6 +222,7 @@ begin end; end; +{$IFNDEF WINCE} function GetGetEnvironmentVariableCountWide: integer; var hp,p : PWideChar; @@ -238,6 +239,7 @@ begin FreeEnvironmentStringsW(p); end; + function GetEnvironmentStringWide(Index: Integer): UnicodeString; var hp,p : PWideChar; @@ -255,6 +257,7 @@ begin Result:=hp; FreeEnvironmentStringsW(p); end; +{$ENDIF WINCE} function GetEnvironmentVariableWide(const EnvVar: string): UnicodeString; {$IF FPC_FULLVERSION>=30000} @@ -287,6 +290,7 @@ begin end; {$ENDIF} + //*************** END WideString impementations {$ifdef WinCE} @@ -319,18 +323,12 @@ function UTF8ToConsole(const s: string): string; // converts UTF8 to console str var Dst: PChar; begin - {$ifndef NO_CP_RTL} Result := UTF8ToWinCP(s); - {$else NO_CP_RTL} - Result := UTF8ToSys(s); // Kept for compatibility - {$endif NO_CP_RTL} Dst := AllocMem((Length(Result) + 1) * SizeOf(Char)); if CharToOEM(PChar(Result), Dst) then Result := StrPas(Dst); FreeMem(Dst); - {$ifndef NO_CP_RTL} SetCodePage(RawByteString(Result), CP_OEMCP, False); - {$endif NO_CP_RTL} end; {$endif not WinCE} @@ -422,27 +420,13 @@ end; function GetLocaleStr(aLocaleID, aLCType: Longint; const Def: string): String; var L: Integer; - {$IF FPC_FULLVERSION < 30000} - ResultLen: Integer; - {$ENDIF} Buf: array[0..255] of WideChar; begin L := GetLocaleInfoW(aLocaleID, aLCType, Buf, SizeOf(Buf)); if L > 0 then begin Result:=''; - {$IF FPC_FULLVERSION >= 30000} widestringmanager.Wide2AnsiMoveProc(PWideChar(@Buf[0]),Result,CP_UTF8,L-1); - {$ELSE} - ResultLen:=WideCharToMultiByte(CP_UTF8,0,PWideChar(@Buf[0]),L-1,nil,0,nil,nil); - if ResultLen > 0 then - begin - SetLength(Result,ResultLen); - WideCharToMultiByte(CP_UTF8,0,PWideChar(@Buf[0]),L-1,@result[1],ResultLen,nil,nil) - end - else - Result:=Def; - {$ENDIF} end else Result := Def; diff --git a/src/lib/Lazarus/components/multithreadprocs/mtpcpu.pas b/src/lib/Lazarus/components/multithreadprocs/mtpcpu.pas deleted file mode 100644 index fc71dc5d..00000000 --- a/src/lib/Lazarus/components/multithreadprocs/mtpcpu.pas +++ /dev/null @@ -1,103 +0,0 @@ -{ - ********************************************************************** - This file is part of the Free Pascal run time library. - - See the file COPYING.FPC, included in this distribution, - for details about the license. - ********************************************************************** - - System depending code for light weight threads. - - Copyright (C) 2008 Mattias Gaertner mattias@freepascal.org - -} -unit MTPCPU; - -{$mode objfpc}{$H+} -{$inline on} - -interface - -{$IF defined(windows)} -uses Windows; -{$ELSEIF defined(freebsd) or defined(darwin)} -uses ctypes, sysctl; -{$ELSEIF defined(linux)} -{$linklib c} -uses ctypes; -{$ENDIF} - -function GetSystemThreadCount: integer; - -procedure CallLocalProc(AProc, Frame: Pointer; Param1: PtrInt; - Param2, Param3: Pointer); inline; - -implementation - -{$IFDEF Linux} -const _SC_NPROCESSORS_ONLN = 83; -function sysconf(i: cint): clong; cdecl; external name 'sysconf'; -{$ENDIF} - -function GetSystemThreadCount: integer; -// returns a good default for the number of threads on this system -{$IF defined(windows)} -//returns total number of processors available to system including logical hyperthreaded processors -var - i: Integer; - ProcessAffinityMask, SystemAffinityMask: DWORD_PTR; - Mask: DWORD; - SystemInfo: SYSTEM_INFO; -begin - if GetProcessAffinityMask(GetCurrentProcess, ProcessAffinityMask, SystemAffinityMask) - then begin - Result := 0; - for i := 0 to 31 do begin - Mask := DWord(1) shl i; - if (ProcessAffinityMask and Mask)<>0 then - inc(Result); - end; - end else begin - //can't get the affinity mask so we just report the total number of processors - GetSystemInfo(SystemInfo); - Result := SystemInfo.dwNumberOfProcessors; - end; -end; -{$ELSEIF defined(UNTESTEDsolaris)} - begin - t = sysconf(_SC_NPROC_ONLN); - end; -{$ELSEIF defined(freebsd) or defined(darwin)} -var - mib: array[0..1] of cint; - len: cint; - t: cint; -begin - mib[0] := CTL_HW; - mib[1] := HW_NCPU; - len := sizeof(t); - fpsysctl(pchar(@mib), 2, @t, @len, Nil, 0); - Result:=t; -end; -{$ELSEIF defined(linux)} - begin - Result:=sysconf(_SC_NPROCESSORS_ONLN); - end; - -{$ELSE} - begin - Result:=1; - end; -{$ENDIF} - -procedure CallLocalProc(AProc, Frame: Pointer; Param1: PtrInt; - Param2, Param3: Pointer); inline; -type - PointerLocal = procedure(_EBP: Pointer; Param1: PtrInt; - Param2, Param3: Pointer); -begin - PointerLocal(AProc)(Frame, Param1, Param2, Param3); -end; - -end. - diff --git a/src/lib/Lazarus/components/multithreadprocs/mtprocs.pas b/src/lib/Lazarus/components/multithreadprocs/mtprocs.pas deleted file mode 100644 index 22199d35..00000000 --- a/src/lib/Lazarus/components/multithreadprocs/mtprocs.pas +++ /dev/null @@ -1,873 +0,0 @@ -{ - ********************************************************************** - This file is part of the Free Pascal run time library. - - See the file COPYING.FPC, included in this distribution, - for details about the license. - ********************************************************************** - - Unit for light weight threads. - - Copyright (C) 2008 Mattias Gaertner mattias@freepascal.org - - Abstract: - Light weight threads. - This unit provides methods to easily run a procedure/method with several - threads at once. -} -unit MTProcs; - -{$mode objfpc}{$H+} - -{$inline on} - -interface - -uses - Classes, SysUtils, MTPCPU; - -type - TProcThreadGroup = class; - TProcThreadPool = class; - TProcThread = class; - - { TMultiThreadProcItem } - - TMTPThreadState = ( - mtptsNone, - mtptsActive, - mtptsWaitingForIndex, - mtptsWaitingFailed, - mtptsInactive, - mtptsTerminated - ); - - TMultiThreadProcItem = class - private - FGroup: TProcThreadGroup; - FIndex: PtrInt; - FThread: TProcThread; - FWaitingForIndexEnd: PtrInt; - FWaitingForIndexStart: PtrInt; - fWaitForPool: PRTLEvent; - FState: TMTPThreadState; - public - destructor Destroy; override; - function WaitForIndexRange(StartIndex, EndIndex: PtrInt): boolean; - function WaitForIndex(Index: PtrInt): boolean; inline; - procedure CalcBlock(Index, BlockSize, LoopLength: PtrInt; - out BlockStart, BlockEnd: PtrInt); inline; - property Index: PtrInt read FIndex; - property Group: TProcThreadGroup read FGroup; - property WaitingForIndexStart: PtrInt read FWaitingForIndexStart; - property WaitingForIndexEnd: PtrInt read FWaitingForIndexEnd; - property Thread: TProcThread read FThread; - end; - - { TProcThread } - - TMTPThreadList = ( - mtptlPool, - mtptlGroup - ); - - TProcThread = class(TThread) - private - FItem: TMultiThreadProcItem; - FNext, FPrev: array[TMTPThreadList] of TProcThread; - procedure AddToList(var First: TProcThread; ListType: TMTPThreadList); inline; - procedure RemoveFromList(var First: TProcThread; ListType: TMTPThreadList); inline; - procedure Terminating(aPool: TProcThreadPool; E: Exception); - public - constructor Create; - destructor Destroy; override; - procedure Execute; override; - property Item: TMultiThreadProcItem read FItem; - end; - - TMTMethod = procedure(Index: PtrInt; Data: Pointer; - Item: TMultiThreadProcItem) of object; - TMTProcedure = procedure(Index: PtrInt; Data: Pointer; - Item: TMultiThreadProcItem); - - { TProcThreadGroup - Each task creates a new group of threads. - A group can either need more threads or it has finished and waits for its - threads to end. - The thread that created the group is not in the list FFirstThread. } - - TMTPGroupState = ( - mtpgsNone, - mtpgsNeedThreads, // the groups waiting for more threads to help - mtpgsFinishing, // the groups waiting for its threads to finish - mtpgsException // there was an exception => close asap - ); - - TProcThreadGroup = class - private - FEndIndex: PtrInt; - FException: Exception; - FFirstRunningIndex: PtrInt; - FFirstThread: TProcThread; - FLastRunningIndex: PtrInt; - FMaxThreads: PtrInt; - FNext, FPrev: TProcThreadGroup; - FPool: TProcThreadPool; - FStarterItem: TMultiThreadProcItem; - FStartIndex: PtrInt; - FState: TMTPGroupState; - FTaskData: Pointer; - FTaskFrame: Pointer; - FTaskMethod: TMTMethod; - FTaskProcedure: TMTProcedure; - FThreadCount: PtrInt; - procedure AddToList(var First: TProcThreadGroup; ListType: TMTPGroupState); inline; - procedure RemoveFromList(var First: TProcThreadGroup); inline; - function NeedMoreThreads: boolean; inline; - procedure IncreaseLastRunningIndex(Item: TMultiThreadProcItem); - procedure AddThread(AThread: TProcThread); - procedure RemoveThread(AThread: TProcThread); inline; - procedure Run(Index: PtrInt; Data: Pointer; Item: TMultiThreadProcItem); inline; - procedure IndexComplete(Index: PtrInt); - procedure WakeThreadsWaitingForIndex; - function HasFinishedIndex(aStartIndex, aEndIndex: PtrInt): boolean; - procedure EnterExceptionState(E: Exception); - public - constructor Create; - destructor Destroy; override; - property Pool: TProcThreadPool read FPool; - property StartIndex: PtrInt read FStartIndex; - property EndIndex: PtrInt read FEndIndex; - property FirstRunningIndex: PtrInt read FFirstRunningIndex; // first started - property LastRunningIndex: PtrInt read FLastRunningIndex; // last started - property TaskData: Pointer read FTaskData; - property TaskMethod: TMTMethod read FTaskMethod; - property TaskProcedure: TMTProcedure read FTaskProcedure; - property TaskFrame: Pointer read FTaskFrame; - property MaxThreads: PtrInt read FMaxThreads; - property StarterItem: TMultiThreadProcItem read FStarterItem; - end; - - { TLightWeightThreadPool - Group 0 are the inactive threads } - - { TProcThreadPool } - - TProcThreadPool = class - private - FMaxThreadCount: PtrInt; - FThreadCount: PtrInt; - FFirstInactiveThread: TProcThread; - FFirstActiveThread: TProcThread; - FFirstTerminatedThread: TProcThread; - FFirstGroupNeedThreads: TProcThreadGroup; - FFirstGroupFinishing: TProcThreadGroup; - FCritSection: TRTLCriticalSection; - FDestroying: boolean; - procedure SetMaxThreadCount(const AValue: PtrInt); - procedure CleanTerminatedThreads; - procedure DoParallelIntern(const AMethod: TMTMethod; - const AProc: TMTProcedure; const AFrame: Pointer; - StartIndex, EndIndex: PtrInt; - Data: Pointer = nil; MaxThreads: PtrInt = 0); - public - // for debugging only: the critical section is public: - procedure EnterPoolCriticalSection; inline; - procedure LeavePoolCriticalSection; inline; - public - constructor Create; - destructor Destroy; override; - - procedure DoParallel(const AMethod: TMTMethod; - StartIndex, EndIndex: PtrInt; - Data: Pointer = nil; MaxThreads: PtrInt = 0); inline; - procedure DoParallel(const AProc: TMTProcedure; - StartIndex, EndIndex: PtrInt; - Data: Pointer = nil; MaxThreads: PtrInt = 0); inline; - - // experimental - procedure DoParallelLocalProc(const LocalProc: Pointer; - StartIndex, EndIndex: PtrInt; - Data: Pointer = nil; MaxThreads: PtrInt = 0); // do not make this inline! - - // utility functions for loops: - procedure CalcBlockSize(LoopLength: PtrInt; - out BlockCount, BlockSize: PtrInt; MinBlockSize: PtrInt = 0); inline; - public - property MaxThreadCount: PtrInt read FMaxThreadCount write SetMaxThreadCount; - property ThreadCount: PtrInt read FThreadCount; - end; - -var - ProcThreadPool: TProcThreadPool = nil; - -threadvar - CurrentThread: TThread; // TProcThread sets this, you can set this for your own TThreads descendants - -implementation - -{ TMultiThreadProcItem } - -destructor TMultiThreadProcItem.Destroy; -begin - if fWaitForPool<>nil then begin - RTLeventdestroy(fWaitForPool); - fWaitForPool:=nil; - end; - inherited Destroy; -end; - -function TMultiThreadProcItem.WaitForIndexRange( - StartIndex, EndIndex: PtrInt): boolean; -var - aPool: TProcThreadPool; -begin - //WriteLn('TLightWeightThreadItem.WaitForIndexRange START Index='+IntToStr(Index)+' StartIndex='+IntToStr(StartIndex)+' EndIndex='+IntToStr(EndIndex)); - if (EndIndex>=Index) then exit(false); - if EndIndexnil then - FNext[ListType].FPrev[ListType]:=Self; - First:=Self; -end; - -procedure TProcThread.RemoveFromList(var First: TProcThread; - ListType: TMTPThreadList); -begin - if First=Self then - First:=FNext[ListType]; - if FNext[ListType]<>nil then - FNext[ListType].FPrev[ListType]:=FPrev[ListType]; - if FPrev[ListType]<>nil then - FPrev[ListType].FNext[ListType]:=FNext[ListType]; - FNext[ListType]:=nil; - FPrev[ListType]:=nil; -end; - -procedure TProcThread.Terminating(aPool: TProcThreadPool; - E: Exception); -begin - aPool.EnterPoolCriticalSection; - try - // remove from group - if Item.FGroup<>nil then begin - // an exception occured - Item.FGroup.EnterExceptionState(E); - Item.FGroup.RemoveThread(Self); - Item.FGroup:=nil; - end; - // move to pool's terminated threads - case Item.FState of - mtptsActive: RemoveFromList(aPool.FFirstActiveThread,mtptlPool); - mtptsInactive: RemoveFromList(aPool.FFirstInactiveThread,mtptlPool); - end; - AddToList(aPool.FFirstTerminatedThread,mtptlPool); - Item.FState:=mtptsTerminated; - finally - aPool.LeavePoolCriticalSection; - end; -end; - -constructor TProcThread.Create; -begin - inherited Create(true); - fItem:=TMultiThreadProcItem.Create; - fItem.fWaitForPool:=RTLEventCreate; - fItem.FThread:=Self; -end; - -destructor TProcThread.Destroy; -begin - FreeAndNil(FItem); - inherited Destroy; -end; - -procedure TProcThread.Execute; -var - aPool: TProcThreadPool; - Group: TProcThreadGroup; - ok: Boolean; - E: Exception; -begin - MTProcs.CurrentThread:=Self; - aPool:=Item.Group.Pool; - ok:=false; - try - repeat - // work - Group:=Item.Group; - Group.Run(Item.Index,Group.TaskData,Item); - - aPool.EnterPoolCriticalSection; - try - Group.IndexComplete(Item.Index); - - // find next work - if Group.LastRunningIndexnil then begin - // add to new group - aPool.FFirstGroupNeedThreads.AddThread(Self); - Group:=Item.Group; - end else begin - // mark inactive - RemoveFromList(aPool.FFirstActiveThread,mtptlPool); - AddToList(aPool.FFirstInactiveThread,mtptlPool); - Item.FState:=mtptsInactive; - RTLeventResetEvent(Item.fWaitForPool); - end; - end; - finally - aPool.LeavePoolCriticalSection; - end; - // wait for new work - if Item.FState=mtptsInactive then - RTLeventWaitFor(Item.fWaitForPool); - until Item.Group=nil; - ok:=true; - except - // stop the exception and store it - E:=Exception(AcquireExceptionObject); - Terminating(aPool,E); - end; - if ok then - Terminating(aPool,nil); -end; - -{ TProcThreadGroup } - -procedure TProcThreadGroup.AddToList(var First: TProcThreadGroup; - ListType: TMTPGroupState); -begin - FNext:=First; - if FNext<>nil then - FNext.FPrev:=Self; - First:=Self; - FState:=ListType; -end; - -procedure TProcThreadGroup.RemoveFromList( - var First: TProcThreadGroup); -begin - if First=Self then - First:=FNext; - if FNext<>nil then - FNext.FPrev:=FPrev; - if FPrev<>nil then - FPrev.FNext:=FNext; - FNext:=nil; - FPrev:=nil; - FState:=mtpgsNone; -end; - -function TProcThreadGroup.NeedMoreThreads: boolean; -begin - Result:=(FLastRunningIndexmtpgsException); -end; - -procedure TProcThreadGroup.IncreaseLastRunningIndex(Item: TMultiThreadProcItem); -begin - inc(FLastRunningIndex); - Item.FIndex:=FLastRunningIndex; - if NeedMoreThreads then exit; - if FState=mtpgsNeedThreads then begin - RemoveFromList(Pool.FFirstGroupNeedThreads); - AddToList(Pool.FFirstGroupFinishing,mtpgsFinishing); - end; -end; - -procedure TProcThreadGroup.AddThread(AThread: TProcThread); -begin - AThread.Item.FGroup:=Self; - AThread.AddToList(FFirstThread,mtptlGroup); - inc(FThreadCount); - IncreaseLastRunningIndex(AThread.Item); -end; - -procedure TProcThreadGroup.RemoveThread(AThread: TProcThread); -begin - AThread.RemoveFromList(FFirstThread,mtptlGroup); - dec(FThreadCount); -end; - -procedure TProcThreadGroup.Run(Index: PtrInt; Data: Pointer; - Item: TMultiThreadProcItem); inline; -begin - if Assigned(FTaskFrame) then begin - CallLocalProc(FTaskProcedure,FTaskFrame,Index,Data,Item) - end else begin - if Assigned(FTaskProcedure) then - FTaskProcedure(Index,Data,Item) - else - FTaskMethod(Index,Data,Item) - end; -end; - -procedure TProcThreadGroup.IndexComplete(Index: PtrInt); -var - AThread: TProcThread; - NewFirstRunningThread: PtrInt; -begin - // update FirstRunningIndex - NewFirstRunningThread:=FStarterItem.Index; - AThread:=FFirstThread; - while AThread<>nil do begin - if (NewFirstRunningThread>aThread.Item.Index) - and (aThread.Item.Index<>Index) then - NewFirstRunningThread:=aThread.Item.Index; - aThread:=aThread.FNext[mtptlGroup]; - end; - FFirstRunningIndex:=NewFirstRunningThread; - // wake up threads (Note: do this even if FFirstRunningIndex has not changed) - WakeThreadsWaitingForIndex; -end; - -procedure TProcThreadGroup.WakeThreadsWaitingForIndex; -var - aThread: TProcThread; -begin - if FState<>mtpgsException then begin - // wake up waiting threads - aThread:=FFirstThread; - while aThread<>nil do begin - if (aThread.Item.FState=mtptsWaitingForIndex) - and HasFinishedIndex(aThread.Item.WaitingForIndexStart, - aThread.Item.WaitingForIndexEnd) - then begin - // wake up the thread - aThread.Item.FState:=mtptsActive; - RTLeventSetEvent(aThread.Item.fWaitForPool); - end; - aThread:=aThread.FNext[mtptlGroup]; - end; - if (FStarterItem.FState=mtptsWaitingForIndex) - and HasFinishedIndex(FStarterItem.WaitingForIndexStart,FStarterItem.WaitingForIndexEnd) - then begin - // wake up the starter thread of this group - FStarterItem.FState:=mtptsActive; - RTLeventSetEvent(FStarterItem.fWaitForPool); - end; - end else begin - // end group: wake up waiting threads - aThread:=FFirstThread; - while aThread<>nil do begin - if (aThread.Item.FState=mtptsWaitingForIndex) - then begin - // end group: wake up the thread - aThread.Item.FState:=mtptsWaitingFailed; - RTLeventSetEvent(aThread.Item.fWaitForPool); - end; - aThread:=aThread.FNext[mtptlGroup]; - end; - if (FStarterItem.FState=mtptsWaitingForIndex) - then begin - // end group: wake up the starter thread of this group - FStarterItem.FState:=mtptsWaitingFailed; - RTLeventSetEvent(FStarterItem.fWaitForPool); - end; - end; -end; - -function TProcThreadGroup.HasFinishedIndex( - aStartIndex, aEndIndex: PtrInt): boolean; -var - AThread: TProcThread; -begin - // test the finished range - if FFirstRunningIndex>aEndIndex then exit(true); - // test the unfinished range - if FLastRunningIndexnil do begin - if (AThread.Item.Index>=aStartIndex) - and (AThread.Item.Index<=aEndIndex) then - exit(false); - AThread:=AThread.FNext[mtptlGroup]; - end; - if (FStarterItem.Index>=aStartIndex) - and (FStarterItem.Index<=aEndIndex) then - exit(false); - Result:=true; -end; - -procedure TProcThreadGroup.EnterExceptionState(E: Exception); -begin - if FState=mtpgsException then exit; - case FState of - mtpgsFinishing: RemoveFromList(Pool.FFirstGroupFinishing); - mtpgsNeedThreads: RemoveFromList(Pool.FFirstGroupNeedThreads); - end; - FState:=mtpgsException; - FException:=E; - WakeThreadsWaitingForIndex; -end; - -constructor TProcThreadGroup.Create; -begin - FStarterItem:=TMultiThreadProcItem.Create; - FStarterItem.FGroup:=Self; -end; - -destructor TProcThreadGroup.Destroy; -begin - FreeAndNil(FStarterItem); - inherited Destroy; -end; - -{ TProcThreadPool } - -procedure TProcThreadPool.SetMaxThreadCount(const AValue: PtrInt); -begin - if FMaxThreadCount=AValue then exit; - if AValue<1 then raise Exception.Create('TLightWeightThreadPool.SetMaxThreadCount'); - FMaxThreadCount:=AValue; -end; - -procedure TProcThreadPool.CleanTerminatedThreads; -var - AThread: TProcThread; -begin - while FFirstTerminatedThread<>nil do begin - AThread:=FFirstTerminatedThread; - AThread.RemoveFromList(FFirstTerminatedThread,mtptlPool); - AThread.Free; - end; -end; - -constructor TProcThreadPool.Create; -begin - FMaxThreadCount:=GetSystemThreadCount; - if FMaxThreadCount<1 then - FMaxThreadCount:=1; - InitCriticalSection(FCritSection); -end; - -destructor TProcThreadPool.Destroy; - - procedure WakeWaitingStarterItems(Group: TProcThreadGroup); - begin - while Group<>nil do begin - if Group.StarterItem.FState=mtptsWaitingForIndex then begin - Group.StarterItem.FState:=mtptsWaitingFailed; - RTLeventSetEvent(Group.StarterItem.fWaitForPool); - end; - Group:=Group.FNext; - end; - end; - -var - AThread: TProcThread; -begin - FDestroying:=true; - // wake up all waiting threads - EnterPoolCriticalSection; - try - AThread:=FFirstActiveThread; - while AThread<>nil do begin - if aThread.Item.FState=mtptsWaitingForIndex then begin - aThread.Item.FState:=mtptsWaitingFailed; - RTLeventSetEvent(AThread.Item.fWaitForPool); - end; - AThread:=AThread.FNext[mtptlPool]; - end; - WakeWaitingStarterItems(FFirstGroupNeedThreads); - WakeWaitingStarterItems(FFirstGroupFinishing); - finally - LeavePoolCriticalSection; - end; - - // wait for all active threads to become inactive - while FFirstActiveThread<>nil do - Sleep(10); - - // wake up all inactive threads (without new work they will terminate) - EnterPoolCriticalSection; - try - AThread:=FFirstInactiveThread; - while AThread<>nil do begin - RTLeventSetEvent(AThread.Item.fWaitForPool); - AThread:=AThread.FNext[mtptlPool]; - end; - finally - LeavePoolCriticalSection; - end; - - // wait for all threads to terminate - while FFirstInactiveThread<>nil do - Sleep(10); - - // free threads - CleanTerminatedThreads; - - DoneCriticalsection(FCritSection); - inherited Destroy; -end; - -procedure TProcThreadPool.EnterPoolCriticalSection; -begin - EnterCriticalsection(FCritSection); -end; - -procedure TProcThreadPool.LeavePoolCriticalSection; -begin - LeaveCriticalsection(FCritSection); -end; - -procedure TProcThreadPool.DoParallel(const AMethod: TMTMethod; - StartIndex, EndIndex: PtrInt; Data: Pointer; MaxThreads: PtrInt); -begin - if not Assigned(AMethod) then exit; - DoParallelIntern(AMethod,nil,nil,StartIndex,EndIndex,Data,MaxThreads); -end; - -procedure TProcThreadPool.DoParallel(const AProc: TMTProcedure; - StartIndex, EndIndex: PtrInt; Data: Pointer; MaxThreads: PtrInt); -begin - if not Assigned(AProc) then exit; - DoParallelIntern(nil,AProc,nil,StartIndex,EndIndex,Data,MaxThreads); -end; - -procedure TProcThreadPool.DoParallelLocalProc(const LocalProc: Pointer; - StartIndex, EndIndex: PtrInt; Data: Pointer; MaxThreads: PtrInt); -var - Frame: Pointer; -begin - if not Assigned(LocalProc) then exit; - Frame:=get_caller_frame(get_frame); - DoParallelIntern(nil,TMTProcedure(LocalProc),Frame,StartIndex,EndIndex, - Data,MaxThreads); -end; - -procedure TProcThreadPool.CalcBlockSize(LoopLength: PtrInt; out BlockCount, - BlockSize: PtrInt; MinBlockSize: PtrInt); -begin - if LoopLength<=0 then begin - BlockCount:=0; - BlockSize:=1; - exit; - end; - // split work into equally sized blocks - BlockCount:=ProcThreadPool.MaxThreadCount; - BlockSize:=(LoopLength div BlockCount); - if (BlockSizeEndIndex) then exit; // nothing to do - if FDestroying then raise Exception.Create('Pool destroyed'); - - if (MaxThreads>MaxThreadCount) or (MaxThreads<=0) then - MaxThreads:=MaxThreadCount; - if (StartIndex=EndIndex) or (MaxThreads<=1) then begin - // single threaded - Item:=TMultiThreadProcItem.Create; - try - for Index:=StartIndex to EndIndex do begin - Item.FIndex:=Index; - if Assigned(AFrame) then begin - CallLocalProc(AProc,AFrame,Index,Data,Item) - end else begin - if Assigned(AProc) then - AProc(Index,Data,Item) - else - AMethod(Index,Data,Item) - end; - end; - finally - Item.Free; - end; - exit; - end; - - // create a new group - Group:=TProcThreadGroup.Create; - Group.FPool:=Self; - Group.FTaskData:=Data; - Group.FTaskMethod:=AMethod; - Group.FTaskProcedure:=AProc; - Group.FTaskFrame:=AFrame; - Group.FStartIndex:=StartIndex; - Group.FEndIndex:=EndIndex; - Group.FFirstRunningIndex:=StartIndex; - Group.FLastRunningIndex:=StartIndex; - Group.FMaxThreads:=MaxThreads; - Group.FThreadCount:=1; - Group.FStarterItem.FState:=mtptsActive; - Group.FStarterItem.FIndex:=StartIndex; - HelperThreadException:=nil; - try - // start threads - EnterPoolCriticalSection; - try - Group.AddToList(FFirstGroupNeedThreads,mtpgsNeedThreads); - while Group.NeedMoreThreads do begin - AThread:=FFirstInactiveThread; - NewThread:=false; - if AThread<>nil then begin - AThread.RemoveFromList(FFirstInactiveThread,mtptlPool); - end else if FThreadCountmtpgsException) - then begin - inc(Group.FLastRunningIndex); - Index:=Group.FLastRunningIndex; - end else begin - Index:=StartIndex; - end; - finally - LeavePoolCriticalSection; - end; - until Index=StartIndex; - finally - // wait for Group to finish - if Group.FFirstThread<>nil then begin - EnterPoolCriticalSection; - try - Group.FStarterItem.FState:=mtptsInactive; - Group.FStarterItem.fIndex:=EndIndex;// needed for Group.HasFinishedIndex - // wake threads waiting for starter thread to finish - if Group.FStarterItem.FState<>mtptsInactive then - Group.EnterExceptionState(nil) - else - Group.WakeThreadsWaitingForIndex; - finally - LeavePoolCriticalSection; - end; - // waiting with exponential spin lock - Index:=0; - while Group.FFirstThread<>nil do begin - sleep(Index); - Index:=Index*2+1; - if Index>30 then Index:=30; - end; - end; - // remove group from pool - EnterPoolCriticalSection; - try - case Group.FState of - mtpgsNeedThreads: Group.RemoveFromList(FFirstGroupNeedThreads); - mtpgsFinishing: Group.RemoveFromList(FFirstGroupFinishing); - end; - finally - LeavePoolCriticalSection; - end; - HelperThreadException:=Group.FException; - Group.Free; - // free terminated threads (terminated, because of exceptions) - CleanTerminatedThreads; - end; - // if the exception occured in a helper thread raise it now - if HelperThreadException<>nil then - raise HelperThreadException; -end; - -initialization - ProcThreadPool:=TProcThreadPool.Create; - CurrentThread:=nil; - -finalization - ProcThreadPool.Free; - ProcThreadPool:=nil; - -end. - diff --git a/src/lib/Lazarus/fileutil.pas b/src/lib/Lazarus/fileutil.pas deleted file mode 100644 index 57a8c55b..00000000 --- a/src/lib/Lazarus/fileutil.pas +++ /dev/null @@ -1,305 +0,0 @@ -{ - ***************************************************************************** - This file is part of LazUtils. - - See the file COPYING.modifiedLGPL.txt, included in this distribution, - for details about the license. - ***************************************************************************** -} - -{ **************************************************************************** -BB: 2013-05-19 - -Note to developers: - -This unit should contain functions and procedures to -maintain compatibility with Delphi's FileUtil unit. - -File routines that specifically deal with UTF8 filenames should go into -the LazFileUtils unit. - -***************************************************************************** } -unit FileUtil; - -{$mode objfpc}{$H+} -{$i lazutils_defines.inc} - -interface - -uses - Classes, SysUtils, - Masks, LazUTF8, LazFileUtils, StrUtils; - -{$IF defined(Windows) or defined(darwin) or defined(HASAMIGA)} -{$define CaseInsensitiveFilenames} -{$ENDIF} -{$IF defined(CaseInsensitiveFilenames) or defined(darwin)} -{$define NotLiteralFilenames} -{$ENDIF} - -const - UTF8FileHeader = #$ef#$bb#$bf; - FilenamesCaseSensitive = {$IFDEF CaseInsensitiveFilenames}false{$ELSE}true{$ENDIF};// lower and upper letters are treated the same - FilenamesLiteral = {$IFDEF NotLiteralFilenames}false{$ELSE}true{$ENDIF};// file names can be compared using = string operator - -// basic functions similar to the RTL but working with UTF-8 instead of the -// system encoding - -// AnsiToUTF8 and UTF8ToAnsi need a widestring manager under Linux, BSD, MacOSX -// but normally these OS use UTF-8 as system encoding so the widestringmanager -// is not needed. -{$IFDEF EnableWrapperFunctions} -// *** Wrappers for LazUTF8 *** -function NeedRTLAnsi: boolean; inline; deprecated 'Use the function in LazUTF8 unit'; -procedure SetNeedRTLAnsi(NewValue: boolean); inline; deprecated 'Use the function in LazUTF8 unit'; -function UTF8ToSys(const s: string): string; inline; deprecated 'Use the function in LazUTF8 unit'; -function SysToUTF8(const s: string): string; inline; deprecated 'Use the function in LazUTF8 unit'; -function ConsoleToUTF8(const s: string): string; inline; deprecated 'Use the function in LazUTF8 unit'; -function UTF8ToConsole(const s: string): string; inline; deprecated 'Use the function in LazUTF8 unit'; -// environment -function ParamStrUTF8(Param: Integer): string; inline; deprecated 'Use the function in LazUTF8 unit'; -function GetEnvironmentStringUTF8(Index: Integer): string; inline; deprecated 'Use the function in LazUTF8 unit'; -function GetEnvironmentVariableUTF8(const EnvVar: string): String; inline; deprecated 'Use the function in LazUTF8 unit'; -// other -function SysErrorMessageUTF8(ErrorCode: Integer): String; inline; deprecated 'Use the function in LazUTF8 unit'; -// *** Wrappers for LazFileUtils *** -// environment -function GetAppConfigDirUTF8(Global: Boolean; Create: boolean = false): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function GetAppConfigFileUTF8(Global: Boolean; SubDir: boolean = false; - CreateDir: boolean = false): string; inline; deprecated 'Use the function in LazFileUtils unit'; -// file operations -function ExtractFileNameOnly(const AFilename: string): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileExistsUTF8(const Filename: string): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileAgeUTF8(const FileName: string): Longint; inline; deprecated 'Use the function in LazFileUtils unit'; -function DirectoryExistsUTF8(const Directory: string): Boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec): Longint; inline; deprecated 'Use the function in LazFileUtils unit'; -function FindNextUTF8(var Rslt: TSearchRec): Longint; inline; deprecated 'Use the function in LazFileUtils unit'; -procedure FindCloseUTF8(var F: TSearchrec); inline; deprecated 'Use the function in LazFileUtils unit'; -function FileSetDateUTF8(const FileName: String; Age: Longint): Longint; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileGetAttrUTF8(const FileName: String): Longint; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileSetAttrUTF8(const Filename: String; Attr: longint): Longint; inline; deprecated 'Use the function in LazFileUtils unit'; -function DeleteFileUTF8(const FileName: String): Boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function RenameFileUTF8(const OldName, NewName: String): Boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileSearchUTF8(const Name, DirList : String; ImplicitCurrentDir : Boolean = True): String; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileIsReadOnlyUTF8(const FileName: String): Boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function GetCurrentDirUTF8: String; inline; deprecated 'Use the function in LazFileUtils unit'; -function SetCurrentDirUTF8(const NewDir: String): Boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function CreateDirUTF8(const NewDir: String): Boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function RemoveDirUTF8(const Dir: String): Boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function ForceDirectoriesUTF8(const Dir: string): Boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileOpenUTF8(Const FileName : string; Mode : Integer) : THandle; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileCreateUTF8(Const FileName : string) : THandle; overload; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileCreateUTF8(Const FileName : string; Rights: Cardinal) : THandle; overload; inline; deprecated 'Use the function in LazFileUtils unit'; -function GetTempFilename(const Directory, Prefix: string): string; inline; deprecated 'Use the function GetTempFileNameUTF8 in LazFileUtils unit'; -// file names, attributes and states -function CleanAndExpandFilename(const Filename: string): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function CleanAndExpandDirectory(const Filename: string): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function ExpandFileNameUTF8(const FileName: string): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function CompareFileExt(const Filename, Ext: string; CaseSensitive: boolean): integer; overload; inline; deprecated 'Use the function in LazFileUtils unit'; -function CompareFileExt(const Filename, Ext: string): integer; overload; inline; deprecated 'Use the function in LazFileUtils unit'; -function CompareFilenames(const Filename1, Filename2: string): integer; inline; deprecated 'Use the function in LazFileUtils unit'; -function CompareFilenamesIgnoreCase(const Filename1, Filename2: string): integer; inline; deprecated 'Use the function in LazFileUtils unit'; -function FilenameIsAbsolute(const TheFilename: string):boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FilenameIsWinAbsolute(const TheFilename: string):boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FilenameIsUnixAbsolute(const TheFilename: string):boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -procedure CheckIfFileIsExecutable(const AFilename: string); inline; deprecated 'Use the function in LazFileUtils unit'; -procedure CheckIfFileIsSymlink(const AFilename: string); inline; deprecated 'Use the function in LazFileUtils unit'; -function FileIsReadable(const AFilename: string): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileIsWritable(const AFilename: string): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileIsText(const AFilename: string): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileIsText(const AFilename: string; out FileReadable: boolean): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileIsExecutable(const AFilename: string): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileIsSymlink(const AFilename: string): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function FileIsHardLink(const AFilename: string): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function GetFileDescription(const AFilename: string): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function ReadAllLinks(const Filename: string; ExceptionOnError: boolean): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function TryReadAllLinks(const Filename: string): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function TrimFilename(const AFilename: string): string; inline; deprecated 'Use the function in LazFileUtils unit'; -// directories -function DirPathExists(const FileName: String): Boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function ForceDirectory(DirectoryName: string): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function DirectoryIsWritable(const DirectoryName: string): boolean; inline; deprecated 'Use the function in LazFileUtils unit'; -function AppendPathDelim(const Path: string): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function ChompPathDelim(const Path: string): string; inline; deprecated 'Use the function in LazFileUtils unit'; -function CreateRelativePath(const Filename, BaseDirectory: string; - UsePointDirectory: boolean = false; AlwaysRequireSharedBaseFolder: Boolean = True): string; inline; deprecated 'Use the function in LazFileUtils unit'; -{$IFDEF darwin} -function GetDarwinSystemFilename(Filename: string): string; inline; -{$ENDIF} - -{$ENDIF EnableWrapperFunctions} - -// file and directory operations -function ComparePhysicalFilenames(const Filename1, Filename2: string): integer; -function CompareFilenames(Filename1: PChar; Len1: integer; - Filename2: PChar; Len2: integer; ResolveLinks: boolean): integer; overload; -function ExtractShortPathNameUTF8(Const FileName : String) : String; -function DeleteDirectory(const DirectoryName: string; OnlyChildren: boolean): boolean; -function ProgramDirectory: string; - -function ExpandUNCFileNameUTF8(const FileName: string): string; -function FileSize(const Filename: string): int64; overload; inline; -function ExtractFileNameWithoutExt(const AFilename: string): string; -function FilenameIsPascalUnit(const Filename: string): boolean; -function CreateAbsoluteSearchPath(const SearchPath, BaseDirectory: string): string; -function CreateAbsolutePath(const Filename, BaseDirectory: string): string; -function FileIsInPath(const Filename, Path: string): boolean; -function FileIsInDirectory(const Filename, Directory: string): boolean; - -function GetAllFilesMask: string; inline; -function GetExeExt: string; inline; -function ReadFileToString(const Filename: string): string; - -// file search -type - TSearchFileInPathFlag = ( - sffDontSearchInBasePath, // do not search in BasePath, search only in SearchPath. - sffSearchLoUpCase - ); - TSearchFileInPathFlags = set of TSearchFileInPathFlag; - -function SearchFileInPath(const Filename, BasePath, SearchPath, - Delimiter: string; Flags: TSearchFileInPathFlags): string; overload; -function SearchAllFilesInPath(const Filename, BasePath, SearchPath, - Delimiter: string; Flags: TSearchFileInPathFlags): TStrings; -function FindDiskFilename(const Filename: string): string; -function FindDiskFileCaseInsensitive(const Filename: string): string; -function FindDefaultExecutablePath(const Executable: string; const BaseDir: string = ''): string; - -type - - { TFileIterator } - - TFileIterator = class - private - FPath: String; - FLevel: Integer; - FFileInfo: TSearchRec; - FSearching: Boolean; - function GetFileName: String; - public - procedure Stop; - - function IsDirectory: Boolean; - public - property FileName: String read GetFileName; - property FileInfo: TSearchRec read FFileInfo; - property Level: Integer read FLevel; - property Path: String read FPath; - - property Searching: Boolean read FSearching; - end; - - TFileFoundEvent = procedure (FileIterator: TFileIterator) of object; - TDirectoryFoundEvent = procedure (FileIterator: TFileIterator) of object; - TDirectoryEnterEvent = procedure (FileIterator: TFileIterator) of object; - - { TFileSearcher } - - TFileSearcher = class(TFileIterator) - private - FMaskSeparator: char; - FFollowSymLink: Boolean; - FOnFileFound: TFileFoundEvent; - FOnDirectoryFound: TDirectoryFoundEvent; - FOnDirectoryEnter: TDirectoryEnterEvent; - FFileAttribute: Word; - FDirectoryAttribute: Word; - procedure RaiseSearchingError; - protected - procedure DoDirectoryEnter; virtual; - procedure DoDirectoryFound; virtual; - procedure DoFileFound; virtual; - public - constructor Create; - procedure Search(ASearchPath: String; ASearchMask: String = ''; - ASearchSubDirs: Boolean = True; CaseSensitive: Boolean = False); - public - property MaskSeparator: char read FMaskSeparator write FMaskSeparator; - property FollowSymLink: Boolean read FFollowSymLink write FFollowSymLink; - property FileAttribute: Word read FFileAttribute write FFileAttribute default faAnyfile; - property DirectoryAttribute: Word read FDirectoryAttribute write FDirectoryAttribute default faDirectory; - property OnDirectoryFound: TDirectoryFoundEvent read FOnDirectoryFound write FOnDirectoryFound; - property OnFileFound: TFileFoundEvent read FOnFileFound write FOnFileFound; - property OnDirectoryEnter: TDirectoryEnterEvent read FOnDirectoryEnter write FOnDirectoryEnter; - end; - - { TListFileSearcher } - - TListFileSearcher = class(TFileSearcher) - private - FList: TStrings; - protected - procedure DoFileFound; override; - public - constructor Create(AList: TStrings); - end; - - { TListDirectoriesSearcher } - - TListDirectoriesSearcher = class(TFileSearcher) - private - FDirectoriesList :TStrings; - protected - procedure DoDirectoryFound; override; - public - constructor Create(AList: TStrings); - end; - -function FindAllFiles(const SearchPath: String; SearchMask: String = ''; - SearchSubDirs: Boolean = True; DirAttr: Word = faDirectory): TStringList; overload; -procedure FindAllFiles(AList: TStrings; const SearchPath: String; - SearchMask: String = ''; SearchSubDirs: Boolean = True; DirAttr: Word = faDirectory); overload; - -function FindAllDirectories(const SearchPath: string; - SearchSubDirs: Boolean = True): TStringList; overload; -procedure FindAllDirectories(AList: TStrings; const SearchPath: String; - SearchSubDirs: Boolean = true); overload; - -// flags for copy -type - TCopyFileFlag = ( - cffOverwriteFile, - cffCreateDestDirectory, - cffPreserveTime - ); - TCopyFileFlags = set of TCopyFileFlag; - -// Copy a file and a whole directory tree -function CopyFile(const SrcFilename, DestFilename: string; - Flags: TCopyFileFlags=[cffOverwriteFile]; ExceptionOnError: Boolean=False): boolean; -function CopyFile(const SrcFilename, DestFilename: string; PreserveTime: boolean; ExceptionOnError: Boolean=False): boolean; -function CopyDirTree(const SourceDir, TargetDir: string; Flags: TCopyFileFlags=[]): Boolean; - -// filename parts -const - PascalFileExt: array[1..3] of string = ('.pas','.pp','.p'); - PascalSourceExt: array[1..6] of string = ('.pas','.pp','.p','.lpr','.dpr','.dpk'); - - AllDirectoryEntriesMask = '*'; - -implementation - -uses -{$IFDEF windows} - Windows; -{$ELSE} - {$IFDEF HASAMIGA} - AmigaDOS; - {$ELSE} - Unix; - {$ENDIF} -{$ENDIF} - -{$I fileutil.inc} -{$IFDEF windows} - {$i winfileutil.inc} -{$ELSE} - {$IFDEF HASAMIGA} - {$i unixfileutil.inc} // Reuse UNIX code for Amiga - {$ELSE} - {$i unixfileutil.inc} - {$ENDIF} -{$ENDIF} - -end. diff --git a/src/lib/Lazarus/lazutils_defines.inc b/src/lib/Lazarus/lazutils_defines.inc deleted file mode 100644 index 5132b66c..00000000 --- a/src/lib/Lazarus/lazutils_defines.inc +++ /dev/null @@ -1,18 +0,0 @@ -// Add defines here. This file should be included in all LazUtils units headers - - -{$undef UTF8_RTL} // FPC >= 2.7.1 with codepages and default string = CP_UTF8 -{$undef ACP_RTL} // FPC >= 2.7.1 with codepages and default string = CP_ACP -{$undef NO_CP_RTL} // FPC < 2.7.1 before string codepages - - -{$ifdef FPC_HAS_CPSTRING} - {$ifndef DisableUTF8RTL} - {$define UTF8_RTL} - {$else DisableUTF8RTL} - {$define ACP_RTL} - {$endif DisableUTF8RTL} -{$else FPC_HAS_CPSTRING} - {$define NO_CP_RTL} - {$undef DisableUTF8RTL} -{$endif FPC_HAS_CPSTRING} diff --git a/src/lib/bass/bass.chm b/src/lib/bass/bass.chm deleted file mode 100644 index 57c76337..00000000 Binary files a/src/lib/bass/bass.chm and /dev/null differ diff --git a/src/lib/bass/delphi/bass.pas b/src/lib/bass/bass.pas similarity index 100% rename from src/lib/bass/delphi/bass.pas rename to src/lib/bass/bass.pas diff --git a/src/lib/bass/bass.txt b/src/lib/bass/bass.txt deleted file mode 100644 index 6ddcacab..00000000 --- a/src/lib/bass/bass.txt +++ /dev/null @@ -1,2121 +0,0 @@ -BASS 2.4 -Copyright (c) 1999-2016 Un4seen Developments Ltd. All rights reserved. - -Files that you should have found in the BASS package -==================================================== -Win32 version -------------- -BASS.TXT This file -BASS.DLL BASS module -BASS.CHM BASS documentation -MP3-FREE\ - BASS.DLL BASS module using the OS's MP3 decoder -X64\ - BASS.DLL 64-bit BASS module - MP3-FREE - BASS.DLL 64-bit BASS module using the OS's MP3 decoder -C\ C/C++ API and examples... - BASS.H BASS C/C++ header file - BASS.LIB BASS import library - BASS.DSW Visual C++ 6 workspace for examples - BASS.SLN Visual C++ 2005 (and above) solution for examples - MAKEFILE Makefile for all examples - MAKEFILE.IN Makefile helper macros - X64\ - BASS.LIB 64-bit BASS import library - 3DTEST\ 3D/EAX example - 3DTEST.C - 3DTEST.RC - 3DTEST.DSP - 3DTEST.VCPROJ - MAKEFILE - BASSTEST\ Simple playback example - BASSTEST.C - BASSTEST.RC - BASSTEST.DSP - BASSTEST.VCPROJ - MAKEFILE - CONTEST\ Console example - CONTEST.C - CONTEST.DSP - CONTEST.VCPROJ - MAKEFILE - CUSTLOOP\ Custom looping example - CUSTLOOP.C - CUSTLOOP.DSP - CUSTLOOP.VCPROJ - MAKEFILE - DEVLIST\ Device list example - DEVLIST.C - DEVLIST.DSP - DEVLIST.VCPROJ - MAKEFILE - DSPTEST\ DSP example - DSPTEST.C - DSPTEST.RC - DSPTEST.DSP - DSPTEST.VCPROJ - MAKEFILE - FXTEST\ DX8 effect example - FXTEST.C - FXTEST.RC - FXTEST.DSP - FXTEST.VCPROJ - MAKEFILE - LIVEFX\ Full-duplex example - LIVEFX.C - LIVEFX.RC - LIVEFX.DSP - LIVEFX.VCPROJ - MAKEFILE - LIVESPEC\ "Live" version of spectrum analyser example - LIVESPEC.C - LIVESPEC.DSP - LIVESPEC.VCPROJ - MAKEFILE - MODTEST\ MOD music example - MODTEST.C - MODTEST.RC - MODTEST.DSP - MODTEST.VCPROJ - MAKEFILE - MULTI\ Multiple device example - MULTI.C - MULTI.RC - MULTI.DSP - MULTI.VCPROJ - MAKEFILE - NETRADIO\ Internet streaming example - NETRADIO.C - NETRADIO.RC - NETRADIO.DSP - NETRADIO.VCPROJ - MAKEFILE - PLUGINS\ Plugins example - PLUGINS.C - PLUGINS.RC - PLUGINS.DSP - PLUGINS.VCPROJ - MAKEFILE - RECTEST\ Recording example - RECTEST.C - RECTEST.RC - RECTEST.DSP - RECTEST.VCPROJ - MAKEFILE - SPEAKERS\ Multi-speaker example - SPEAKERS.C - SPEAKERS.RC - SPEAKERS.DSP - SPEAKERS.VCPROJ - MAKEFILE - SPECTRUM\ Spectrum analyser example - SPECTRUM.C - SPECTRUM.DSP - SPECTRUM.VCPROJ - MAKEFILE - SYNTH\ Low latency custom streaming example - SYNTH.C - SYNTH.DSP - SYNTH.VCPROJ - MAKEFILE - WRITEWAV\ WAVE writer example - WRITEWAV.C - WRITEWAV.DSP - WRITEWAV.VCPROJ - MAKEFILE - BIN\ Precompiled examples - 3DTEST.EXE - BASSTEST.EXE - CONTEST.EXE - CUSTLOOP.EXE - DEVLIST.EXE - DSPTEST.EXE - FXTEST.EXE - LIVEFX.EXE - LIVESPEC.EXE - MODTEST.EXE - MULTI.EXE - NETRADIO.EXE - RECTEST.EXE - SPEAKERS.EXE - SPECTRUM.EXE - SYNTH.EXE - WRITEWAV.EXE -DELPHI\ Delphi API and examples... - BASS.PAS BASS Delphi unit - 3DTEST\ 3D/EAX example - D3TEST.DPR - DTMAIN.PAS - DTMAIN.DFM - DTSELECT.PAS - DTSELECT.DFM - BASSTEST\ Simple playback example - BASSTEST.DPR - BTMAIN.PAS - BTMAIN.DFM - CONTEST\ Console example - CONTEST.DPR - CUSTLOOP\ Custom looping example - CUSTLOOP.DPR - UNIT1.PAS - UNIT1.DFM - DSPTEST\ DSP example - DSPTEST.DPR - DTMAIN.PAS - DTMAIN.DFM - FXTEST\ DX8 effect example - FXTEST.DPR - TEST.PAS - TEST.DFM - LIVEFX\ Full-duplex example - LIVEFX.DPR - UNIT1.PAS - UNIT1.DFM - LIVESPEC\ "Live" version of spectrum analyser example - LIVESPEC.DPR - MULTI\ Multiple device example - MULTI.DPR - UNIT1.PAS - UNIT1.DFM - UNIT2.PAS - UNIT2.DFM - NETRADIO\ Internet streaming example - NETRADIO.DPR - UNIT1.PAS - UNIT1.DFM - PLUGINS\ Plugins example - PLUGINS.DPR - UNIT1.PAS - UNIT1.DFM - RECORDTEST\ Recording example - RECORDTEST.DPR - UNIT1.PAS - UNIT1.DFM - SAMPLEVIS\ Visualisation example - SAMPLEVIS.DPR - MAIN.PAS - MAIN.DFM - SPECTRUM_VIS.PAS - CIRCLE_VIS.PAS - OSC_VIS.PAS - COMMONTYPES.PAS - SPEAKERS\ Multi-speaker example - SPEAKERS.DPR - UNIT1.PAS - UNIT1.DFM - SPECTRUM\ Spectrum analyser example - SPECTRUM.DPR - UNIT1.PAS - COMMON.INC - STREAMTEST\ User stream example - STREAMTEST.DPR - STMAIN.PAS - STMAIN.DFM - WRITEWAV\ WAVE writer example - WRITEWAV.DPR - UNITMAIN.PAS - UNITMAIN.DFM -VB\ Visual Basic API and examples... - BASS.BAS BASS Visual Basic module - 3DTEST\ 3D/EAX example - PRJ3DTEST.VBP - PRJ3DTEST.FRM - PRJDEVICE.FRM - BASSTEST\ Simple playback example - PRJBASSTEST.VBP - FRMBASSTEST.FRM - CUSTLOOP\ Custom looping example - PRJCUSTLOOP.VBP - FRMCUSTLOOP.FRM - MODCUSTLOOP.BAS - DSPTEST\ DSP example - PRJDSPTEST.VBP - FRMDSPTEST.FRM - MODDSPTEST.BAS - FXTEST\ DX8 effect example - PRJFXTEST.VBP - FRMFXTEST.FRM - LIVEFX\ Full-duplex example - PRJLIVEFX.VBP - FRMLIVEFX.FRM - MODLIVEFX.BAS - LIVESPEC\ "Live" version of spectrum analyser example - PRJLIVESPEC.VBP - FRMLIVESPEC.FRM - MODLIVESPEC.BAS - MULTI\ Multiple device example - PRJMULTI.VBP - FRMMULTI.FRM - FRMDEVICE.FRM - NETRADIO\ Internet streaming example - PRJNETRADIO.VBP - FRMNETRADIO.FRM - MODNETRADIO.BAS - CLSFILEIO.CLS - PLUGINS\ Plugins example - PRJPLUGINS.VBP - FRMPLUGINS.FRM - RECTEST\ Recording example - PRJRECTEST.VBP - FRMRECTEST.FRM - MODRECTEST.BAS - SPEAKERS\ Multi-speaker example - PRJSPEAKERS.VBP - FRMSPEAKERS.FRM - SPECTRUM\ Spectrum analyser example - PRJSPECTRUM.VBP - FRMSPECTRUM.FRM - MODSPECTRUM.BAS - SYNTH\ Low latency custom streaming example - PRJSYNTH.VBP - FRMSYNTH.FRM - MODSYNTH.BAS - WRITEWAV\ WAVE writer example - PRJWRITEWAVE.VBP - PRJWRITEWAVE.FRM - MEMORY\ Playing from memory example by Jobnik - PRJMEMORY.VBP - FRMMEMORY.FRM - SYNCTEST.BAS - CBASS_TIME.CLS - -NOTE: You may need to "Unblock" the BASS.CHM file in its "Properties" to - view it on Windows 7. The documentation can also be viewed online at - the BASS website. - -NOTE: To run the example EXEs, first you will need to copy BASS.DLL into the - same directory as them. - -MacOSX version --------------- -BASS.TXT This file -LIBBASS.DYLIB BASS module -BASS.CHM BASS documentation -CHMOX.APP CHM file viewer -BASS.H BASS C/C++ header file -MAKEFILE Makefile for all examples -MAKEFILE.IN Makefile helper macros -BASS.XCODEPROJ Xcode project for examples -MP3-FREE\ - LIBBASS.DYLIB BASS module using the OS's MP3 decoder -3DTEST\ 3D example - 3DTEST.C - 3DTEST.NIB - MAKEFILE -BASSTEST\ Simple playback example - BASSTEST.C - BASSTEST.NIB - MAKEFILE -CONTEST\ Console example - CONTEST.C - MAKEFILE -CUSTLOOP\ Custom looping example - CUSTLOOP.C - MAKEFILE -DEVLIST\ Device list example - DEVLIST.C - MAKEFILE -DSPTEST\ DSP example - DSPTEST.C - DSPTEST.NIB - MAKEFILE -FXTEST\ DX8 effect example - FXTEST.C - FXTEST.NIB - MAKEFILE -LIVESPEC\ "Live" version of spectrum analyser example - LIVESPEC.C - MAKEFILE -MODTEST\ MOD music example - MODTEST.C - MODTEST.NIB - MAKEFILE -MULTI\ Multiple device example - MULTI.C - MULTI.NIB - MAKEFILE -NETRADIO\ Internet streaming example - NETRADIO.C - NETRADIO.NIB - MAKEFILE -PLUGINS\ Plugins example - PLUGINS.C - PLUGINS.NIB - MAKEFILE -RECTEST\ Recording example - RECTEST.C - RECTEST.NIB - MAKEFILE -SPEAKERS\ Multi-speaker example - SPEAKERS.C - SPEAKERS.NIB - MAKEFILE -SPECTRUM\ Spectrum analyser example - SPECTRUM.C - MAKEFILE -SYNTH\ Low latency custom streaming example - SYNTH.C - SYNTH.NIB - MAKEFILE -WRITEWAV\ WAVE writer example - WRITEWAV.C - MAKEFILE - -NOTE: To view the documentation, you will need a CHM viewer, such as the - included CHMOX. The documentation can also be viewed online at the - BASS website. - -Linux version -------------- -BASS.TXT This file -LIBBASS.SO BASS module -BASS.CHM BASS documentation -BASS.H BASS C/C++ header file -MAKEFILE Makefile for all examples -MAKEFILE.IN Makefile helper macros -MP3-FREE\ - LIBBASS.SO BASS module using the OS's MP3 decoder -X64\ - LIBBASS.SO 64-bit BASS module - MP3-FREE - LIBBASS.SO 64-bit BASS module using the OS's MP3 decoder -PASCAL\ - BASS.PAS BASS Delphi/Pascal unit -3DTEST\ 3D example - 3DTEST.C - MAKEFILE - 3DTEST.GLADE -BASSTEST\ Simple playback example - BASSTEST.C - MAKEFILE - BASSTEST.GLADE -CONTEST\ Console example - CONTEST.C - MAKEFILE -CUSTLOOP\ Custom looping example - CUSTLOOP.C - MAKEFILE -DEVLIST\ Device list example - DEVLIST.C - MAKEFILE -DSPTEST\ DSP example - DSPTEST.C - MAKEFILE - DSPTEST.GLADE -FXTEST\ DX8 effect example - FXTEST.C - MAKEFILE - FXTEST.GLADE -LIVESPEC\ "Live" version of spectrum analyser example - LIVESPEC.C - MAKEFILE -MODTEST\ MOD music example - MODTEST.C - MAKEFILE - MODTEST.GLADE -MULTI\ Multiple device example - MULTI.C - MAKEFILE - MULTI.GLADE -NETRADIO\ Internet streaming example - NETRADIO.C - MAKEFILE - NETRADIO.GLADE -PLUGINS\ Plugins example - PLUGINS.C - MAKEFILE - PLUGINS.GLADE -RECTEST\ Recording example - RECTEST.C - MAKEFILE - RECTEST.GLADE -SPEAKERS\ Multi-speaker example - SPEAKERS.C - MAKEFILE - SPEAKERS.GLADE -SPECTRUM\ Spectrum analyser example - SPECTRUM.C - MAKEFILE -SYNTH\ Low latency custom streaming example - SYNTH.C - MAKEFILE - SYNTH.GLADE -WRITEWAV\ WAVE writer example - WRITEWAV.C - MAKEFILE - -NOTE: To view the documentation, you will need a CHM viewer. The - documentation can also be viewed online at the BASS website. - - -What's the point? -================= -BASS is an audio library for use in software on several platforms. Its -purpose is to provide the powerful and efficient sample, stream, MOD -music, and recording functions. All in a compact DLL that won't overly -bloat your software. - -See the documentation for descriptions of all the BASS functions. Also -check the included example source-codes for some examples of how to use -BASS in your own programs. - - -Requirements -============ -Win32 version -------------- -BASS requires DirectSound for playback and recording, but decoding is still -possible without it. DirectSound has been included with all Windows versions -since Windows 98. 32-bit and 64-bit Windows are supported. - -MacOSX version --------------- -BASS uses CoreAudio for playback and recording, so there are no special -library/driver requirements. 32-bit (i386) and 64-bit (x86_64) architectures -are supported in a single universal library. OSX 10.4 or above is -recommended. - -Linux version -------------- -BASS requires ALSA for playback and recording, but decoding is still possible -without it. 32-bit (i386) and 64-bit (x86-64) architectures are supported. -ARM support is also available as a separate download from the website. - - -Main Features -============= -* Samples - supports WAV/AIFF/MP3/MP2/MP1/OGG and custom generated samples - -* Sample streams - stream any sample data in 8/16/32 bit, with both "push" and "pull" systems - -* File streams - MP3/MP2/MP1/OGG/WAV/AIFF file streaming - -* Internet file streaming - stream files from the internet, including Shout/Icecast - -* User file streaming - stream files from anywhere using any delivery method - -* OS codecs - ACM, Media Foundation and CoreAudio codec support for additional audio formats - -* Multi-channel streaming - support for more than plain stereo, including multi-channel OGG/WAV/AIFF files - -* MOD music - uses the same engine as XMPlay = best accuracy, speed, and quality - -* MO3 music - MP3/OGG compressed MOD music - -* Add-on system - support for more formats is available via add-ons (aka plugins) - -* Multiple outputs - simultaneously use multiple soundcards, and move channels between them - -* Recording - flexible recording system, with support for multiple devices - -* Decode without playback - streams and MOD musics can be outputted in any way you want - -* Speaker assignment - assign streams and MOD musics to specific speakers - -* High precision synchronization - synchronize events in your software to the streams and MOD musics - -* Effects - chorus/compressor/distortion/echo/flanger/gargle/parameq/reverb - -* User defined DSP functions - custom effects may be applied to musics and streams - -* 32 bit floating-point decoding and processing - floating-point stream/music decoding, DSP/FX, and recording - -* 3D sound - play samples/streams/musics in any 3D position - - -Using BASS -========== -There is no guarantee that all future BASS versions will be compatible -with all previous versions, so your program should use BASS_GetVersion -to check the version that is loaded. This also means that you should -put the BASS module in the same directory as your executable (not just -somewhere in the path), to avoid the possibility of a wrong version being -loaded. - -If you are updating your software from a previous BASS version, then -you should check the "History" section (below), to see if any of the -functions that you are using have been affected by a change. - -Win32 version -------------- -C/C++, Visual Basic, and Delphi APIs and example projects are provided. To -use BASS with another language you will first have to convert the header -file. Or, as a last resort, you could use LoadLibrary and GetProcAddress. - -The downside is that you have to manually import each function that you -use, with the GetProcAddress function. But it has been made a lot simpler -to import BASS this way by the use of the BASSDEF #define. Here's a small -example: - -#define BASSDEF(f) (WINAPI *f) // define the functions as pointers -#include "bass.h" -... -HINSTANCE bass=LoadLibrary("BASS.DLL"); // load BASS -BASS_Init=GetProcAddress(bass,"BASS_Init"); // get BASS_Init -BASS_Init(-1,44100,0,hWnd,NULL); // call BASS_Init - -To use BASS with Borland C++ Builder, you will first have to create a -Borland C++ Builder import library for it. This is done by using the -IMPLIB tool that comes with Borland C++ Builder. Simply execute this: - - IMPLIB BASSBCB.LIB BASS.DLL - -... and then use BASSBCB.LIB in your projects to import BASS. - -To use BASS with LCC-Win32, you will first have to create a compatible -import library for it. This is done by using the PEDUMP and BUILDLIB -tools that come with LCC-Win32. Run these 2 commands: - - PEDUMP /EXP BASS.LIB > BASSLCC.EXP - BUILDLIB BASSLCC.EXP BASSLCC.LIB - -... and then use BASSLCC.LIB in your projects to import BASS. - -For the BASS functions that return strings (char*), VB users should use -the VBStrFromAnsiPtr function to convert the returned pointer into a VB -string. - -MacOSX version --------------- -See the example Xcode project and makefiles. - -NOTE: The LIBBASS.DYLIB file must be put in the same directory as the - executable, it can't just be somewhere in the path. - -LIBBASS.DYLIB is a universal binary, with support for the i386 and -x86_64 architectures. If only one of those architectures is needed, the -included makefile can be used extract the wanted one. It will also process -any BASS add-ons placed in the same directory. Type "make i386" or -"make x86_64" to extract a particular architecture. - -Linux version -------------- -The LIBBASS.SO file needs to be in the OS's library search path for it to -be found; simply placing it in the same directory as the executable won't -necessarily work as it does on other platforms. The BASS libraries should -also not be placed in the standard library directories to avoid version -conflicts. To meet those competing requirements, a wrapper script could be -used to set the "LD_LIBRARY_PATH" environment variable before loading the -executable. Another option is to set the "rpath" in the executable, to tell -it where to look for libraries. That is what the example makefiles do. - -When building both 32-bit and 64-bit executables, it is possible to simply -try linking with both LIBBASS.SO versions, and the linker will use the -appropriate version and ignore the other. - - -Latest Version -============== -The latest version of BASS can always be found at the BASS website: - - www.un4seen.com - - -Licence -======= -BASS is free for non-commercial use. If you are a non-commercial entity -(eg. an individual) and you are not making any money from your product -(through sales/advertising/etc), then you can use BASS in it for free. -If you wish to use BASS in commercial products, then please also see the -next section. - -TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BASS IS PROVIDED -"AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD -LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF BASS. YOU USE -BASS ENTIRELY AT YOUR OWN RISK. - -Usage of BASS indicates that you agree to the above conditions. - -All trademarks and other registered names contained in the BASS -package are the property of their respective owners. - -Commercial licensing --------------------- -BASS is available for use in your commercial products. The licence -types available are as follows: - -SHAREWARE: Allows the usage of BASS in an unlimited number of your -shareware ("try before you buy") products, which must sell for no more -than 40 Euros each. Non-shareware products are also permitted, but the -product price limit is 10 Euros in that case. The price limit can be -raised by purchasing duplicate licences, eg. 2 licences doubles it. If -you are an individual (not a corporation) making and selling your own -software, this is the licence for you. - -SINGLE COMMERCIAL: Allows the usage of BASS in one commercial product. - -UNLIMITED COMMERCIAL: Allows the usage of BASS in an unlimited number -of your commercial products. This licence is on a per-site basis, eg. -if you are creating products with BASS at 2 sites/locations, then 2 -licences are required. - -Please note the products must be end-user products, eg. not components -used by other products. - -These licences only cover your own software, not the publishing of -other's software. If you publish other's software, its developers (or -the software itself) will need to be licensed to use BASS. - -These licences are on a per-platform basis, with reductions available -when licensing for multiple platforms. In all cases there are no royalties -to pay, and you can use future BASS updates without further cost. - -These licences do not allow reselling/sublicensing of BASS. For example, -if a product is a development system, the users of said product are not -licensed to use BASS in their productions; they will need their own -licences. - -If the standard licences do not meet your requirements, or if you have -any questions, please get in touch (email: bass@un4seen.com). - -Visit the BASS website for the latest pricing: - - www.un4seen.com - -MP3 ---- -MP3 technology is patented, and Thomson license the use of their and -Fraunhofer's patents. The inclusion of an MP3 decoder (eg. BASS) in a -commercial product requires an MP3 patent licence. Contact Thomson for -details: - - www.mp3licensing.com - -Alternatively, the "MP3-FREE" BASS version does not include its own MP3 -decoder but instead makes use of the operating system's already licensed -decoder. If an MP3 decoder is not available, then MP3 playback will not -be possible, but everything else will function as normal. - -NOTE: When using the OS's MP3 decoder, BASS still does the file handling - so all the usual features are still supported, including streaming, - tag reading, pre-scanning, gapless playback, etc. - -NOTE: Linux does not include an MP3 decoder as standard. The "MP3-FREE" - BASS version will make use of the libmpg123 decoder, if installed. - - -History -======= -These are the major (and not so major) changes at each version stage. -There are of course bug fixes and other little improvements made along -the way too! To make upgrading simpler, all functions affected by a -change to the BASS interface are listed. - -2.4.12 - 10/3/2016 ------------------- -* DSP/FX chain order modification - BASS_FXSetPriority -* Average bitrate retrieval - BASS_ATTRIB_BITRATE -* Ramping-out when stopping/pausing playback - BASS_ChannelStop - BASS_ChannelPause -* Disabling of playback ramping - BASS_ATTRIB_NORAMP (BASS_ChannelSetAttribute option) -* Pre-buffering when playback buffering is disabled - BASS_ChannelUpdate - BASS_ATTRIB_NOBUFFER (BASS_ChannelSetAttribute option) -* Net agent and proxy config options now make a copy of the provided string - BASS_CONFIG_NET_AGENT/PROXY (BASS_SetConfig options) - NETRADIO example updated -* Unicode net agent and proxy config options on Windows - BASS_CONFIG_NET_AGENT/PROXY (BASS_SetConfig options) -* 32768 sample FFT - BASS_DATA_FFT32768 (BASS_ChannelGetData flag) -* Support for numerical MP4 genre (gnre) tags - BASS_TAG_MP4 (BASS_ChannelGetTags type) -* Support for BASSWMA's tag option when using Media Foundation WMA codec - BASS_TAG_WMA (BASS_ChannelGetTags type) -* OpenMPT author tag retrieval - BASS_TAG_MUSIC_AUTH (BASS_ChannelGetTags type) -* FastTracker2 panning for XM files - BASS_MUSIC_FT2PAN (BASS_MusicLoad flag) -* Support for longer device names on Windows - BASS_DEVICEINFO (name member) -* Checking for floating-point support on platforms that might not have it - BASS_CONFIG_FLOAT (BASS_GetConfig option) -* Attribute size retrieval fix - BASS_ChannelGetAttributeEx -* Fix for missing LC_VERSION_MIN issue with Xcode 7 on OSX, ppc architecture (PowerPC) support dropped -* LIST example renamed to DEVLIST - -2.4.11 - 22/12/2014 -------------------- -* Support for custom HTTP request headers - BASS_StreamCreateURL -* HTTPS support on Linux/Android - BASS_StreamCreateURL -* Redirection HTTP headers provided during connection - BASS_STREAM_STATUS (BASS_StreamCreateURL flag) - DOWNLOADPROC -* Adjustable stalled internet stream resumption buffer level - BASS_ATTRIB_NET_RESUME (BASS_ChannelSetAttribute option) -* Extended level retrieval inc. multi-channel and RMS options - BASS_ChannelGetLevelEx -* Inexact/faster seeking - BASS_POS_INEXACT (BASS_ChannelSetPosition flag) -* Post-stream creation scanning (seek table building) - BASS_POS_SCAN (BASS_ChannelSetPosition flag) -* Extended attribute support - BASS_ChannelGet/SetAttributeEx -* Scanned info retrieval and setting - BASS_ATTRIB_SCANINFO (BASS_ChannelGet/SetAttributeEx option) -* Built-in ADPCM WAVE file support on Linux/Android/WinCE - BASS_StreamCreateFile/User/URL - BASS_SampleLoad -* Active MOD channel count retrieval - BASS_ATTRIB_MUSIC_ACTIVE (BASS_ChannelGetAttribute option) -* Fractional sample rates - BASS_ATTRIB_FREQ (BASS_ChannelSetAttribute option) -* Device type information - BASS_DEVICE_TYPE_xxx (BASS_DEVICEINFO flags) -* Unicode support for recording input names - BASS_CONFIG_UNICODE - BASS_RecordGetInputName -* File size retrieval - BASS_FILEPOS_SIZE (BASS_StreamGetFilePosition mode) -* Asynchronous file reading buffer level retrieval - BASS_FILEPOS_ASYNCBUF (BASS_StreamGetFilePosition mode) -* MPEG data search limit raised to 1MB - BASS_CONFIG_VERIFY -* Separate MPEG data search limit for internet/buffered streams - BASS_CONFIG_VERIFY_NET -* Support for iTunes gapless info with Media Foundation and CoreAudio codecs - BASS_StreamCreateFile/User -* Airplay receiver enumeration and selection on OSX - BASS_DEVICES_AIRPLAY (BASS_GetDeviceInfo flag) - BASS_CONFIG_AIRPLAY (BASS_SetConfig option) -* Media Foundation playback of audio from videos is now optional - BASS_CONFIG_MF_VIDEO (BASS_SetConfig option) -* Optional floating-point or fixed-point data retrieval on Android/WinCE - BASS_DATA_FLOAT/FIXED (BASS_ChannelGetData flags) -* Continuous output when nothing is playing on Linux/Android/WinCE - BASS_CONFIG_DEV_NONSTOP (BASS_SetConfig option) -* Fix for decoding channels being ended when stopping the output device - BASS_Stop -* Fix for Media Foundation internet/buffered streaming on Windows 8 - BASS_StreamCreateURL - BASS_StreamCreateFileUser -* Improved compatibility with recent PulseAudio versions on Linux -* LIST and MODTEST examples added -* MASM API and examples removed (available as separate download) - -2.4.10 - 16/2/2013 ------------------- -* Asynchronous file reading/buffering - BASS_ASYNCFILE (BASS_StreamCreateFile/User flag) - BASS_CONFIG_ASYNCFILE_BUFFER (BASS_SetConfig option) -* Support for chained OGG files (multiple logical bitstreams) - BASS_StreamCreateFile/User - BASS_CONFIG_OGG_PRESCAN (BASS_SetConfig option) - BASS_POS_OGG (BASS_ChannelSetPosition/ChannelGetLength mode) -* OGG logical bitstream syncs are no longer automatically "mixtime" - BASS_SYNC_OGG_CHANGE (BASS_ChannelSetSync type) -* Support for Soundtracker MOD files - BASS_MusicLoad -* Complex FFT data - BASS_DATA_FFT_COMPLEX (BASS_ChannelGetData flag) -* Volume levels above 1.0 for decoding channels - BASS_ATTRIB_VOL (BASS_ChannelSetAttribute option) -* Recording device channel count retrieval on Windows/OSX/iOS - BASS_RECORDINFO (formats member) -* Minimum recording period reduced to 5ms - BASS_RecordStart -* Recording device period adjustment on OSX - BASS_RecordStart -* Device UID retrieval on OSX - BASS_DEVICEINFO (driver member) -* The desktop window handle is used when none is provided - BASS_Init - -2.4.9 - 3/5/2012 ----------------- -* Improved and adjustable sample rate conversion quality - BASS_ATTRIB_SRC (BASS_ChannelSetAttribute option) - BASS_CONFIG_SRC/_SAMPLE (BASS_SetConfig options) -* Support for buffered file & internet streams with CoreAudio codecs on OSX/iOS - BASS_StreamCreateURL - BASS_StreamCreateUser -* Data and level retrieval from sample channels - BASS_ChannelGetData - BASS_ChannelGetLevel -* Oldest sample channel will be overridden when there are multiple candidates - BASS_SampleGetChannel -* Use of the device's output rate with MODs - BASS_MusicLoad -* Optional device output rate setting on OSX/iOS - BASS_DEVICE_FREQ (BASS_Init flag) -* UTF-8 device information on Windows - BASS_CONFIG_UNICODE (BASS_SetConfig option) -* Speaker assignment with panning/balance control on Windows Vista/7 - BASS_CONFIG_VISTA_SPEAKERS (BASS_SetConfig option) - BASS_ATTRIB_PAN (BASS_ChannelGet/Set/SlideAttribute option) -* Push stream queue level can be checked after using BASS_STREAMPROC_END - BASS_StreamPutData -* Support for ALSA subdevices on Linux - BASS_Init - BASS_GetDeviceInfo - BASS_RecordInit - BASS_RecordGetDeviceInfo -* Device list fix on 64-bit OSX - BASS_GetDeviceInfo - BASS_RecordGetDeviceInfo -* BASS_UNICODE support fix on Linux - BASS_PluginLoad -* Internet streaming tweaks/fixes on Windows -* SYNTH example updated to use device output rate -* RECTEST example updated (C version) for better Windows Vista/7 support -* Documentation updated with platform-specific info for Android - -2.4.8 - 29/8/2011 ------------------ -* Support for Media Foundation codecs on Windows 7 and updated Vista - BASS_StreamCreateFile/User/URL - BASS_TAG_MF (BASS_ChannelGetTags type) - PLUGINS example updated -* Built-in support for MP4 tags on Win32/OSX/iOS (for Media Foundation & CoreAudio AAC/ALAC codecs) - BASS_TAG_MP4 (BASS_ChannelGetTags type) -* WAVE format chunk retrieval - BASS_TAG_WAVEFORMAT (BASS_ChannelGetTags type) -* Adjustable sample channel limit - BASS_SampleSetInfo -* Per-channel CPU usage monitoring - BASS_ATTRIB_CPU (BASS_ChannelGetAttribute option) -* Pre-allocation of push stream queue space - BASS_StreamPutData -* Support for AIFF files with the data chunk before the format info chunk - BASS_StreamCreateFile/User/URL -* Ramping-in disabled for all but the XM format (and MODs in FT2 mode) in "normal" ramping mode - BASS_MUSIC_RAMP (BASS_MusicLoad flag) -* RIFF "INFO" tag reading fix - BASS_TAG_RIFF_INFO (BASS_ChannelGetTags type) -* OSX 10.7 compatibility fix -* x86_64 architecture support on OSX -* Delphi dynamic loading unit removed (now available as separate download) - -2.4.7 - 30/11/2010 ------------------- -* Decode-to-position seeking - BASS_POS_DECODETO (BASS_ChannelSetPosition flag) -* Support for RIFF "DISP" text tags - BASS_TAG_RIFF_DISP (BASS_ChannelGetTags type) -* Support for APEv1 tags - BASS_TAG_APE (BASS_ChannelGetTags type) - BASS_TAG_APE_BINARY (BASS_ChannelGetTags type) -* 16384 sample FFT - BASS_DATA_FFT16384 (BASS_ChannelGetData flag) -* Support for AIFF files larger than 4GB - BASS_StreamCreateFile/User/URL -* Acceptance of self-signed and invalid certificates - BASS_StreamCreateURL -* Internet stream reading timeout - BASS_CONFIG_NET_READTIMEOUT -* Support for removing a DSP within its DSPPROC - BASS_ChannelRemoveDSP -* Buffer bypassing for lower latency output (not available on Windows) - BASS_ATTRIB_NOBUFFER (BASS_ChannelSetAttribute option) - SYNTH example added (OSX) -* A "Default" device that follows default device changes on Windows 7 - BASS_CONFIG_DEV_DEFAULT (BASS_SetConfig option) -* Xcode examples project added for OSX -* Documentation updated with platform-specific info for iOS/Linux/WinCE - -2.4.6 - 17/6/2010 ------------------ -* Support for APEv2 tags, including binary - BASS_TAG_APE (BASS_ChannelGetTags type) - BASS_TAG_APE_BINARY (BASS_ChannelGetTags type) -* Unicode/IDN URL support - BASS_StreamCreateURL -* Decoding position retrieval - BASS_POS_DECODE (BASS_ChannelGetPosition flag) -* Support for OGG 6/7.1 channel configs - BASS_StreamCreateFile/User/URL -* Support for setting syncs within mixtime SYNCPROCs - BASS_ChannelSetSync -* Support for setting additional DSP/FX within DSPPROCs - BASS_ChannelSetDSP/FX -* DC bias removal in FFT processing - BASS_DATA_FFT_REMOVEDC (BASS_ChannelGetData flag) -* Fix for incorrect (2x) return value when getting FFT data from a 16-bit channel - BASS_ChannelGetData -* Fix for incorrect (STOPPED instead of PAUSED) channel status following BASS_Pause - BASS_ChannelIsActive - -2.4.5 - 18/12/2009 ------------------- -* Support for little-endian AIFF files - BASS_StreamCreateFile/User/URL - BASS_SampleLoad -* Support for 64-bit floating-point WAVE/AIFF files - BASS_StreamCreateFile/User/URL - BASS_SampleLoad -* Input volume retrieval failure results in a reading of -1 instead of 1 - BASS_RecordGetInput - RECTEST example updated -* Input volume support on OSX - BASS_RecordSetInput - BASS_RecordGetInput - RECTEST example updated -* Fix for deferred input settings on Vista - BASS_RecordSetInput -* Windows MP3 codec given preference over other installed MP3 codecs (MP3-FREE version) - BASS_StreamCreateFile/User/URL - BASS_SampleLoad - -2.4.4 - 13/10/2009 ------------------- -* RIFF/BWF "radio traffic" tag retrieval - BASS_TAG_RIFF_CART (BASS_ChannelGetTags type) - TAG_CART structure -* Support for ID3v2 tags in RIFF/WAVE/AIFF files ("ID3 " chunk) - BASS_TAG_ID3V2 (BASS_ChannelGetTags type) -* Pushed fractional samples are refused rather than discarded - BASS_StreamPutData -* DX8 effect emulation on OSX - BASS_FX_DX8_CHORUS/DISTORTION/ECHO/FLANGER/PARAMEQ/REVERB (BASS_ChannelSetFX types) - FXTEST example added -* UTF-16 support on OSX - BASS_UNICODE (BASS_StreamCreateFile/SampleLoad/MusicLoad/PluginLoad flag) - -2.4.3 - 8/5/2009 ----------------- -* MOD order list retrieval - BASS_TAG_MUSIC_ORDERS (BASS_ChannelGetTags type) -* Support for ID3v2 tags in RIFF/WAVE files ("id3 " chunk) - BASS_TAG_ID3V2 (BASS_ChannelGetTags type) -* Improved position reporting precision on Vista - BASS_ChannelGetPosition -* Length retrieval when streaming in blocks (BASS_STREAM_BLOCK) - BASS_ChannelGetLength -* Support for CoreAudio codecs on OSX - BASS_StreamCreateFile/User - BASS_SampleLoad - BASS_TAG_CA_CODEC (BASS_ChannelGetTags type) - TAG_CA_CODEC structure -* 3D algorithm option support on OSX - BASS_CONFIG_3DALGORITHM (BASS_SetConfig option) - -2.4.2 - 18/9/2008 ------------------ -* RF64 support - BASS_StreamCreateFile/User -* RIFF/BWF "Broadcast Audio Extension" tag retrieval - BASS_TAG_RIFF_BEXT (BASS_ChannelGetTags type) - TAG_BEXT structure -* ID3v1 tag structure - TAG_ID3 structure -* Multiple simultaneous recordings per device on Vista & OSX (as on XP) - BASS_RecordStart -* DX8 effect parameter defaults updated/corrected in documentation - -2.4 - 2/4/2008 --------------- -* "Push" streaming - STREAMPROC_PUSH (BASS_StreamCreate "proc") - BASS_StreamPutData - LIVEFX and MULTI examples updated -* "Push" buffered file streaming - STREAMFILE_BUFFERPUSH (BASS_StreamCreateFileUser system) - BASS_StreamPutFileData -* STREAMFILEPROC replaced by table of callbacks for each file operation - BASS_FILEPROCS (FILECLOSEPROC/FILELENPROC/FILEREADPROC/FILESEEKPROC) - STREAMFILEPROC *removed* -* 64-bit file positioning - BASS_SampleLoad - BASS_MusicLoad - BASS_StreamCreateFile - BASS_StreamGetFilePosition -* File buffer level retrieval - BASS_FILEPOS_BUFFER (BASS_StreamGetFilePosition mode) -* Sinc interpolated MOD music mixing - BASS_MUSIC_SINCINTER (BASS_MusicLoad flag) -* MO3 2.4 support - BASS_MusicLoad -* MOD orders positioning incorporated into channel functions - BASS_ChannelGetLength - BASS_ChannelSetPosition - BASS_ChannelGetPosition - BASS_MusicGetOrderPosition *removed* - BASS_MusicGetOrders *removed* -* Channel attribute functions consolidated - BASS_ChannelSetAttribute - BASS_ChannelGetAttribute - BASS_ChannelSlideAttribute - BASS_ChannelIsSliding - BASS_ChannelSetAttributes *removed* - BASS_ChannelGetAttributes *removed* - BASS_ChannelSlideAttributes *removed* - BASS_ChannelSetEAXMix *removed* - BASS_ChannelGetEAXMix *removed* - BASS_MusicSetAttribute *removed* - BASS_MusicGetAttribute *removed* -* Floating-point volume and panning - BASS_SetVolume - BASS_GetVolume - BASS_RecordSetInput - BASS_RecordGetInput - BASS_ATTRIB_PAN/VOL (BASS_ChannelGet/Set/SlideAttribute options) - BASS_ATTRIB_MUSIC_VOL_CHAN/INST (BASS_ChannelGet/Set/SlideAttribute options) - BASS_SAMPLE (volume/pan/outvol members) - BASS_CONFIG_MAXVOL *removed* - BASSTEST and RECTEST examples updated -* Output device volume control on Vista (as on other OS) - BASS_SetVolume - BASS_GetVolume -* Multiple update threads - BASS_CONFIG_UPDATETHREADS - BASSTEST example updated -* Global volume range increased to 10000 - BASS_CONFIG_GVOL_SAMPLE/STREAM/MUSIC (BASS_SetConfig options) - BASSTEST example updated -* Setting and retrieving of a sample's data - BASS_SampleSetData - BASS_SampleGetData - BASS_SampleCreate - BASS_SampleCreateDone *removed* -* Channel flag setting mask - BASS_ChannelFlags - BASS_ChannelSetFlags *removed* - SPEAKERS example updated -* 256 sample FFT - BASS_DATA_FFT256 (BASS_ChannelGetData flag) -* Channel locking to prevent access by other threads - BASS_ChannelLock -* Manual channel buffer updating - BASS_ChannelUpdate - BASS_ChannelPreBuf *removed* -* Configurable manual update length - BASS_Update -* Extended device information retrieval and detection of new/removed devices - BASS_GetDeviceInfo - BASS_RecordGetDeviceInfo - BASS_DEVICEINFO structure - BASS_GetDeviceDescription *removed* - BASS_RecordGetDeviceDescription *removed* - BASS_INFO (driver member) *removed* - BASS_RECORDINFO (driver member) *removed* - MULTI example updated -* Default device change tracking on Windows (as on OSX) - BASS_Init - BASS_RecordInit -* Speaker detection from Windows control panel - BASS_DEVICE_CPSPEAKERS (BASS_Init flag) -* Channel automatically stopped & resumed for DX8 effects - BASS_ChannelSetFX - BASS_ChannelRemoveFX -* "double" precision position conversion - BASS_ChannelBytes2Seconds - BASS_ChannelSeconds2Bytes -* Separate config functions for pointers - BASS_SetConfigPtr - BASS_GetConfigPtr - BASS_CONFIG_NET_AGENT/PROXY (BASS_SetConfigPtr options) -* Configurable file format verification length - BASS_CONFIG_VERIFY (BASS_SetConfig option) -* Stream filename retrieval - BASS_CHANNELINFO (file member) -* Channel sample retrieval - BASS_CHANNELINFO (sample member) -* META syncs no longer receive metadata in the "data" parameter - BASS_SYNC_META (BASS_ChannelSetSync type) -* Separate sync for OGG logical bitstream changes (instead of BASS_SYNC_META) - BASS_SYNC_OGG_CHANGE (BASS_ChannelSetSync type) - NETRADIO example updated (C version) -* Message syncing removed (use PostMessage instead) - BASS_SYNC_MESSAGE (BASS_ChannelSetSync flag) *removed* -* Data retrieval from stopped/paused channels - BASS_ChannelGetData -* Callback "user" parameters changed to pointers - BASS_StreamCreate / STREAMPROC - BASS_StreamCreateFileUser - BASS_StreamCreateURL / DOWNLOADPROC - BASS_RecordStart / RECORDPROC - BASS_ChannelSetDSP / DSPPROC - BASS_ChannelSetSync / SYNCPROC - -2.3.0.3 - 30/7/2007 -------------------- -* FX state resetting - BASS_FXReset -* PLS/M3U playlist URL processing - BASS_CONFIG_NET_PLAYLIST - NETRADIO example updated -* Internet stream connection status retrieval - BASS_FILEPOS_CONNECTED (BASS_StreamGetFilePosition mode) -* Lyrics3v2 tags - BASS_TAG_LYRICS3 (BASS_ChannelGetTags type) -* IT virtual channel configuration - BASS_CONFIG_MUSIC_VIRTUAL -* Accurate speaker detection on Vista - BASS_INFO (speakers member) -* Device output/input rate retrieval on Vista - BASS_INFO (freq member) - BASS_RECORDINFO (freq member) -* Syncing upon position changes - BASS_SYNC_SETPOS (BASS_ChannelSetSync type) -* Improved stall handling - BASS_SYNC_STALL -* Invalid decoding channel flags produce an error instead of being ignored - BASS_StreamCreate/File/User/URL - BASS_MusicLoad - -2.3.0.2 - 22/1/2007 -------------------- -* Retrieval of a sample's existing channel handles - BASS_SampleGetChannels -* 8192 sample FFT - BASS_DATA_FFT8192 (BASS_ChannelGetData flag) -* Adjustable recording buffer - BASS_CONFIG_REC_BUFFER (BASS_SetConfig option) -* Stopping decoding channels before the end - BASS_ChannelStop -* Sample channels created paused to prevent overriding before playback - BASS_SampleGetChannel -* Separate "MP3-FREE" version using the OS's MP3 decoder - BASS_CONFIG_MP3_CODEC *removed* - -2.3.0.1 - 12/6/2006 -------------------- -* Ability to move a channel to another device - BASS_ChannelSetDevice - MULTI example updated -* Support for ID3v2.4 tags at end of file - BASS_TAG_ID3V2 (BASS_ChannelGetTags type) - -2.3 - 21/5/2006 ---------------- -* MOD message/instrument/sample text retrieval, merged with stream tag retrieval function - BASS_ChannelGetTags - BASS_TAG_MUSIC_NAME/MESSAGE/INST/SAMPLE (BASS_ChannelGetTags types) - BASS_MusicGetName *removed* - BASS_StreamGetTags *removed* -* Plugin information retrieval - BASS_PluginGetInfo - BASS_PLUGININFO/FORM structures - BASS_CHANNELINFO (plugin member) - PLUGINS example updated -* RIFF/WAVE "INFO" tag retrieval - BASS_TAG_RIFF_INFO (BASS_StreamGetTags type) -* More specific WAVE format information - BASS_CTYPE_STREAM_WAV_PCM/FLOAT (channel types) - BASS_CTYPE_STREAM_WAV (channel type flag) -* Proxy server configuration - BASS_CONFIG_NET_PROXY (BASS_SetConfig option) - BASS_CONFIG_NET_NOPROXY *removed* - NETRADIO example updated -* Passive FTP mode - BASS_CONFIG_NET_PASSIVE (BASS_SetConfig option) -* Agent changes take immediate effect - BASS_CONFIG_NET_AGENT (BASS_SetConfig option) -* Minimum time gap between creating new sample channels - BASS_SAMPLE (mingap member) - BASS_SampleGetChannel -* Support for Unicode plugin filenames - BASS_PluginLoad -* Device output/input rate retrieval (MacOSX only) - BASS_INFO (freq member) - BASS_RECORDINFO (freq member) -* Extended version info (minor revision) - BASS_GetVersion -* Unsupported codec error code - BASS_ERROR_CODEC -* Optional use of the Windows MP3 codec - BASS_CONFIG_MP3_CODEC (BASS_SetConfig option) -* 3D support for MacOSX - BASS_Set3DFactors - BASS_Get3DFactors - BASS_Set3DPosition - BASS_Get3DPosition - BASS_Apply3D - BASS_ChannelSet3DAttributes - BASS_ChannelGet3DAttributes - BASS_ChannelSet3DPosition - BASS_ChannelGet3DPosition - 3DTEST example added (Win32 example also updated) -* VB version of SYNTH example added - -2.2 - 2/10/2005 ---------------- -* Add-on plugin system - BASS_PluginLoad - BASS_PluginFree - BASS_StreamCreateFile/User/URL - BASS_SampleLoad - PLUGINS example added -* MOD position & syncing in bytes - BASS_ChannelSetPosition - BASS_ChannelGetPosition - BASS_MusicGetOrderPosition added for orders position - BASS_SYNC_MUSICPOS added for orders syncing - MAKEMUSICPOS macro/define - CUSTLOOP example updated -* Stream/MOD "length" functions combined (also works with samples), new MOD orders length function - BASS_ChannelGetLength - BASS_MusicGetOrders - BASS_StreamGetLength *removed* - BASS_MusicGetLength *removed* -* Support for AIFF files - BASS_StreamCreateFile/User/URL - BASS_SampleLoad -* Support for 24 and 32-bit (integer) WAV files - BASS_StreamCreateFile/User/URL - BASS_SampleLoad -* WAV files are no longer converted to the "device" resolution - BASS_StreamCreateFile/User/URL -* Recording master control - BASS_RecordGetInput - BASS_RecordSetInput -* Adjustable prebuffering - BASS_ChannelPreBuf -* Floating-point data retrieval - BASS_DATA_FLOAT (BASS_ChannelGetData flag) -* Support for floating-point samples - BASS_SampleLoad - BASS_SampleCreate -* Multi-channel samples - BASS_SampleLoad/Create - BASS_SAMPLE (chans member) -* Sample lengths given in bytes - BASS_SampleCreate - BASS_SAMPLE (length member) -* MOD music 8-bit resolution option - BASS_MusicLoad -* OGG vendor tag retrieval - BASS_TAG_VENDOR (BASS_StreamGetTags type) -* Configurable "User-Agent" header for internet streams - BASS_CONFIG_NET_AGENT (BASS_SetConfig option) -* Shoutcast metadata is now requested automatically - BASS_STREAM_META flag *removed* -* Download callbacks receive all data from start of file/stream (including any non-audio data) - DOWNLOADPROC -* Length when streaming in blocks is unavailable (BASS_ERROR_NOTAVAIL, not just 0) - BASS_ChannelGetLength -* Support for growing custom file streams - BASS_FILE_LEN (STREAMFILEPROC action) -* Query file action removed - BASS_FILE_QUERY *removed* -* Recording channel syncing - BASS_ChannelSetSync -* Info structure "size" members removed - BASS_INFO structure - BASS_RECORDINFO structure -* Little bit of flag reshuffling - BASS_MP3_SETPOS renamed to BASS_STREAM_PRESCAN - BASS_MUSIC_CALCLEN value changed and renamed to BASS_MUSIC_PRESCAN - BASS_MUSIC_POSRESET value changed -* Add-on API enhancements -* MacOSX port introduced - -2.1 - 28/11/2004 ----------------- -* Improved "mixtime" sync system, allowing custom looping - SYNCPROC - CUSTLOOP example added -* FX can now be in the DSP chain, so can be prioritized and applied in floating-point - BASS_ChannelSetFX - BASS_CONFIG_FLOATDSP (BASS_SetConfig option) -* Ability to set channel flags (eg. looping) independent of playback - BASS_ChannelSetFlags - SPEAKERS example updated -* Stream/MOD "play" and channel "resume" functions combined - BASS_ChannelPlay - BASS_StreamPlay *removed* - BASS_MusicPlay *removed* - BASS_MusicPlayEx *removed* - BASS_ChannelResume *removed* -* Stream/MOD prebuffering functions combined - BASS_ChannelPreBuf - BASS_StreamPreBuf *removed* - BASS_MusicPreBuf *removed* -* MOD attribute functions combined, with added BPM/speed/globalvolume options - BASS_MusicSetAttribute - BASS_MusicGetAttribute - BASS_MUSIC_ATTRIB_AMPLIFY - BASS_MUSIC_ATTRIB_PANSEP - BASS_MUSIC_ATTRIB_PSCALER - BASS_MUSIC_ATTRIB_BPM - BASS_MUSIC_ATTRIB_SPEED - BASS_MUSIC_ATTRIB_VOL_GLOBAL - BASS_MUSIC_ATTRIB_VOL_CHAN - BASS_MUSIC_ATTRIB_VOL_INST - BASS_MusicSetAmplify *removed* - BASS_MusicSetPanSep *removed* - BASS_MusicSetPositionScaler *removed* - BASS_MusicSetVolume *removed* - BASS_MusicGetVolume *removed* -* Flag to reset bpm/etc as well as notes when seeking in MOD musics - BASS_MUSIC_POSRESETEX (BASS_MusicLoad & BASS_ChannelSetFlags flag) -* More flexible and concise sample channel creation system - BASS_SampleGetChannel - BASS_SamplePlay *removed* - BASS_SamplePlayEx *removed* - BASS_SamplePlay3D *removed* - BASS_SamplePlay3DEx *removed* -* Support for up to 30 speakers - BASS_SPEAKER_N macro/define -* More precise level measurement - BASS_ChannelGetLevel -* Level can now be retrieved from decoding channels - BASS_ChannelGetLevel -* Retrieval of a sample/channel's original sample resolution - BASS_SAMPLE (origres member) - BASS_CHANNELINFO (origres member) -* Support for streaming WAV files in "blocks" - BASS_StreamCreateURL - BASS_StreamCreateFileUser -* Status info (HTTP/ICY tags) available during connection to server - BASS_STREAM_STATUS (BASS_StreamCreateURL flag) - DOWNLOADPROC - NETRADIO example updated (Delphi version also added) -* Adjustable internet stream prebuffering - BASS_CONFIG_NET_PREBUF (BASS_SetConfig option) -* Option to bypass proxy server - BASS_CONFIG_NET_NOPROXY (BASS_SetConfig option) -* Option whether to allow channels to be played after BASS_Pause - BASS_CONFIG_PAUSE_NOPLAY (BASS_SetConfig option) -* Recording channel count now a separate parameter - BASS_RecordStart (chans parameter) -* Synchronizer for when a channel is freed - BASS_SYNC_FREE (BASS_ChannelSetSync type) -* Data start file position retrieval - BASS_FILEPOS_START (BASS_StreamGetFilePosition mode) -* Performance improvements - MP2 decoding ~20% faster - MP3/MP1 decoding & FFT processing all up to 10% faster - OGG decoding ~3% faster -* C/C++ examples reorganised, with makefiles & VC++ projects -* Add-on API enhancements -* More DLL shrinkage :) - -2.0 - 31/10/2003 ----------------- -* Multiple output device support - BASS_Init (device number changes) - BASS_SetDevice - BASS_GetDevice - BASS_ChannelGetDevice - MULTI example updated (VB version also added) -* Multiple recording device support - BASS_RecordSetDevice - BASS_RecordGetDevice - BASS_RecordStart - BASS_ChannelGetDevice - HRECORD handle - RECORDPROC (handle parameter) -* Recording with DSP/FX - BASS_ChannelSetDSP - BASS_ChannelSetFX -* Recording position retrieval - BASS_ChannelGetPosition -* Start recording paused - BASS_RECORD_PAUSE (BASS_RecordStart flag) -* Multi-channel streams, inc. support for multichannel OGG & WAV files - BASS_StreamCreate - BASS_StreamCreateFile/User/URL -* FFT for individual channels, inc. multi-channel streams - BASS_DATA_FFT_INDIVIDUAL (BASS_ChannelGetData flag) - BASS_DATA_FFT512S/1024S/2048S/4096S *removed* -* DSP prioritizing - BASS_ChannelSetDSP - DSPTEST example updated -* Seeking in internet streamed files - BASS_ChannelSetPosition -* Enhanced custom file stream systems - BASS_StreamCreateFileUser - BASS_FILE_SEEK (STREAMFILEPROC action) - BASS_STREAM_FILEPROC flag *removed* -* Enhanced custom stream system with automatic stalling/resuming - STREAMPROC - BASS_STREAMPROC_END (STREAMPROC flag) -* Synchronizer for stalled/resumed playback - BASS_SYNC_STALL (BASS_ChannelSetSync type) -* Synchronizer for completed download - BASS_SYNC_DOWNLOAD (BASS_ChannelSetSync type) -* End sync support for custom streams - BASS_SYNC_END (BASS_ChannelSetSync type) -* Synchronizer support for decoding channels - BASS_ChannelSetSync -* Unified configuration function - BASS_SetConfig - BASS_GetConfig - BASS_SetBufferLength *removed* - BASS_SetNetConfig *removed* - BASS_SetGlobalVolumes *removed* - BASS_GetGlobalVolumes *removed* - BASS_SetLogCurves *removed* - BASS_Set3DAlgorithm *removed* - BASS_DEVICE_FLOATDSP flag *removed* -* Internet stream saving to disk replaced by more flexible callback - BASS_StreamCreateURL - DOWNLOADPROC - VB NETRADIO example updated -* Buffer length retrieval when "streaming in blocks" - BASS_FILEPOS_END (BASS_StreamGetFilePosition mode) -* Individual sample rate setting for MOD musics - BASS_MusicLoad -* Channel type and default sample rate retrieval - BASS_ChannelGetInfo (replaces BASS_ChannelGetFlags) - BASS_CHANNELINFO -* MOD music flag retrieval - BASS_CHANNELINFO (flags member) -* Adjustable instrument volumes in MOD musics - BASS_MusicSetVolume (replaces BASS_MusicSetChannelVol) - BASS_MusicGetVolume (replaces BASS_MusicGetChannelVol) -* Automatically free a MOD music when it stops or ends - BASS_MUSIC_AUTOFREE (BASS_MusicLoad flag) -* Class GUID added to initialization parameters - BASS_Init - BASS_SetCLSID *removed* -* Update period adjustable at any time - BASS_CONFIG_UPDATEPERIOD (BASS_SetConfig option) - BASS_DEVICE_NOTHREAD flag *removed* -* Customizable maximum volume setting - BASS_CONFIG_MAXVOL (BASS_SetConfig option) - BASS_DEVICE_VOL1000 flag *removed* -* Device volume is now always left as it is during init/freeing - BASS_DEVICE_LEAVEVOL flag *removed* -* Device driver name retrieval - BASS_INFO (driver member) - BASS_RECORDINFO (driver member) -* Error codes are local to the current thread - BASS_ErrorGetCode -* Performance improvements - MP2 decoding 15-20% faster - MP3 decoding ~5% faster -* Built-in CD functions removed (replaced in BASSCD) - BASS_CDDoor *removed* - BASS_CDFree *removed* - BASS_CDGetID *removed* - BASS_CDGetTrackLength *removed* - BASS_CDGetTracks *removed* - BASS_CDInDrive *removed* - BASS_CDInit *removed* - BASS_CDPlay *removed* -* Force channels to use software mixing - BASS_SAMPLE_SOFTWARE (BASS_StreamCreate/File/User/URL & BASS_MusicLoad flag) -* Support for high-pass filter and forward/reverse (S9E/F) IT/MPT effects -* BASS_MUSIC flags rearranged to mirror BASS_SAMPLE/STREAM counterparts -* Output automatically started during initialization -* BASS_ChannelGetData once again accepts any "length" param -* All function comments have been removed from the API headers to avoid - outdated/incorrect information - the documentation should be used. -* TMT Pascal API removed from main distribution - now available on the website -* A few more 'K' knocked off the DLL size :) - -1.8a - 18/6/2003 ----------------- -* Tweaks 'n' fixes, including... - Fixed seeking bug on 32-bit OGG streams - Fixed seeking on a decoding channel after it has reached the end - Low FPU precision (eg. when using Direct3D) issue addressed - Improved speakers (BASS_INFO) detection - BASS_ChannelSeconds2Bytes return value is rounded down to nearest sample - BASS_ChannelGetData "length" param must equal a whole number of samples - Slide syncs are triggered by "-2" volume slides on "autofree" streams -* Support for Unicode filenames - BASS_UNICODE (BASS_SampleLoad/BASS_StreamCreateFile/BASS_MusicLoad flag) -* 4096 sample FFT - BASS_DATA_FFT4096/S (BASS_ChannelGetData flags) -* Another 'K' knocked off the DLL size - -1.8 - 9/3/2003 --------------- -* 32-bit floating-point channels - BASS_SAMPLE_FLOAT (BASS_StreamCreate/File/URL flag) - BASS_MUSIC_FLOAT (BASS_MusicLoad flag) - BASS_SAMPLE_FLOAT (BASS_RecordStart flag) - BASS_DEVICE_FLOATDSP (BASS_Init flag) - DSPTEST example updated -* Support for 32-bit floating-point (type 3) WAV files - BASS_StreamCreateFile/URL - BASS_SampleLoad -* Channel speaker assignment - BASS_SPEAKER_FRONT (BASS_MusicLoad/BASS_StreamCreate/File/URL flag) - BASS_SPEAKER_REAR " - BASS_SPEAKER_CENLFE " - BASS_SPEAKER_REAR2 " - BASS_SPEAKER_FRONTLEFT " - BASS_SPEAKER_FRONTRIGHT " - BASS_SPEAKER_REARLEFT " - BASS_SPEAKER_REARRIGHT " - BASS_SPEAKER_CENTER " - BASS_SPEAKER_LFE " - BASS_SPEAKER_REAR2LEFT " - BASS_SPEAKER_REAR2RIGHT " - BASS_INFO (speakers member) - BASS_DEVICE_SPEAKERS (BASS_Init flag) - 4SPEAKER example replaced by SPEAKERS example -* Recording input type retrieval - BASS_INPUT_TYPE_xxx (BASS_RecordGetInput) - RECTEST example updated -* Non-interpolated MOD mixing - BASS_MUSIC_NONINTER (BASS_MusicLoad/PlayEx flag) -* Performance improvements - FFT up to 100% faster! - MP3(MPEG2/2.5) decoding up to 60% faster - MMX mixers 5-10% faster - MP3(MPEG1)/MP2/MP1/OGG decoding all ~5% faster -* Optional disabling of FFT windowing - BASS_DATA_FFT_NOWINDOW (BASS_ChannelGetData flag) -* BASS_ERROR_FILEFORM - error code to distinguish between file and sample format - BASS_MusicLoad - BASS_SampleLoad - BASS_StreamCreate/File/URL -* BASS_StreamGetFilePosition mode flags added - BASS_FILEPOS_DECODE/DOWNLOAD/END -* DirectSound 9 detection - BASS_INFO (dsver member) -* Initialization flags retrieval - BASS_INFO (initflags member) -* Half-rate MP3 playback option removed - BASS_MP3_HALFRATE flag *removed* -* New internal "plugin" system - BASSWMA is further integrated as a result -* Improved documentation - integrated with BASSWMA, search option added -* VB version of DSPTEST example added -* Delphi RECORDTEST example added -* Guess what... reduced DLL size again :) - -1.7 - 27/10/2002 ----------------- -* New alternative DX8 (DMO) effects implementation - BASS_StreamCreate/File/URL - BASS_MusicLoad - BASS_ChannelSetFX - SYNTH example updated -* User file streaming - BASS_STREAM_FILEPROC (BASS_StreamCreate flag) - STREAMFILEPROC -* DSP & FX support for decoding channels - BASS_ChannelSetDSP - BASS_ChannelSetFX -* Support for DX8 (DMO) effects in IT/XM/MO3 files - BASS_MusicLoad -* Support for chained OGG streaming (and syncing) - BASS_StreamCreateURL - BASS_SYNC_META (BASS_ChannelSetSync type) -* Attribute (volume/frequency/pan) sliding - BASS_ChannelSlideAttributes - BASS_ChannelIsSliding - BASS_SYNC_SLIDE (BASS_ChannelSetSync type) -* Recording without a callback function - BASS_RecordStart - LIVEFX example added -* Query a channel's buffered data - BASS_DATA_AVAILABLE (BASS_ChannelGetData flag) -* Discard data from the recording buffer - BASS_ChannelGetData -* Adjustable internet stream config (timeout/buffer lengths) - BASS_SetNetConfig -* Recommended minimum buffer length - BASS_INFO (minbuf member) -* MOD music flags adjustment without changing playback position - BASS_MusicPlayEx - PLAYER (MASM) example updated -* More functions are now useable in MOD music "mixtime" syncs - SYNCPROC - BASS_ChannelSetPosition - BASS_MusicPlayEx - BASS_MusicSetAmplify - BASS_MusicSetPanSep -* Maximum buffer length increased to 5 seconds - BASS_SetBufferLength -* Support for extended filter range in IT files - BASS_MusicLoad -* Speedier MOD music file verification - BASS_MusicLoad -* Delphi 3DTEST example fixed -* Magically reduced DLL size again :) - -1.6a - 25/8/2002 ----------------- -* OGG support updated to 1.0 -* Stereo FFT - BASS_DATA_FFT512S/1024S/2048S (BASS_ChannelGetData flags) -* Support for "Invert Loop" (EFx) MOD effect -* Reduced DLL size -* New Delphi examples - WRITEWAV - WAVE writer example - SAMPLEVIS - Visualisation example - -1.6 - 13/6/2002 ---------------- -* 64-bit stream lengths and positions - BASS_StreamGetLength - BASS_ChannelBytes2Seconds - BASS_ChannelSeconds2Bytes - BASS_ChannelGetPosition - BASS_ChannelSetPosition - BASS_ChannelSetSync -* Recording input selection - BASS_RECORDINFO (inputs & singlein members) - BASS_RecordGetInputName - BASS_RecordGetInput - BASS_RecordSetInput -* Adjustable recording update period - BASS_RecordStart -* Load OGG files as samples - BASS_SampleLoad -* CD drive door opening & closing - BASS_CDDoor -* CDDB2 ID retrieval - BASS_CDID_CDDB2 (BASS_CDGetID flag) -* Streaming beyond initial file length - BASS_StreamCreateFile -* Recording position bytes<->seconds translation - BASS_ChannelBytes2Seconds - BASS_ChannelSeconds2Bytes -* Improved multi-threaded support (play from any thread) - BASS_MusicPlay/Ex - BASS_SamplePlay/3D/Ex - BASS_StreamPlay - BASS_DEVICE_NOSYNC flag *removed* -* Paused channel status - BASS_ACTIVE_PAUSED (BASS_ChannelIsActive) -* Integrated WMA stream freeing - BASS_StreamFree - BASS_Free -* Pin-point accurate OGG seeking without BASS_MP3_SETPOS flag -* Win2k DS buffer bug fix - -1.5a - 14/4/2002 ----------------- -* NT4 fix (also enables "nosound" device without DX installed) - BASS_ERROR_DX error code -* MOD music loading without the samples - BASS_MUSIC_NOSAMPLE (BASS_MusicLoad flag) -* Custom decoding channels - BASS_STREAM_DECODE (BASS_StreamCreate flag) -* 5 second HTTP connection timeout - BASS_ERROR_TIMEOUT (BASS_StreamCreateURL error code) - -1.5 - 31/3/2002 ---------------- -* Improved performance - MMX mixers lot faster (over 50% faster in some cases!) - OGG decoding 15-20% faster - MP3 decoding 5-10% faster -* Recording - BASS_RecordGetDeviceDescription - BASS_RecordInit - BASS_RecordFree - BASS_RecordGetInfo - BASS_RecordStart -* OGG support built-in (OGG/VORBIS DLLs not required) - BASS_DEVICE_OGG flag *removed* -* MOD music seeking in seconds - BASS_MusicPlayEx - BASS_ChannelSetPosition -* Shoutcast metadata retrieval - BASS_STREAM_META (BASS_StreamCreateURL flag) - BASS_TAG_META (BASS_StreamGetTags type) - BASS_SYNC_META (BASS_ChannelSetSync type) -* 1000 volume levels - BASS_DEVICE_VOL1000 (BASS_Init/CDInit flag) -* CDDB ID retrieval - BASS_CDID_CDDB (BASS_CDGetID flag) -* Leave the CD volume as it is during init/closing - BASS_DEVICE_LEAVEVOL (BASS_CDInit flag) -* FFT enabled on decoding channels - BASS_ChannelGetData -* Left level duplicated on right for mono channels - BASS_ChannelGetLevel -* Improved MPEG length estimation without BASS_MP3_SETPOS flag - BASS_StreamGetLength -* Support for Modplug/ADPCM compressed files - BASS_MusicLoad -* Device description function parameter change - BASS_GetDeviceDescription -* MASM API - -1.4 - 30/1/2002 ---------------- -* Channel decoding without playback - BASS_MUSIC_DECODE (BASS_MusicLoad flag) - BASS_STREAM_DECODE (BASS_StreamCreateFile/URL flag) - BASS_ChannelGetData -* Windows message sync callbacks - BASS_SYNC_MESSAGE (BASS_ChannelSetSync flag) -* Adjustable channel volumes in MOD musics - BASS_MusicSetChannelVol - BASS_MusicGetChannelVol -* Customizable DirectSound initialization object - BASS_SetCLSID -* Retrieve HMUSIC/HSTREAM/HCHANNEL IDirectSoundBuffer interfaces - BASS_GetDSoundObject -* A3D functions removed (use BASS_SetCLSID/BASS_GetDSoundObject to access A3D) - BASS_DEVICE_A3D (BASS_Init flag) - BASS_SetA3DResManager - BASS_GetA3DResManager - BASS_SetA3DHFAbsorbtion - BASS_GetA3DHFAbsorbtion -* Callback functions now work in VB6 - DSPPROC - STREAMPROC - SYNCPROC -* Improved PCM WAVE streaming performance - BASS_StreamCreateFile - BASS_StreamCreateURL -* OGG modules updated to RC3 -* Stereo sample support in MO3 format -* MO3 encoder now distributed separately from BASS - -1.3 - 17/11/2001 ----------------- -* Manual buffer updating - BASS_DEVICE_NOTHREAD (BASS_Init flag) - BASS_Update -* Adjustable buffer update period (allows small buffer sizes) - BASS_Init -* Output device latency retrieval - BASS_INFO (latency member) -* MPEG/OGG seeking without BASS_MP3_SETPOS flag - BASS_ChannelSetPosition -* Internet file streaming from offsets - BASS_StreamCreateURL -* File stream tag/comment retrieval (ID3/ID3v2/OGG/HTTP/ICY tags) - BASS_StreamGetTags -* Byte<->time position translation - BASS_ChannelBytes2Seconds - BASS_ChannelSeconds2Bytes -* UMX (Unreal/Tournament music package) format support - BASS_MusicLoad -* S3M/IT sync fx changed to S2x (S0x conflicted with S00) - BASS_SYNC_MUSICFX -* Stereo sample support in IT/XM/S3M formats -* MO3: OGG compression supported - -1.2 - 25/9/2001 ---------------- -* OGG (Ogg Vorbis) stream support - BASS_DEVICE_OGG (BASS_Init flag) - BASS_StreamCreateFile - BASS_StreamCreateURL -* Channel linking (start/stop/pause/resume channels together) - BASS_ChannelSetLink - BASS_ChannelRemoveLink -* MOD music playback length calculation - BASS_MUSIC_CALCLEN (BASS_MusicLoad flag) - BASS_MusicGetLength -* Pre-buffering - BASS_MusicPreBuf - BASS_StreamPreBuf -* Samples with single simultaneous playbacks have same HSAMPLE/HCHANNEL handle - BASS_SamplePlay/Ex -* Stopping a custom stream flushes its buffer contents - BASS_ChannelStop - -1.1a - 31/8/2001 ----------------- -* NT4 bug fixed -* XM Wxx effect syncing - BASS_SYNC_MUSICFX -* MP3/2/1 rewinding without BASS_MP3_SETPOS - BASS_ChannelSetPosition - -1.1 - 11/8/2001 ---------------- -* DX8 (DMO) effects - BASS_SAMPLE_FX (BASS_StreamCreate/File/URL flag) - BASS_MUSIC_FX (BASS_MusicLoad flag) - BASS_ChannelSetFX - BASS_ChannelRemoveFX - BASS_FXSetParameters - BASS_FXGetParameters - BASS_FXCHORUS structure - BASS_FXCOMPRESSOR structure - BASS_FXDISTORTION structure - BASS_FXECHO structure - BASS_FXFLANGER structure - BASS_FXGARGLE structure - BASS_FXI3DL2REVERB structure - BASS_FXPARAMEQ structure - BASS_FXREVERB structure -* Internet file streaming in blocks (inc. Shoutcast/Icecast stream support) - BASS_STREAM_BLOCK (BASS_StreamCreateURL flag) -* 512/1024/2048 sample FFT - BASS_DATA_FFT512/1024/2048 (BASS_ChannelGetData flags) -* CD identification - BASS_CDGetID -* Improved DX version detection - BASS_INFO (dsver member) - -1.0 - 20/6/2001 ---------------- -* Load MP3/MP2/MP1 files as samples - BASS_SampleLoad -* Internet file streaming from FTP servers - BASS_StreamCreateURL -* Save a local copy of internet file streams - BASS_StreamCreateURL -* Sample accurate file stream seeking - BASS_ChannelSetPosition - BASS_StreamGetBlockLength *removed* -* Stream position synchronizer - BASS_SYNC_POS -* Increased synchronizer precision -* Improved MPEG file detection and error detection -* Stop MOD musics on a backwards jump effect - BASS_MUSIC_STOPBACK (BASS_MusicLoad/PlayEx flag) -* Leave the volume as it is during closing (as well as initialization) - BASS_DEVICE_LEAVEVOL (BASS_Init flag) -* Optional automatic use of foreground window handle during initialization - BASS_Init -* Reduced DLL size -* VB API fixes - -0.9 - 18/4/2001 ---------------- -* Internet file streaming - BASS_StreamCreateURL -* MP1 & MP2 (MPEG layer 1 & 2) support - BASS_StreamCreateFile/URL -* MPEG 2.5 support (12000/11025/8000hz sample rates) - BASS_StreamCreateFile/URL -* Decoding/download/end file stream position retrieval - BASS_StreamGetFilePosition -* XMPlay surround sound for MOD musics - BASS_MUSIC_SURROUND (BASS_MusicLoad/PlayEx flag) - BASS_MUSIC_SURROUND2 (BASS_MusicLoad/PlayEx flag) -* Restrict the download rate of internet file streams - BASS_STREAM_RESTRATE (BASS_StreamCreateURL flag) -* Check if an internet file stream is stalled - BASS_ChannelIsActive -* Automatically free a stream when it stops or ends - BASS_STREAM_AUTOFREE (BASS_StreamCreate/File/URL flag) -* Leave the volume as it is during initialization - BASS_DEVICE_LEAVEVOL (BASS_Init flag) -* Number of CD tracks retrieval - BASS_CDGetTracks -* CD track length retrieval - BASS_CDGetTrackLength -* Exact stream length set after whole file is streamed - BASS_StreamGetLength -* TMT Pascal API and samples -* Dynamic-loading Delphi API - -0.8a - 28/2/2000 ----------------- -* Updated Delphi API and samples - -0.8 - 24/1/2000 ---------------- -* Improved MP3 performance on P2/K6 and above CPUs -* User DSP functions on streams and MOD musics - BASS_ChannelSetDSP - BASS_ChannelRemoveDSP -* DX7 voice allocation & management - BASS_SAMPLE_VAM (BASS_SampleLoad/Create flag) - BASS_VAM_xxx flags - BASS_SAMPLE (vam & priority members) -* DX7 software 3D algorithm selection - BASS_Set3DAlgorithm -* DirectSound interface retrieval - BASS_GetDSoundObject -* Log/linear volume & panning curves - BASS_SetLogCurves -* User data passed to callback functions - STREAMPROC - BASS_StreamCreate - SYNCPROC - BASS_ChannelSetSync -* New synchronizer - BASS_SYNC_MUSICFX -* New synchronizer flag - BASS_SYNC_MIXTIME -* Disable synchronizers option - saves a little CPU time - BASS_DEVICE_NOSYNC (BASS_Init flag) -* Hi-res floating-point CPU usage monitoring - BASS_GetCPU -* Wait for playback to start when playing a CD - BASS_CDPlay -* DirectSound (dsound.dll) version retrieval - BASS_INFO (dsver member) -* Removed volume sliding functions (they were fairly pointless) - BASS_SlideVolume - BASS_IsSliding -* MO3: read/write encoder settings -* MO3: remove inst/samp/message texts now optional -* MO3: LAME encoder settings - -0.7 - 3/10/1999 ---------------- -* MO3 (MP3 compressed MODs) -* A3D functions - BASS_DEVICE_A3D (BASS_Init flag) - BASS_INFO (a3d member) - BASS_SetA3DResManager - BASS_GetA3DResManager - BASS_SetA3DHFAbsorbtion - BASS_GetA3DHFAbsorbtion -* Music/stream immediate sample data retrieval - BASS_ChannelGetData -* File stream (WAV/MP3) length retrieval - BASS_StreamGetLength - BASS_StreamGetBlockLength -* File stream seeking - BASS_ChannelSetPosition -* Mono MP3 option (lower CPU usage) - BASS_StreamCreateFile -* Music length retrieval - BASS_MusicGetLength -* Music name retrieval - BASS_MusicGetName -* Stop notes when moving MOD music position - BASS_MUSIC_POSRESET (BASS_MusicLoad/BASS_MusicPlayEx flag) -* BASS_ERROR_FREQ - invalid sample rate error code - BASS_SampleCreate - BASS_SamplePlayEx - BASS_SamplePlay3DEx - BASS_StreamCreate - BASS_ChannelSetAttributes -* Delphi and VB APIs - -0.6a - 26/7/1999 ----------------- -* Half rate MP3 option (lower CPU usage) - BASS_MP3_HALFRATE -* Loading/streaming from file offsets - BASS_MusicLoad - BASS_SampleLoad - BASS_StreamCreateFile -* Global music/sample/stream volume levels - BASS_SetGlobalVolumes - BASS_GetGlobalVolumes -* Other new function - BASS_SampleStop -* New synchronizer - BASS_SYNC_END -* New sample overrider - BASS_SAMPLE_OVER_DIST -* LoadLibrary/GetProcAddress instructions and example - -0.5 - 4/7/1999 --------------- -* Documentation! -* File streaming (MP3 and WAV) - BASS_StreamCreateFile -* Custom generated samples - BASS_SampleCreate - BASS_SampleCreateDone -* Other new function - BASS_MusicSetPositionScaler -* Renamed function - BASS_ChannelClearSync -> BASS_ChannelRemoveSync -* Alterations made to - BASS_ChannelGetPosition - BASS_SampleLoad - BASS_StreamPlay - -0.4 - 30/3/1999 ---------------- -* Compressed WAV samples support (using audio CODECs) -* Updated CD volume handling - now works with SB Live -* More linear channel volume/pan scales (were slightly off before) -* "no sound" device option -* 3D sound functions - BASS_Set3DFactors - BASS_Get3DFactors - BASS_Set3DPosition - BASS_Get3DPosition - BASS_Apply3D - BASS_SamplePlay3D - BASS_SamplePlay3DEx - BASS_ChannelSet3DAttributes - BASS_ChannelGet3DAttributes - BASS_ChannelSet3DPosition - BASS_ChannelGet3DPosition -* EAX functions - BASS_SetEAXParameters - BASS_GetEAXParameters - BASS_ChannelSetEAXMix - BASS_ChannelGetEAXMix -* Other new functions - BASS_GetDeviceDescription - BASS_SetBufferLen - BASS_ChannelGetFlags - BASS_ChannelPause - BASS_ChannelResume - BASS_ChannelSetPosition -* Replaced function - BASS_CDResume -> BASS_ChannelResume -* Alterations made to - BASS_Init - BASS_CDInit - BASS_SampleLoad - BASS_StreamPlay - BASS_INFO structure - BASS_SAMPLE structure - BASS_DEVICE_xxx flags - BASS_SAMPLE_xxx flags - -0.3 - 8/3/1999 --------------- -* Synchronization functions - BASS_ChannelSetSync - BASS_ChannelClearSync -* Other new functions - BASS_GetVersion - BASS_ChannelGetPosition - BASS_ChannelGetLevel - BASS_ChannelGetAttributes - BASS_ChannelSetAttributes -* Replaced functions - BASS_MusicStop -> BASS_ChannelStop - BASS_MusicSetVolume -> BASS_ChannelSetAttributes - BASS_CDStop -> BASS_ChannelStop - BASS_CDSetVolume -> BASS_ChannelSetAttributes - BASS_CDGetVolume -> BASS_ChannelGetAttributes - BASS_ChannelUpdate -> BASS_ChannelSetAttributes -* Alterations made to - BASS_MusicPlayEx - BASS_StreamPlay - BASS_INFO structure - -0.2 - 28/2/1999 ---------------- -* First public release - - -Credits -======= -Ogg Vorbis decoding is based on libogg/vorbis, -Copyright (c) 2002-2004 Xiph.org Foundation - -CHMOX is (c) 2004 Stphane Boisson, http://chmox.sourceforge.net/ - -API/Sample contributors ------------------------ -Visual Basic: Adam Hoult, Hendrik Knaepen, Arthur Aminov, - Peter Hebels -Delphi: Titus Miloi, Rogier Timmermans, Alessandro Cappellozza, - Jesse Naranjo, Chris Troesken, Evgeny Melnikov - - -Bug reports, Suggestions, Comments, Enquiries, etc... -===================================================== -If you have any of the aforementioned please visit the BASS forum at -the website. If you can't find an answer there, you can also email: - - bass@un4seen.com - diff --git a/src/lib/bass/delphi/bass-macosx.patch b/src/lib/bass/delphi/bass-macosx.patch deleted file mode 100644 index 92ac8086..00000000 --- a/src/lib/bass/delphi/bass-macosx.patch +++ /dev/null @@ -1,368 +0,0 @@ ---- D:/daten/bass.pas Sun Mar 23 18:58:56 2008 -+++ D:/daten/Projekte/UltraStarDX/Kopie von trunk/Game/Code/lib/bass/delphi/bass.pas Sat May 03 03:52:56 2008 -@@ -13,8 +13,20 @@ - - interface - -+{$IFDEF FPC} -+ {$PACKRECORDS C} -+{$ENDIF} -+ -+{$IFDEF MSWINDOWS} -+ {$DEFINE DLL_STDCALL} -+{$ELSE} -+ {$DEFINE DLL_CDECL} -+{$ENDIF} -+ -+{$IFDEF MSWINDOWS} - uses - Windows; -+{$ENDIF} - - const - BASSVERSION = $204; // API version -@@ -231,6 +243,7 @@ - BASS_3DALG_FULL = 2; - BASS_3DALG_LIGHT = 3; - -+{$IFDEF MSWINDOWS} - // EAX environments, use with BASS_SetEAXParameters - EAX_ENVIRONMENT_GENERIC = 0; - EAX_ENVIRONMENT_PADDEDCELL = 1; -@@ -260,6 +273,7 @@ - EAX_ENVIRONMENT_PSYCHOTIC = 25; - // total number of environments - EAX_ENVIRONMENT_COUNT = 26; -+{$ENDIF} - - BASS_STREAMPROC_END = $80000000; // end of user stream flag - -@@ -487,10 +501,10 @@ - end; - - // User file stream callback functions -- FILECLOSEPROC = procedure(user: Pointer); stdcall; -- FILELENPROC = function(user: Pointer): QWORD; stdcall; -- FILEREADPROC = function(buffer: Pointer; length: DWORD; user: Pointer): DWORD; stdcall; -- FILESEEKPROC = function(offset: QWORD; user: Pointer): BOOL; stdcall; -+ FILECLOSEPROC = procedure(user: Pointer); {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} -+ FILELENPROC = function(user: Pointer): QWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} -+ FILEREADPROC = function(buffer: Pointer; length: DWORD; user: Pointer): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} -+ FILESEEKPROC = function(offset: QWORD; user: Pointer): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} - - BASS_FILEPROCS = record - close: FILECLOSEPROC; -@@ -578,7 +592,7 @@ - end; - - // callback function types -- STREAMPROC = function(handle: HSTREAM; buffer: Pointer; length: DWORD; user: Pointer): DWORD; stdcall; -+ STREAMPROC = function(handle: HSTREAM; buffer: Pointer; length: DWORD; user: Pointer): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} - { - User stream callback function. NOTE: A stream function should obviously be as - quick as possible, other streams (and MOD musics) can't be mixed until -@@ -593,12 +607,12 @@ - - const - // special STREAMPROCs -- STREAMPROC_DUMMY : STREAMPROC = STREAMPROC(0); // "dummy" stream -- STREAMPROC_PUSH : STREAMPROC = STREAMPROC(-1); // push stream -+ STREAMPROC_DUMMY {: STREAMPROC} = Pointer(0); // "dummy" stream -+ STREAMPROC_PUSH {: STREAMPROC} = Pointer(-1); // push stream - - type - -- DOWNLOADPROC = procedure(buffer: Pointer; length: DWORD; user: Pointer); stdcall; -+ DOWNLOADPROC = procedure(buffer: Pointer; length: DWORD; user: Pointer); {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} - { - Internet stream download callback function. - buffer : Buffer containing the downloaded data... NULL=end of download -@@ -606,7 +620,7 @@ - user : The 'user' parameter value given when calling BASS_StreamCreateURL - } - -- SYNCPROC = procedure(handle: HSYNC; channel, data: DWORD; user: Pointer); stdcall; -+ SYNCPROC = procedure(handle: HSYNC; channel, data: DWORD; user: Pointer); {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} - { - Sync callback function. NOTE: a sync callback function should be very - quick as other syncs cannot be processed until it has finished. If the -@@ -618,7 +632,7 @@ - user : The 'user' parameter given when calling BASS_ChannelSetSync - } - -- DSPPROC = procedure(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: Pointer); stdcall; -+ DSPPROC = procedure(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: Pointer); {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} - { - DSP callback function. NOTE: A DSP function should obviously be as quick - as possible... other DSP functions, streams and MOD musics can not be -@@ -630,7 +644,7 @@ - user : The 'user' parameter given when calling BASS_ChannelSetDSP - } - -- RECORDPROC = function(handle: HRECORD; buffer: Pointer; length: DWORD; user: Pointer): BOOL; stdcall; -+ RECORDPROC = function(handle: HRECORD; buffer: Pointer; length: DWORD; user: Pointer): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} - { - Recording callback function. - handle : The recording handle -@@ -643,116 +657,130 @@ - - // Functions - const -+{$IFDEF MSWINDOWS} - bassdll = 'bass.dll'; -- --function BASS_SetConfig(option, value: DWORD): BOOL; stdcall; external bassdll; --function BASS_GetConfig(option: DWORD): DWORD; stdcall; external bassdll; --function BASS_SetConfigPtr(option: DWORD; value: Pointer): BOOL; stdcall; external bassdll; --function BASS_GetConfigPtr(option: DWORD): Pointer; stdcall; external bassdll; --function BASS_GetVersion: DWORD; stdcall; external bassdll; --function BASS_ErrorGetCode: Integer; stdcall; external bassdll; --function BASS_GetDeviceInfo(device: DWORD; var info: BASS_DEVICEINFO): BOOL; stdcall; external bassdll; --function BASS_Init(device: Integer; freq, flags: DWORD; win: HWND; clsid: PGUID): BOOL; stdcall; external bassdll; --function BASS_SetDevice(device: DWORD): BOOL; stdcall; external bassdll; --function BASS_GetDevice: DWORD; stdcall; external bassdll; --function BASS_Free: BOOL; stdcall; external bassdll; --function BASS_GetDSoundObject(obj: DWORD): Pointer; stdcall; external bassdll; --function BASS_GetInfo(var info: BASS_INFO): BOOL; stdcall; external bassdll; --function BASS_Update(length: DWORD): BOOL; stdcall; external bassdll; --function BASS_GetCPU: FLOAT; stdcall; external bassdll; --function BASS_Start: BOOL; stdcall; external bassdll; --function BASS_Stop: BOOL; stdcall; external bassdll; --function BASS_Pause: BOOL; stdcall; external bassdll; --function BASS_SetVolume(volume: FLOAT): BOOL; stdcall; external bassdll; --function BASS_GetVolume: FLOAT; stdcall; external bassdll; -- --function BASS_PluginLoad(filename: PChar; flags: DWORD): HPLUGIN; stdcall; external bassdll; --function BASS_PluginFree(handle: HPLUGIN): BOOL; stdcall; external bassdll; --function BASS_PluginGetInfo(handle: HPLUGIN): PBASS_PLUGININFO; stdcall; external bassdll; -- --function BASS_Set3DFactors(distf, rollf, doppf: FLOAT): BOOL; stdcall; external bassdll; --function BASS_Get3DFactors(var distf, rollf, doppf: FLOAT): BOOL; stdcall; external bassdll; --function BASS_Set3DPosition(var pos, vel, front, top: BASS_3DVECTOR): BOOL; stdcall; external bassdll; --function BASS_Get3DPosition(var pos, vel, front, top: BASS_3DVECTOR): BOOL; stdcall; external bassdll; --procedure BASS_Apply3D; stdcall; external bassdll; --function BASS_SetEAXParameters(env: Integer; vol, decay, damp: FLOAT): BOOL; stdcall; external bassdll; --function BASS_GetEAXParameters(var env: DWORD; var vol, decay, damp: FLOAT): BOOL; stdcall; external bassdll; -- --function BASS_MusicLoad(mem: BOOL; f: Pointer; offset: QWORD; length, flags, freq: DWORD): HMUSIC; stdcall; external bassdll; --function BASS_MusicFree(handle: HMUSIC): BOOL; stdcall; external bassdll; -- --function BASS_SampleLoad(mem: BOOL; f: Pointer; offset: QWORD; length, max, flags: DWORD): HSAMPLE; stdcall; external bassdll; --function BASS_SampleCreate(length, freq, chans, max, flags: DWORD): HSAMPLE; stdcall; external bassdll; --function BASS_SampleFree(handle: HSAMPLE): BOOL; stdcall; external bassdll; --function BASS_SampleSetData(handle: HSAMPLE; buffer: Pointer): BOOL; stdcall; external bassdll; --function BASS_SampleGetData(handle: HSAMPLE; buffer: Pointer): BOOL; stdcall; external bassdll; --function BASS_SampleGetInfo(handle: HSAMPLE; var info: BASS_SAMPLE): BOOL; stdcall; external bassdll; --function BASS_SampleSetInfo(handle: HSAMPLE; var info: BASS_SAMPLE): BOOL; stdcall; external bassdll; --function BASS_SampleGetChannel(handle: HSAMPLE; onlynew: BOOL): HCHANNEL; stdcall; external bassdll; --function BASS_SampleGetChannels(handle: HSAMPLE; channels: Pointer): DWORD; stdcall; external bassdll; --function BASS_SampleStop(handle: HSAMPLE): BOOL; stdcall; external bassdll; -- --function BASS_StreamCreate(freq, chans, flags: DWORD; proc: STREAMPROC; user: Pointer): HSTREAM; stdcall; external bassdll; --function BASS_StreamCreateFile(mem: BOOL; f: Pointer; offset, length: QWORD; flags: DWORD): HSTREAM; stdcall; external bassdll; --function BASS_StreamCreateURL(url: PChar; offset: DWORD; flags: DWORD; proc: DOWNLOADPROC; user: Pointer):HSTREAM; stdcall; external bassdll; --function BASS_StreamCreateFileUser(system, flags: DWORD; var procs: BASS_FILEPROCS; user: Pointer): HSTREAM; stdcall; external bassdll; --function BASS_StreamFree(handle: HSTREAM): BOOL; stdcall; external bassdll; --function BASS_StreamGetFilePosition(handle: HSTREAM; mode: DWORD): QWORD; stdcall; external bassdll; --function BASS_StreamPutData(handle: HSTREAM; buffer: Pointer; length: DWORD): DWORD; stdcall; external bassdll; --function BASS_StreamPutFileData(handle: HSTREAM; buffer: Pointer; length: DWORD): DWORD; stdcall; external bassdll; -- --function BASS_RecordGetDeviceInfo(device: DWORD; var info: BASS_DEVICEINFO): BOOL; stdcall; external bassdll; --function BASS_RecordInit(device: Integer):BOOL; stdcall; external bassdll; --function BASS_RecordSetDevice(device: DWORD): BOOL; stdcall; external bassdll; --function BASS_RecordGetDevice: DWORD; stdcall; external bassdll; --function BASS_RecordFree: BOOL; stdcall; external bassdll; --function BASS_RecordGetInfo(var info: BASS_RECORDINFO): BOOL; stdcall; external bassdll; --function BASS_RecordGetInputName(input: Integer): PChar; stdcall; external bassdll; --function BASS_RecordSetInput(input: Integer; flags: DWORD; volume: FLOAT): BOOL; stdcall; external bassdll; --function BASS_RecordGetInput(input: Integer; var volume: FLOAT): DWORD; stdcall; external bassdll; --function BASS_RecordStart(freq, chans, flags: DWORD; proc: RECORDPROC; user: Pointer): HRECORD; stdcall; external bassdll; -- --function BASS_ChannelBytes2Seconds(handle: DWORD; pos: QWORD): Double; stdcall;external bassdll; --function BASS_ChannelSeconds2Bytes(handle: DWORD; pos: Double): QWORD; stdcall;external bassdll; --function BASS_ChannelGetDevice(handle: DWORD): DWORD; stdcall; external bassdll; --function BASS_ChannelSetDevice(handle, device: DWORD): BOOL; stdcall; external bassdll; --function BASS_ChannelIsActive(handle: DWORD): DWORD; stdcall;external bassdll; --function BASS_ChannelGetInfo(handle: DWORD; var info: BASS_CHANNELINFO):BOOL;stdcall;external bassdll; --function BASS_ChannelGetTags(handle: HSTREAM; tags: DWORD): PChar; stdcall; external bassdll; --function BASS_ChannelFlags(handle, flags, mask: DWORD): DWORD; stdcall; external bassdll; --function BASS_ChannelUpdate(handle, length: DWORD): BOOL; stdcall; external bassdll; --function BASS_ChannelLock(handle: DWORD; lock: BOOL): BOOL; stdcall; external bassdll; --function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL; stdcall; external bassdll; --function BASS_ChannelStop(handle: DWORD): BOOL; stdcall; external bassdll; --function BASS_ChannelPause(handle: DWORD): BOOL; stdcall; external bassdll; --function BASS_ChannelSetAttribute(handle, attrib: DWORD; value: FLOAT): BOOL; stdcall; external bassdll; --function BASS_ChannelGetAttribute(handle, attrib: DWORD; var value: FLOAT): BOOL; stdcall; external bassdll; --function BASS_ChannelSlideAttribute(handle, attrib: DWORD; value: FLOAT; time: DWORD): BOOL; stdcall; external bassdll; --function BASS_ChannelIsSliding(handle, attrib: DWORD): BOOL; stdcall;external bassdll; --function BASS_ChannelSet3DAttributes(handle: DWORD; mode: Integer; min, max: FLOAT; iangle, oangle, outvol: Integer): BOOL; stdcall; external bassdll; --function BASS_ChannelGet3DAttributes(handle: DWORD; var mode: DWORD; var min, max: FLOAT; var iangle, oangle, outvol: DWORD): BOOL; stdcall; external bassdll; --function BASS_ChannelSet3DPosition(handle: DWORD; var pos, orient, vel: BASS_3DVECTOR): BOOL; stdcall; external bassdll; --function BASS_ChannelGet3DPosition(handle: DWORD; var pos, orient, vel: BASS_3DVECTOR): BOOL; stdcall; external bassdll; --function BASS_ChannelGetLength(handle, mode: DWORD): QWORD; stdcall; external bassdll; --function BASS_ChannelSetPosition(handle: DWORD; pos: QWORD; mode: DWORD): BOOL; stdcall; external bassdll; --function BASS_ChannelGetPosition(handle, mode: DWORD): QWORD; stdcall; external bassdll; --function BASS_ChannelGetLevel(handle: DWORD): DWORD; stdcall; external bassdll; --function BASS_ChannelGetData(handle: DWORD; buffer: Pointer; length: DWORD): DWORD; stdcall; external bassdll; --function BASS_ChannelSetSync(handle: DWORD; type_: DWORD; param: QWORD; proc: SYNCPROC; user: Pointer): HSYNC; stdcall; external bassdll; --function BASS_ChannelRemoveSync(handle: DWORD; sync: HSYNC): BOOL; stdcall; external bassdll; --function BASS_ChannelSetDSP(handle: DWORD; proc: DSPPROC; user: Pointer; priority: Integer): HDSP; stdcall; external bassdll; --function BASS_ChannelRemoveDSP(handle: DWORD; dsp: HDSP): BOOL; stdcall; external bassdll; --function BASS_ChannelSetLink(handle, chan: DWORD): BOOL; stdcall; external bassdll; --function BASS_ChannelRemoveLink(handle, chan: DWORD): BOOL; stdcall; external bassdll; --function BASS_ChannelSetFX(handle, type_: DWORD; priority: Integer): HFX; stdcall; external bassdll; --function BASS_ChannelRemoveFX(handle: DWORD; fx: HFX): BOOL; stdcall; external bassdll; -- --function BASS_FXSetParameters(handle: HFX; par: Pointer): BOOL; stdcall; external bassdll; --function BASS_FXGetParameters(handle: HFX; par: Pointer): BOOL; stdcall; external bassdll; --function BASS_FXReset(handle: HFX): BOOL; stdcall; external bassdll; -+{$ENDIF} -+{$IFDEF DARWIN} -+ bassdll = 'libbass.dylib'; -+{$ENDIF} -+ -+function BASS_SetConfig(option, value: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_GetConfig(option: DWORD): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SetConfigPtr(option: DWORD; value: Pointer): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_GetConfigPtr(option: DWORD): Pointer; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_GetVersion: DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ErrorGetCode: Integer; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_GetDeviceInfo(device: DWORD; var info: BASS_DEVICEINFO): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+{$IFDEF MSWINDOWS} -+function BASS_Init(device: Integer; freq, flags: DWORD; win: HWND; clsid: PGUID): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+{$ELSE} -+function BASS_Init(device: Integer; freq, flags: DWORD; win: Pointer; clsid: Pointer): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+{$ENDIF} -+function BASS_SetDevice(device: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_GetDevice: DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_Free: BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+{$IFDEF MSWINDOWS} -+function BASS_GetDSoundObject(obj: DWORD): Pointer; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+{$ENDIF} -+function BASS_GetInfo(var info: BASS_INFO): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_Update(length: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_GetCPU: FLOAT; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_Start: BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_Stop: BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_Pause: BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SetVolume(volume: FLOAT): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_GetVolume: FLOAT; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+ -+function BASS_PluginLoad(filename: PChar; flags: DWORD): HPLUGIN; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_PluginFree(handle: HPLUGIN): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_PluginGetInfo(handle: HPLUGIN): PBASS_PLUGININFO; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+ -+function BASS_Set3DFactors(distf, rollf, doppf: FLOAT): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_Get3DFactors(var distf, rollf, doppf: FLOAT): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_Set3DPosition(var pos, vel, front, top: BASS_3DVECTOR): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_Get3DPosition(var pos, vel, front, top: BASS_3DVECTOR): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+procedure BASS_Apply3D; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+{$IFDEF MSWINDOWS} -+function BASS_SetEAXParameters(env: Integer; vol, decay, damp: FLOAT): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_GetEAXParameters(var env: DWORD; var vol, decay, damp: FLOAT): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+{$ENDIF} -+ -+function BASS_MusicLoad(mem: BOOL; f: Pointer; offset: QWORD; length, flags, freq: DWORD): HMUSIC; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_MusicFree(handle: HMUSIC): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+ -+function BASS_SampleLoad(mem: BOOL; f: Pointer; offset: QWORD; length, max, flags: DWORD): HSAMPLE; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SampleCreate(length, freq, chans, max, flags: DWORD): HSAMPLE; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SampleFree(handle: HSAMPLE): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SampleSetData(handle: HSAMPLE; buffer: Pointer): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SampleGetData(handle: HSAMPLE; buffer: Pointer): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SampleGetInfo(handle: HSAMPLE; var info: BASS_SAMPLE): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SampleSetInfo(handle: HSAMPLE; var info: BASS_SAMPLE): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SampleGetChannel(handle: HSAMPLE; onlynew: BOOL): HCHANNEL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SampleGetChannels(handle: HSAMPLE; channels: Pointer): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_SampleStop(handle: HSAMPLE): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+ -+function BASS_StreamCreate(freq, chans, flags: DWORD; proc: STREAMPROC; user: Pointer): HSTREAM; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_StreamCreateFile(mem: BOOL; f: Pointer; offset, length: QWORD; flags: DWORD): HSTREAM; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_StreamCreateURL(url: PChar; offset: DWORD; flags: DWORD; proc: DOWNLOADPROC; user: Pointer):HSTREAM; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_StreamCreateFileUser(system, flags: DWORD; var procs: BASS_FILEPROCS; user: Pointer): HSTREAM; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_StreamFree(handle: HSTREAM): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_StreamGetFilePosition(handle: HSTREAM; mode: DWORD): QWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_StreamPutData(handle: HSTREAM; buffer: Pointer; length: DWORD): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_StreamPutFileData(handle: HSTREAM; buffer: Pointer; length: DWORD): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+ -+function BASS_RecordGetDeviceInfo(device: DWORD; var info: BASS_DEVICEINFO): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_RecordInit(device: Integer):BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_RecordSetDevice(device: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_RecordGetDevice: DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_RecordFree: BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_RecordGetInfo(var info: BASS_RECORDINFO): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_RecordGetInputName(input: Integer): PChar; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_RecordSetInput(input: Integer; flags: DWORD; volume: FLOAT): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_RecordGetInput(input: Integer; var volume: FLOAT): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_RecordStart(freq, chans, flags: DWORD; proc: RECORDPROC; user: Pointer): HRECORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+ -+function BASS_ChannelBytes2Seconds(handle: DWORD; pos: QWORD): Double; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF}external bassdll; -+function BASS_ChannelSeconds2Bytes(handle: DWORD; pos: Double): QWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF}external bassdll; -+function BASS_ChannelGetDevice(handle: DWORD): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelSetDevice(handle, device: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelIsActive(handle: DWORD): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF}external bassdll; -+function BASS_ChannelGetInfo(handle: DWORD; var info: BASS_CHANNELINFO):BOOL;{$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF}external bassdll; -+function BASS_ChannelGetTags(handle: HSTREAM; tags: DWORD): PChar; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelFlags(handle, flags, mask: DWORD): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelUpdate(handle, length: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelLock(handle: DWORD; lock: BOOL): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelStop(handle: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelPause(handle: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelSetAttribute(handle, attrib: DWORD; value: FLOAT): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelGetAttribute(handle, attrib: DWORD; var value: FLOAT): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelSlideAttribute(handle, attrib: DWORD; value: FLOAT; time: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelIsSliding(handle, attrib: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF}external bassdll; -+function BASS_ChannelSet3DAttributes(handle: DWORD; mode: Integer; min, max: FLOAT; iangle, oangle, outvol: Integer): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelGet3DAttributes(handle: DWORD; var mode: DWORD; var min, max: FLOAT; var iangle, oangle, outvol: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelSet3DPosition(handle: DWORD; var pos, orient, vel: BASS_3DVECTOR): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelGet3DPosition(handle: DWORD; var pos, orient, vel: BASS_3DVECTOR): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelGetLength(handle, mode: DWORD): QWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelSetPosition(handle: DWORD; pos: QWORD; mode: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelGetPosition(handle, mode: DWORD): QWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelGetLevel(handle: DWORD): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelGetData(handle: DWORD; buffer: Pointer; length: DWORD): DWORD; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelSetSync(handle: DWORD; type_: DWORD; param: QWORD; proc: SYNCPROC; user: Pointer): HSYNC; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelRemoveSync(handle: DWORD; sync: HSYNC): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelSetDSP(handle: DWORD; proc: DSPPROC; user: Pointer; priority: Integer): HDSP; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelRemoveDSP(handle: DWORD; dsp: HDSP): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelSetLink(handle, chan: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelRemoveLink(handle, chan: DWORD): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelSetFX(handle, type_: DWORD; priority: Integer): HFX; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_ChannelRemoveFX(handle: DWORD; fx: HFX): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+ -+function BASS_FXSetParameters(handle: HFX; par: Pointer): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_FXGetParameters(handle: HFX; par: Pointer): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; -+function BASS_FXReset(handle: HFX): BOOL; {$IFDEF DLL_STDCALL}stdcall;{$ENDIF}{$IFDEF DLL_CDECL}cdecl;{$ENDIF} external bassdll; - - - function BASS_SPEAKER_N(n: DWORD): DWORD; -+{$IFDEF MSWINDOWS} - function BASS_SetEAXPreset(env: Integer): BOOL; - { - This function is defined in the implementation part of this unit. -@@ -760,7 +788,7 @@ - to set the predefined EAX environments. - env : a EAX_ENVIRONMENT_xxx constant - } -- -+{$ENDIF} - - implementation - -@@ -769,6 +797,7 @@ - Result := n shl 24; - end; - -+{$IFDEF MSWINDOWS} - function BASS_SetEAXPreset(env: Integer): BOOL; - begin - case (env) of -@@ -828,6 +857,7 @@ - Result := FALSE; - end; - end; -+{$ENDIF} - - end. - // END OF FILE ///////////////////////////////////////////////////////////////// diff --git a/src/lib/bass_fx/bass_fx.chm b/src/lib/bass_fx/bass_fx.chm deleted file mode 100644 index fe5716a9..00000000 Binary files a/src/lib/bass_fx/bass_fx.chm and /dev/null differ diff --git a/src/lib/bass_fx/bass_fx.txt b/src/lib/bass_fx/bass_fx.txt deleted file mode 100644 index 54ef813b..00000000 --- a/src/lib/bass_fx/bass_fx.txt +++ /dev/null @@ -1,1301 +0,0 @@ -------------------------------------------------------------------------------- - (: -= BASS_FX v2.4.11.1 =- :) - -=================- - Copyright (c) 2002-2014 JOBnik! [Arthur Aminov, ISRAEL] - All rights reserved! -------------------------------------------------------------------------------- - -Donate -====== -If you like BASS_FX or use it in a commercial/shareware products, -then you may wish to make a donation to support its development (see the docs for info). - -Thank you! - - -Files that you should have found in the BASS_FX "package" -========================================================= -Win32 version -------------- -BASS_FX.TXT This file -BASS_FX.DLL The BASS_FX module -BASS_FX.CHM BASS_FX documentation -File_ID.Diz BBS description file - -x64\ - BASS_FX.DLL 64-bit BASS_FX module - -C\ C/C++ APIs and samples - BASS_FX.H BASS_FX C/C++ header file - BASS_FX.LIB BASS_FX import library - x64\ - BASS_FX.LIB 64-bit BASS_FX import library - SAFESEH\ - BASS_FX.LIB SAFESEH compatible BASS_FX import library - - bpm\ BPM example - bpm.c - bpm.h - bpm.rc - - dsp\ DSP example - dsp.c - dsp.h - dsp.rc - - freeverb\ Freeverb example - freeverb.c - freeverb.h - freeverb.rc - - reverse\ Reverse example - reverse.c - reverse.h - reverse.rc - - tempo\ Tempo example - tempo.c - tempo.h - tempo.rc - - bin\ Precompiled examples - bpm.exe - dsp.exe - reverse.exe - tempo.exe - -Delphi\ Delphi APIs and samples - BASS_FX.PAS BASS_FX Delphi APIs Unit - - BPM\ BPM example - bpm.dfm main form - bpm.pas main unit - prjBPM.dpr project file - - DSP\ DSP example - dsp.dfm - dsp.pas - prjDSP.dpr - - Reverse\ Reverse example - prjRev.dpr - Reverse.dfm - Reverse.pas - - Tempo\ Tempo example - prjTempo.dpr - tempo.dfm - tempo.pas - -VB\ Visual Basic APIs and samples - BASS_FX.BAS BASS_FX VB APIs Module - - BPM\ BPM example - frmBPM.frm main form - modBPM.bas module with some functions - prjBPM.vbp project file - - DSP\ DSP example - frmDSP.frm - prjDSP.vbp - - Reverse\ Reverse example - frmREVERSE.frm - prjREVERSE.vbp - - Tempo\ Tempo example - frmTempo.frm - prjTepmo.vbp - - -NOTE: To run the sample EXEs, first you'll have to copy BASS_FX.DLL into - the same directory as the EXEs. You'll also need BASS.DLL which can - be download from the BASS website. - -NOTE: To build the examples, you'll need to copy the BASS API into the - same directory as the BASS_FX API. - - -MacOSX version --------------- -BASS_FX.TXT This file -LIBBASS_FX.DYLIB The BASS_FX module -BASS_FX.CHM BASS_FX documentation -BASS_FX.H BASS_FX C/C++ header file -MAKEFILE Makefile for all examples -MAKEFILE.IN Makefile helper macros - -reverse\ Reverse example - reverse.c - makefile - reverse.nib - -tempo\ Tempo example - tempo.c - makefile - tempo.nib - - -NOTE: To view the documentation, you will need a CHM viewer, like CHMOX - which is included in the BASS package. - -NOTE: To build the examples, you'll need to copy the BASS API into the - same directory as the BASS_FX API. - - -What's the point? -================= -BASS_FX is an extension to the BASS audio library, providing a complete -set of Real-time DSP functions to start developing your own DJ software ;) -Developed to enable the simple and advanced developers/users to -have in their applications sound effects without knowing any DSP at all! - - -Requirements -============ -BASS 2.4 is required, the BASS_FX module will fail to load if it is not present. - -MacOSX version --------------- -OSX 10.3.9 or above is recommended. BASS_FX is compatible with both -PowerPC and Intel Macs. - - -Using BASS_FX -============= -Win32 version -------------- -To use BASS_FX with Borland C++ Builder, you'll first have to create a -Borland C++ Builder import library for it. This is done by using the -IMPLIB tool that comes with Borland C++ Builder. Simply execute this: - - IMPLIB BASS_FXBCB.LIB BASS_FX.DLL - -... and then use BASS_FXBCB.LIB in your projects to import BASS_FX. - -To use BASS_FX with LCC-Win32, you'll first have to create a compatible -import library for it. This is done by using the PEDUMP and BUILDLIB -tools that come with LCC-Win32. Run these 2 commands: - - PEDUMP /EXP BASS_FX.LIB > BASS_FXLCC.EXP - BUILDLIB BASS_FXLCC.EXP BASS_FXLCC.LIB - -... and then use BASS_FXLCC.LIB in your projects to import BASS_FX. - -TIP: The BASS_FX.CHM file should be put in the same directory as the BASS.CHM - file, so that the BASS_FX documentation can be accessed from within the - BASS documentation. - -MacOSX version --------------- -A separate "LIB" file is not required for OSX. Using XCode, you can simply -add the DYLIB file to the project. Or using a makefile, you can build your -programs like this, for example: - - gcc yoursource -L. -lbass -lbass_fx -o yourprog - -As with LIBBASS.DYLIB, the LIBBASS_FX.DYLIB file must be put in the same -directory as the executable (it can't just be somewhere in the path). See -the example makefiles. - -LIBBASS_FX.DYLIB is a universal binary, with support for both PowerPC and -Intel Macs. If you want PowerPC-only or Intel-only versions, the included -makefile can create them for you, by typing "make ppc" or "make i386". - - -Latest Version -============== -The latest versions of BASS_FX & BASS can be found at these websites: - - http://www.un4seen.com (the home of BASS) - http://www.jobnik.org - - -Copyright, Disclaimer, and all that other jazz -============================================== -The BASS_FX library is free, so if anyone tries to charge you -for it, kick 'em where it hurts. - -This software is provided "as is", without warranty of ANY KIND, -either expressed or implied, including but not limited to the -implied warranties of merchantability and/or fitness for a -particular purpose. The author shall NOT be held liable for -ANY damage to you, your computer, or to anyone or anything else, -that may result from its use, or misuse. Basically, you use it -at YOUR OWN RISK. - -Usage of BASS_FX indicates that you agree to the above conditions. - -You may freely distribute the BASS_FX package as long as NO FEE is -charged and all the files remain INTACT AND UNMODIFIED. - -All trademarks and other registered names contained in the BASS_FX -package are the property of their respective owners. - - -History -======= -These are the major (and not so major) changes at each version -stage. There are ofcourse bug fixes and other little improvements -made along the way too! To make upgrading simpler, all functions -affected by a change to the BASS_FX interface are listed. - -2.4.11.1 - 24/12/2014 ---------------------- -* BASS_FX: - * Added support for BASS 2.4.11, BASS_DATA_FIXED flag is used in Android, WinCE and Linux ARM platforms. - * Documentation is updated. - * iOS, added "x86_64" simulator architecture. - -* Tempo: - * Fixed "Segmentation fault" on x64 Linux system. - -* DSP: - * Android, fixed "BASS_FX_BFX_ECHO4" effect as reported in this thread: - http://www.un4seen.com/forum/?topic=13225.msg112373#msg112373 - -2.4.11 - 02/09/2014 -------------------- -* BASS_FX: - * Fixed an issue on OSX (The Xcode project's "Installation Directory" setting set to "@loader_path" instead of "@executable_path"). - * Tempo/Reverse fixed a thread-safety crash. - * Tempo/Reverse added CTYPE info for these streams. - * Android, added "x86" architecture support (some effects are buggy, will be fixed soon). - * iOS, added "arm64" architecture support. - * Fixed Delphi/Pascal unit by changing "FLOAT" to "Single". - * Added C/C++ "freeverb" example. - -* Tempo: - * Updated to latest SoundTouch library version 1.8.0 - * Fixed a crash when using syncs on tempo, as described in this thread: http://www.un4seen.com/forum/?topic=15708.0 - * Added 3 interpolation algorithms to set using BASS_FX_TEMPO_ALGO_XXX flags (BASS_FX_TempoCreate): - * BASS_FX_TEMPO_ALGO_LINEAR - * BASS_FX_TEMPO_ALGO_CUBIC (default) - * BASS_FX_TEMPO_ALGO_SHANNON - -* DSP: - * Fixed a bug in BASS_FX_BFX_VOLUME_ENV effect with the "bFollow" option on mobile devices, - as described in this thread http://www.un4seen.com/forum/?topic=15866 - * Added new effects: - * BASS_FX_BFX_PITCHSHIFT, that uses FFT for its pitch shifting while maintaining duration. - * BASS_FX_BFX_FREEVERB, a reverb effect. - -2.4.10.1 - 05/06/2013 ---------------------- -* BPM/Beat: - * Fixed a crash when not using BPMPROGRESSPROC callback - * Added a check for BPMPROC/BPMBEATPROC callbacks, if not available, returns BASS_ERROR_ILLPARAM error code - -2.4.10 - 02/06/2013 -------------------- -* BASS_FX: - * Please see DSP and BPM sections for decprecated effects/functions. - To not break compatibility with BASS 2.4 version, these effects and functions will still remain in BASS_FX, - but are removed from documentations and will be totally removed from BASS_FX in the future. - * BASS_ERROR_FX_NODECODE error code *removed*, will return BASS_ERROR_DECODE instead (Tempo/Reverse/BPM/Beat) - * BASS_ERROR_FX_BPMINUSE error code *removed*, will return BASS_ERROR_ALREADY instead (BPM/Beat) - * Tempo and BPM functions updated to latest SoundTouch library version 1.7.1 - * Added BASS_BFX_Linear2dB and BASS_BFX_dB2Linear macros to headers, for convenience. - -* Tempo: - * Multi-channel support is added, but: - * No SSE optimizations - * BASS_ATTRIB_TEMPO_OPTION_USE_AA_FILTER is by default set to FALSE on iOS, Android, WinCE and Linux ARM platforms for lower CPU usage - * Not part of SoundTouch library, sources will be sent to Olli Parviainen after BASS_FX release - * Sound quality improvements - * Improved output sound stream duration to match better with ideal duration - * Fixed BASS_ERROR_UNKNOWN issue with Windows 8 x64, posted in this thread: - http://www.un4seen.com/forum/?topic=14499.0 - -* BPM: - * BASS_FX_BPM_Translate and all of its options, BASS_FX_BPM_TRAN_xxx, are *deprecated* - * BPMPROCESSPROC *renamed* to BPMPROGRESSPROC - * BPM example is updated to fit above changes - * Tuned detection algorithm - * Fixed detection bug in Android, WinCE & Linux ARM platforms, for returning odd values - * Fixed percents bug in BPMPROGRESSPROC - * Changed default min/max BPM window to SoundTouch's 29/200 - -* Beat: - * Fixed regression since version 2.4.8 in BASS_FX_BPM_BeatDecodeGet function, - that would free a "chan" when detection is completed, as described in this thread: - http://www.un4seen.com/forum/?topic=2181.msg102805#msg102805 - -* DSP: - * Ported all effects to Android, WinCE & Linux ARM platforms - - * BASS_FX_BFX_ROTATE: - added new structure "BASS_BFX_ROTATE" with params: - "fRate" - set the rotation rate/speed in Hz between channels - "lChannel" - multi-channel support, only for even number of channels - - * BASS_FX_BFX_ECHO4: - added new effect and structure "BASS_BFX_ECHO4" with params: - "fDryMix" - unaffected signal mix - "fWetMix" - affected signal mix - "fFeedback" - output signal to feed back into input - "fDelay" - delay seconds - "bStereo" - even channels are echoed to each other if enabled - "lChannel" - multi-channel support - - * BASS_FX_BFX_ECHO - *deprecated*, use BASS_FX_BFX_ECHO4 - * BASS_FX_BFX_ECHO2 - *deprecated*, use BASS_FX_BFX_ECHO4 - * BASS_FX_BFX_ECHO3 - *deprecated*, use BASS_FX_BFX_ECHO4 - * BASS_FX_BFX_REVERB - *deprecated*, use BASS_FX_BFX_ECHO4 with fFeedback enabled - * BASS_FX_BFX_FLANGER - *deprecated*, use BASS_FX_BFX_CHORUS - * BASS_FX_BFX_COMPRESSOR - *deprecated*, use BASS_FX_BFX_COMPRESSOR2 - * BASS_FX_BFX_APF - *deprecated*, use BASS_FX_BFX_BQF with BASS_BFX_BQF_ALLPASS filter - * BASS_FX_BFX_LPF - *deprecated*, use 2x BASS_FX_BFX_BQF with BASS_BFX_BQF_LOWPASS filter and appropriate fQ values - -2.4.9 - 16/01/2013 ------------------- -* BASS_FX: - * WinCE version introduced (package bass_fx24-ce.zip) currently doesn't include most BASS_FX_BFX_xxx effects. - * Linux ARM version introduced (package bass_fx24-linux-arm.zip) currently doesn't include most BASS_FX_BFX_xxx effects. - -* DSP: - * Added more effects to Android, WinCE & Linux ARM ports: - BASS_FX_BFX_PEAKEQ - BASS_FX_BFX_MIX - BASS_FX_BFX_VOLUME_ENV - -* Tempo and Reverse: - * According to this request: http://www.un4seen.com/forum/?topic=13910 - Added support for DECODETO option. - -* Tempo: - * iOS, WinCE & Linux ARM: Enabled the BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO option on tempo - streams by default for lower CPU usage. See docs on how to disable it. - -* iOS: Added armv7s architecture support. - -2.4.8 - 31/07/2012 ------------------- -* BASS_FX: - * Android version introduced (package bass_fx24-android.zip) - currently doesn't include most BASS_FX_BFX_xxx effects. - * Delphi/Pascal unit: changed "user" param from "DWORD" to "Pointer" - -* BPM: - * Added "user" param to BASS_FX_BPM_DecodeGet and BPMPROCESSPROC (you have to recompile your project). - * BPM example is updated to fit above changes. - * According to this request: http://www.un4seen.com/forum/?topic=13319 - Added support for BPM detection from the current position with BASS_FX_BPM_DecodeGet (startSec<0). - -* Beat: - * Couple of little fixes in beat detection. - -* Tempo: - * Android: Enabled the BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO option on tempo - streams by default for lower CPU usage. See docs on how to disable it. - -2.4.7.1 - 01/07/2011 --------------------- -* BASS_FX: - * Documentation updated. - -* DSP: - * Fixed a small issue in BASS_FXGetParameters for BASS_FX_BFX_VOLUME effect, as it would change the lChannel value - when the global volume (lChannel=0) is requested. - -* OSX: - * x86_64 architecture support - -2.4.7 - 07/04/2011 ------------------- -* BASS_FX: - * Delphi unit updated: BASS_BFX_ENV_NODE = record, changed to BASS_BFX_ENV_NODE = packed record - -* DSP: - * Fixed bug in BASS_FX_BFX_VOLUME_ENV, being applied slightly early when "bFollow" is enabled. - * BASS_FX_BFX_DAMP made effect parameter setting a bit more convenient. If fGain < 0 then leave the current value. - -* iOS: - * Added armv7 architecture support. - * Combined the Device armv6/7 architectures and Simulator libraries into a single file. - -2.4.6 - 27/07/2010 ------------------- -* BASS_FX: - * Tempo and BPM updated to SoundTouch 1.5.1pre - * iPhone version introduced (package bass_fx24-iphone.zip) - NOTE: Since iPhone supports only static libraries, it isn't possible for static libraries to declare their dependencies, - so that needs to be done in the app's project instead, eg. by adding "-lstdc++" in the "Other Linker Flags". -* Tempo: - * Updated automatic parameter adjustment logic to reduce tone wobbling at large tempo changes. - * Retired 3DNow! optimization support as 3DNow! is nowadays obsolete and assembler code is nuisance to maintain. - -* BPM: - * Improved BPM detection. - * Added automatic cutoff threshold adaptation to beat detection routine to better adapt BPM calculation to different types of music. - * Fixed bug in BPMPROCESSPROC percents, when endSec is greater than stream's length. - -* Reverse: - * Fixed bug with getting the position when using a large output buffer (BASS_CONFIG_BUFFER). - * Fixed bug in BASS_ChannelGetPosition, could return an incorrect position. - -2.4.5 - 18/12/2009 ------------------- -* DSP: Added new effect, BiQuad filters, BASS_FX_BFX_BQF with filter types: - BASS_BFX_BQF_LOWPASS - BASS_BFX_BQF_HIGHPASS - BASS_BFX_BQF_BANDPASS - BASS_BFX_BQF_BANDPASS_Q - BASS_BFX_BQF_NOTCH - BASS_BFX_BQF_ALLPASS - BASS_BFX_BQF_PEAKINGEQ - BASS_BFX_BQF_LOWSHELF - BASS_BFX_BQF_HIGHSHELF - -* Tempo: - * Tempo processing bypassed when tempo/pitch set to 0 - * Couple of improvements: - * Added normalization to correlation calculation - * Heuristic that weights center of the processing window - -2.4.4.1 - 29/04/2009 --------------------- -* Tempo: Fixed a bug that could cause a stream to end slightly early. - -2.4.4 - 28/03/2009 ------------------- -* BASS_FX: - * Added: Linux x64 build in bass_fx24-linux.zip package. - -* Tempo: - * Updated to most latest SoundTouch library 1.4.1 - * Improved sound quality by automatic calculation of time stretch algorithm processing - parameters according to tempo setting. - * Added new BASS_ATTRIB_TEMPO_OPTION_PREVENT_CLICK, to prevent click when - samplerate/pitch crosses the default value during processing. - Default is FALSE as this involves slight sound quality compromise. - -* BPM/Beat: - * Fixed a small bug of internally called SETPOS sync. - -2.4.3.1 - 07/01/2009 --------------------- -* BASS_FX: Delphi/Pascal unit updated to handle both Windows and Linux -* Tempo: Fixed a small bug in processing with BASS_SAMPLE_LOOP flag - -2.4.3 - 24/12/2008 ------------------- -* BASS_FX: - * Mixtime POS syncs are now triggered when the specified position is - rendered in the tempo/reverse stream (rather than when it is decoded from the source). - * Linux version introduced (package bass_fx24-linux.zip) // examples will follow - -* Tempo: - * Corrected BASS_ATTRIB_TEMPO_FREQ min/max values. - -* DSP: - * Added new volume effect: BASS_FX_BFX_VOLUME_ENV, a volume effect using an envelope. - * BASS_FX_BFX_APF, BASS_FX_BFX_ECHO2, BASS_FX_BFX_ECHO3: fDelay 6 seconds limit removed. - -* BPM: - * Improved the peak detection algorithm so that it wouldn't incorrectly report too slow - harmonic beats if they are close to the true base beat. - -2.4.2 - 16/08/2008 ------------------- -* BASS_FX: - * Some processing functions optimized for speed. - -* DSP: - * Added new compressor effect BASS_FX_BFX_COMPRESSOR2 - For compatibility issues new compressor will replace old one in version 2.5 - -2.4.1 - 28/06/2008 ------------------- -* Tempo: - * Fixed a bug in BASS_ChannelGetPosition, that would return a - lower position than it should with a decoding tempo stream. - -* BPM: - * Multi-channel support. - * Fixed a bug in BASS_FX_BPM_DecodeGet, that would return 0 if using - the same handle and endSec for both Callback and Decode BPM. - -2.4.0.2 - 17/04/2008 --------------------- -* BPM: fixed another bug in BPMPROC -* Tempo: fixed a bug not allowing changing BASS_ATTRIB_TEMPO_OPTION_xxx - -2.4.0.1 - 06/04/2008 --------------------- -* BPM: fixed a bug in BPMPROC - -2.4 - 02/04/2008 ----------------- -* BASS_FX: - * Updated to BASS 2.4 - * More integrated with BASS plug-in system. - * Added a function BASS_FX_GetVersion - * BASS_FX_CONFIG_DSP_RESET *removed* - * Error codes and names changed - * To be able to link with BASS_FX, you'll have to call BASS_FX_GetVersion function - (or any other function from BASS_FX.DLL) or load it dynamically using LoadLibrary("bass_fx.dll") - * Win64 version introduced (package bass_fx24-x64.zip) - -* DSP: - * Effect names, structure names, flags and chain order are changed - e.g: BASS_FX_DSPFX_PHASER -> BASS_FX_BFX_PHASER - BASS_FX_DSPPHASER -> BASS_BFX_PHASER - * All functions integrated with BASS FX functions and the usage is the same - as with BASS DX8/DMO effects: - - BASS_FX_DSP_Set *removed* (use BASS_ChannelSetFX) - BASS_FX_DSP_SetParameters *removed* (use BASS_FXSetParameters) - BASS_FX_DSP_GetParameters *removed* (use BASS_FXGetParameters) - BASS_FX_DSP_Reset *removed* (use BASS_FXReset) - BASS_FX_DSP_Remove *removed* (use BASS_ChannelRemoveFX) - - * It is possible now to apply an effect more than once on the same channel. - * BASS_FX_BFX_SWAP *removed* (use BASS_FX_BFX_MIX) - * BASS_FX_BFX_S2M: - Updated to support multi-channel and renamed to BASS_FX_BFX_MIX - BASS_FX_BFX_MIX supports Swap, remap and mixing channels together. - * BASS_FX_BFX_PEAKEQ: - * fFreq param *removed* - (use 'oldcenter*freq/oldfreq' to update the fCenter after changing the Samplerate) - * Max fCenter updated from less than 1/3 to 1/2 of info.freq - * Take a look at DSP example to know how to increase the number of bands - - * BASS_FX_BFX_LPF: - * fFreq param *removed* (adjust fCutOffFreq param when needed) - -* Tempo: - * Support for all source sync types - * Funtions integrated with BASS attribute system (BASS_ChannelSet/GetAttribute): - BASS_FX_TempoSet *removed* - BASS_FX_TempoGet *removed* - BASS_FX_TempoSetOption *removed* - BASS_FX_TempoGetOption *removed* - - * Tempo attributes: - BASS_ATTRIB_TEMPO - BASS_ATTRIB_TEMPO_PITCH - BASS_ATTRIB_TEMPO_FREQ - - * Option attributes: - BASS_ATTRIB_TEMPO_OPTION_USE_AA_FILTER - BASS_ATTRIB_TEMPO_OPTION_AA_FILTER_LENGTH - BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO - BASS_ATTRIB_TEMPO_OPTION_SEQUENCE_MS - BASS_ATTRIB_TEMPO_OPTION_SEEKWINDOW_MS - BASS_ATTRIB_TEMPO_OPTION_OVERLAP_MS - -* Reverse: - * Support for all source sync types - * Funtions integrated with BASS attribute system (BASS_ChannelSet/GetAttribute): - BASS_FX_ReverseSetDirection *removed* - BASS_FX_ReverseGetDirection *removed* - - * Reverse attribute: - BASS_ATTRIB_REVERSE_DIR - -* BPM: - * Seconds changed from "float" to "double" - * Callback "user" parameters changed to pointers: BASS_FX_BPM_CallbackSet / BPMPROC - * Translation names changed: - BASS_FX_BPM_X2 -> BASS_FX_BPM_TRAN_X2 - BASS_FX_BPM_2FREQ -> BASS_FX_BPM_TRAN_2FREQ - BASS_FX_BPM_FREQ2 -> BASS_FX_BPM_TRAN_FREQ2 - BASS_FX_BPM_2PERCENT -> BASS_FX_BPM_TRAN_2PERCENT - BASS_FX_BPM_PERCENT2 -> BASS_FX_BPM_TRAN_PERCENT2 - -* Beat: - * Multi-channel support - * Seconds changed from "float" to "double" - * "cutofffreq" param renamed to "centerfreq" - * Callback "user" parameters changed to pointers: - BASS_FX_BPM_BeatCallbackSet / BPMBEATPROC - BASS_FX_BPM_BeatDecodeGet / BPMBEATPROC - -2.3.0.4 - 30/10/07 ------------------- -* DSP: - * Fixed: a bug in BASS_FX_DSPFX_DAMP to avoid trying to amplify silence data - * Fixed: a bug in BASS_FX_DSPFX_PEAKEQ to check illegal Center Frequencies (fCenter) - -* Tempo: - * Fixed: a bug that would prevent using a BASS_SYNC_MESSAGE sync - * Fixed: a bug that would prevent triggering a BASS_SYNC_END sync - -* Reverse: - * Fixed: a bug that would prevent using a BASS_SYNC_MESSAGE sync - -2.3.0.3 - 08/08/2007 --------------------- -* BASS_FX: - * Fixed: a DEP crashing bug. - * Added: a Config option, to reset DSPs, BPM/Beat Callbacks when position is set. - use BASS_FX_CONFIG_DSP_RESET with BASS_Set/GetConfig function. - -* DSP: - * Fixed: bugs in functions: - BASS_FX_DSP_Set and BASS_FX_DSP_Remove - - * Fixed: bugs in DSP effects: - BASS_FX_DSPFX_PEAKEQ - BASS_FX_DSPFX_ECHO - BASS_FX_DSPFX_ECHO2 - BASS_FX_DSPFX_REVERB - BASS_FX_DSPFX_VOLUME - BASS_FX_DSPFX_DAMP - - * Removed: DSPFX.TXT file, please check the docs for DSP effects/DSP Values - -* TEMPO: - * Fixed: a floating-point bug when calling BASS_FX_TempoCreate - * Fixed: POS SYNCs to be more accurate - -* BPM: - * Fixed: a bug in BASS_FX_BPM_Free and BASS_FX_BPM_BeatFree - that would sometimes release the source channnel as well - without using BASS_FX_FREESOURCE flag. - -* REVERSE: - * Fixed: a bug that, if you would set the direction to forward before starting playback, - the position would keep counting from the end. - * Updated: When reaching the end of the stream, changing the direction will now - reset the stream, so that it can be played again. - * Fixed: POS SYNCs to be more accurate - -2.3.0.2 - 09/04/2007 --------------------- -* BEAT: - * Added Beat position detection for decoded streams - BASS_FX_BPM_BeatDecodeGet - - * Added new functions: - BASS_FX_BPM_BeatCallbackReset - BASS_FX_BPM_BeatSetParameters - BASS_FX_BPM_BeatGetParameters - -* REVERSE: - * Multi-channel support - * Added new feature to change playing direction from Reverse to Forward and vice-versa - BASS_FX_ReverseSetDirection - BASS_FX_ReverseGetDirection - -* BPM: - * Fixed: one more critical bug in BPM functions - -* DSP: - * BASS_FX_DSPFX_PEAKEQ: - Improved effect and reduced CPU usage - Fixed: a bug, preventing using fQ if fBandwidth < 0.1f - Changed: fQ min limit to 0.1f - - * BASS_FX_DSPFX_ECHO3: - Fixed: a bug in BASS_FX_DSP_GetParameters, that would return a wrong lChannel value - - * Error code: BASS_FX_ERROR_STEREO *removed* (replaced with BASS_ERROR_FORMAT) - -* TEMPO: - * Setting functions name changed: - BASS_FX_TempoSettingSet -> BASS_FX_TempoSetOption - BASS_FX_TempoSettingGet -> BASS_FX_TempoGetOption - - BASS_FX_TEMPO_SETTING_xxx -> BASS_FX_TEMPO_OPTION_xxx - -2.3.0.1 - 08/06/2006 --------------------- -* New in BASS_FX: - * Added a valid parameters check for all functions. - -* BPM: - * A little improved Beat position trigger. - * Changing buffer content won't affect the BPM/Beat detection anymore. - * BASS_Stream/MusicFree will free the callback BPM/Beat as well. - -* BASS_FX.CHM: - * Added a very simple example to BPMBEATPROC callback, showing how to - count the BPM with just 2 beats. - -* DSP: - * Fixed small bugs in BASS_FX_DSPFX_VOLUME effect. - -2.3 - 21/05/2006 ----------------- -* New in BASS_FX: - * This version has some API changes. - * You'll have to recompile your application to use this version. - * ===== - If you like BASS_FX or use it in a commercial/shareware products, - then you may wish to make a donation to support its development (see the docs for info). - ===== - -* Tempo: - * Fixed a bug, that wouldn't clear buffers if a source channel isn't seekable. - * Removed flags: - BASS_FX_TEMPO_QUICKALGO - BASS_FX_TEMPO_NO_AAFILTER - - you can set these using a function below, in real-time. - - * Added 2 new functions: - BASS_FX_TempoSettingSet - BASS_FX_TempoSettingGet - - with options (check the docs for more info about using them): - BASS_FX_TEMPO_SETTING_USE_AA_FILTER - BASS_FX_TEMPO_SETTING_AA_FILTER_LENGTH - BASS_FX_TEMPO_SETTING_USE_QUICKALGO - BASS_FX_TEMPO_SETTING_SEQUENCE_MS - BASS_FX_TEMPO_SETTING_SEEKWINDOW_MS - BASS_FX_TEMPO_SETTING_OVERLAP_MS - -* DSP: - * Added new struct: - BASS_FX_DSPSWAP - - * Added multi-channel support and a per channel control with flags/macro: - each effect with a per channel control has a new "lChannel" param - (if you won't set the new param, then the effect will be affected on all channels as by default) - - BASS_FX_DSPFX_SWAP -> it's now possible not only swap, but remap as well. - BASS_FX_DSPFX_FLANGER - BASS_FX_DSPFX_VOLUME -> it's now needed to set a global volume, before boosting. - BASS_FX_DSPFX_PEAKEQ - BASS_FX_DSPFX_LPF - BASS_FX_DSPFX_DAMP - BASS_FX_DSPFX_AUTOWAH - BASS_FX_DSPFX_ECHO2 - BASS_FX_DSPFX_PHASER - BASS_FX_DSPFX_ECHO3 - BASS_FX_DSPFX_CHORUS - BASS_FX_DSPFX_APF - BASS_FX_DSPFX_COMPRESSOR - BASS_FX_DSPFX_DISTORTION - - - * Channel flags (check the docs for channels order): - BASS_FX_DSP_CHANALL - BASS_FX_DSP_CHANNONE - BASS_FX_DSP_CHAN1 .. BASS_FX_DSP_CHAN8 - - * If you have more than 8 channels (7.1), use this macro. - BASS_FX_DSP_CHANNEL_N(n) - - * Added a DENORMAL check for all effects. - * BASS_FX_DSP_Reset is updated for all effects. - -* BPM: - * Added Real-Time Beat Position Trigger: - BASS_FX_BPM_BeatCallbackSet - BASS_FX_BPM_BeatFree - - * BASS_FX_ERROR_BPMX2 error code *removed* and *replaced* with BASS_ERROR_ALREADY - * Fixed bugs: - * Serious memory-leak is fixed using both options. - * A bug that would free resources before the detecting process is finished. - * A bug that would still continue to detect previous data even if changing file to - scan, using a BASS_FX_BPM_BKGRND flag. - * A bug that would still return BPMs out of MIN/MAX range if using BASS_FX_BPM_MULT2 flag. - -2.2.0.1 - 30/11/2005 --------------------- -* New in BASS_FX: - * 8-bit support. - * Added more DSP effect information to BASS_FX.CHM - -* DSP: - * Automatically free DSP resources when freeing the channel. - * Multi-channel support started with: - * BASS_FX_DSPFX_ECHO2 - * BASS_FX_DSPFX_ECHO3 - + more effects will be updated soon! :) - * Some bugs fixed. - -* BPM: - * Fixed a bug that would return BPMs out of MIN/MAX range if - using BASS_FX_BPM_MULT2 flag. - -* MacOSX: - * Samples added. - -2.2 - 03/10/2005 ----------------- -* New in BASS_FX: - * Removed all DSP GPL code. - * BASS_FX is now fully useable in commercial software, as long as - credit is given. - * BASS_FX_GetVersion() *removed* (won't load if BASS 2.2 isn't present) - * BASS_FX_ERROR_MODLEN *removed* (replaced with BASS_ERROR_NOTAVAIL) - * BASS_FX_ERROR_16BIT *removed* (no 16-bit only effects are left) - * Multi_FX example *removed* - * MacOSX port introduced - -* DSP: - * Removed GPL FX: - * BASS_FX_DSPFX_FLANGER2 & BASS_FX_DSPFX_CUT - - because of that the DSP chain is changed! - -* Reverse: - * MOD playback is now supported if using BASS_MUSIC_PRESCAN flag. - -* MacOSX examples will follow this week. - -2.1.0.2 - 07/05/2005 --------------------- -* DSP: - * Chorus: fixed a bug, that would convert stereo to mono. - * Low Pass Filter: fixed a bug, that would convert stereo to mono. - * DynamicAMP: another bug fix, that would sometimes cause a total silence. - + Added: - * A new effect: Distortion - * DSPFX.TXT - a values to use with some effects, to achieve different - effect with the same one (not using other effect/s) :) - -2.1.0.1 - 22/02/2005 --------------------- -* New in BASS_FX: - + Added: - * File version info. - * Documentation file BASS_FX.CHM. - -* DSP: - * Another DynamicAMP bug fix. - * Added a new effect: Compressor - -* BPM: - * Added: "User" param to Callback BPM functions. - -2.1 - 27/12/2004 - Happy New Year ;) ------------------------------------- -* New in BASS_FX: - * No more "alpha/beta" releases! :) - * Updated to BASS 2.1 add-on APIs, coz of that BASS_FX is not compatible with any - previous versions. You'll have to make some changes in your project. - * Full 32-bit floating-point support. - * Sync support, "Sync & Tempo" example *removed* - * A lot of functions/error codes removed and integrated with BASS functions/error codes. - * New flag: BASS_FX_FREESOURCE if you want BASS_FX to free the source handle as well. - * New error code: BASS_FX_ERROR_16BIT for Flanger 2. - * BASS_FX_ErrorGetCode *removed* (use BASS_ErrorGetCode) - * BASS_FX_Free *removed* - -* Tempo: - * BASS_FX_TempoGetResampledHandle *removed* - * BASS_FX_TempoStopAndFlush *removed* - * BASS_FX_TempoFree *removed* (use BASS_StreamFree for music as well) - * BASS_FX_TempoGetApproxSeconds *removed* (use BASS_FX_TempoGetRateRatio to calculate) - * BASS_FX_TempoGetApproxPercents *removed* (use BASS_FX_TempoGetRateRatio to calculate) - + New functions: - BASS_FX_TempoGetSource (get the source handle when needed) - BASS_FX_TempoGetRateRatio - + New in flags: - BASS_FX_TEMPO_QUICKSEEK *renamed* to BASS_FX_TEMPO_QUICKALGO - BASS_FX_TEMPO_NO_AAFILTER *added* - * 3DNow! & SSE support. - -* Reverse: - * BASS_FX_ReverseGetReversedHandle *removed* - * BASS_FX_ReverseSetPosition *removed* (use BASS_ChannelSetPosition) - * BASS_FX_ReverseFree *removed* (use BASS_StreamFree) - * BASS_FX_ReverseCreate: "decode" param *removed* (use BASS_STREAM_DECODE flag) - * New function: BASS_FX_ReverseGetSource (get the source handle when needed) - -* BPM: - + These functions are combined to one: BASS_FX_BPM_Translate - * BASS_FX_BPM_X2 *removed* - * BASS_FX_BPM_Frequency2BPM *removed* - * BASS_FX_BPM_2Frequency *removed* - * BASS_FX_BPM_Percents2BPM *removed* - * BASS_FX_BPM_2Percents *removed* - - + Use these translation options with a function above: - BASS_FX_BPM_X2 - BASS_FX_BPM_2FREQ - BASS_FX_BPM_FREQ2 - BASS_FX_BPM_2PERCENT - BASS_FX_BPM_PERCENT2 - -* DSP: - * Flanger 2 still only 16-bit, will return an error if applied to 32-bit. - * Some DSP effects bug fixed. - + Echo 2.1 renamed to Echo 3: - * BASS_FX_DSPFX_ECHO21 -> BASS_FX_DSPFX_ECHO3 - * BASS_FX_DSPECHO21 -> BASS_FX_DSPECHO3 - + New effects added (more will come soon!): - . Chorus - . All Pass Filter - -2.0 "beta 2" - 28/11/2004 -------------------------- -* New in BASS_FX: - * Updated to BASS 2.1, just before releasing the official BASS_FX 2.1 :) - * Oops... again BASS_FX is a bit smaller ;) - -2.0 "beta 2" - 19/10/2004 -------------------------- -* DSP: - + Updated with 32-bit floating-point support: - . Auto Wah - + Dynamic Amplification: - * Fixed bug that would cause a sound mute if there're ~20+ seconds of silence. - All parameters changed from "Integer/Long" to "Float/Single" and their names - now starts with "f: Float/Single". - - + Not updated, yet [only 16-bit support]: - . Flanger 2.0! - - + Fixed bugs of: - * "Echo" & "Reverb" effects that would cause a noise clicks and a sound mute. - * "Peaking EQ" that would cause a crash with Mono files. - -* Reverse: - * 32-bit floating-point support. - -* Tempo: - * Fixed bug that would cause a crash if BASS_FX_Free would be called twice. - -* WARN!NG NOTE: - Not updated effects (Flanger 2/Tempo) must not be used with 32-bit. - It will crash your program and could make a very annoying noise!!! - Sometimes could even crash your system until RESET! - -2.0 "beta 1" - 07/09/2004 -------------------------- -* Really sorry for a long delay with updates!!! - -* New in BASS_FX: - * Now supports Windows 98/98SE without "msvcp60.dll" ~392KB - * Some DSP effects updated with 32-bit floating-point support. - The updated effects could be used with 16-bit & 32-bit. - -* DSP: - + Updated with 32-bit floating-point support: - . Swap Channels - . Rotate - . Echo - . Flanger - . Volume Amplifier - . Peaking EQ - . Reverb - . Low Pass Filter - . Volume Cutter - . Stereo 2 Mono - . Echo 2.0! - . Phaser - . Echo 2.1! - - + Not updated, yet [only 16-bit support]: - . Flanger 2.0! - . Dynamic Amplification - . Auto Wah - - * All parameters that began with "d: Double" changed to "f: Float/Single", - as it was forgotten with last update. - -* BPM: - * Updated with 32-bit floating-point support. - -* WARN!NG NOTE: - Not updated effects (DSP/Tempo/Reverse) must not be used with 32-bit. - It will crash your program and could make a very annoying noise!!! - Sometimes could even crash your system until RESET! - -* New in Examples: - * Added: "Sync & Tempo" - -* Removed: - * BASS_FX_ERROR_BASS20 error code, BASS_FX will show an error message - if BASS.DLL version is below 2.0 and won't load. - -2.0 "alpha" - 4/12/2003 ------------------------ -* New in BASS_FX: - * Updated to BASS 2.0! - * Version jumpted from '1.2 "beta"' to '2.0 "alpha"', - means only BASS v2.x is supported! - -* DSP: - * Added *priority* param to BASS_FX_DSP_Set(..) func - * All *Double* types changed to *Float/Single* - -* New in Examples: - * Added "Multi_FX" C/C++ only. - -* VERSION 2.0 (not "alpha") will support: - * 32-bit floating-point including in: DSP, Tempo, BPM & Reverse. - * Multi Channel in some DSPs. - * Planning to release till the end of this month/year :) - -1.2 "beta" - 30/06/2003 ------------------------ -* New in BASS_FX: - * Not compatible with any previous BASS_FX versions, - you'll have to make changes & recompile your - application to use with this version! - - + Tempo, Pitch Scaling & Samplerate changers (3 at once ;)) - + Functions: - * BASS_FX_TempoCreate - * BASS_FX_TempoSet - * BASS_FX_TempoGet - * BASS_FX_TempoGetApproxSeconds - * BASS_FX_TempoGetApproxPercents - * BASS_FX_TempoGetResampledHandle - * BASS_FX_TempoStopAndFlush - * BASS_FX_TempoFree - - + Two BPM Detection options: - + Option 1 - Get BPM from a Decoding channel: - + Function - * BASS_FX_BPM_DecodeGet - - + Option 2 - Get BPM by period of time of any handle - in Real-Time: - + Functions - * BASS_FX_BPM_CallbackSet - * BASS_FX_BPM_CallbackReset - - + Functions to use with both options: - * BASS_FX_BPM_X2 - * BASS_FX_BPM_Frequency2BPM - * BASS_FX_BPM_2Frequency - * BASS_FX_BPM_Percents2BPM - * BASS_FX_BPM_2Percents - * BASS_FX_BPM_Free - -* New in DSP: - * All DSP effects names has changed. - * The index of 1st DSP effect starts from 0 and - not from 1 as it was before. - - + -= DSP FXs =- added: - * Dynamic Amplification - * Stereo 2 Mono - * Auto Wah - * Echo v2.0! - * Phaser - * Echo v2.1! - - + Equalizer: - * Added *Q* parameter. - * Fixed some bugs :) - + Flanger v2.0! - * fixed bug (crashed with Mono files) - -* New in Functions: - + Added: - * BASS_FX_ErrorGetCode - * Always check for any Function changes. - -* Removed all PITCH functions: - * BASS_FX_PitchCreate - * BASS_FX_PitchSet - * BASS_FX_PitchGet - * BASS_FX_PitchGetResampledHandle - * BASS_FX_PitchStopAndFlush - * BASS_FX_PitchFree - -* New in Examples: - * Added: C/C++, Delphi & VB - -1.1 - 02/10/2002 ----------------- -* New in BASS_FX: - * Now supports - 16/8-Bit Stereo/Mono. - * Support for Multiple BASS instances. - * A lot of BUGs fixed =) - -* New in DSP: - + -= DSP FXs =- added: - * Low Pass Filter - * Cutter - * Flanger v2.0! - - + Equalizer: - * Algorithm optimized to BiQuad. - * Added a new parameter *eqBandwidth* - -* New in Reverse: - * Now you can add DX8 effects + change Pitch - with BASS_FX_Pitch... (check the *Reverse* example). - -* New in functions: - + Added: - * BASS_FX_DSP_Reset - * BASS_FX_Free - * Always check for any Function changes. - -* Added: - * Delphi APIs + Pitch Example. - * C/C++ Examples + corrected BASS_FX.LIB file ;) - -* Switched from MFC to Win32 DLL [MFC42.DLL ~1MB doesn't required] - -1.0 - 14/06/2002 ----------------- -* First release - - -Credits -======= -* Thanks a lot to - Ian Luck @ www.un4seen.com - for: - + BASS - Best Available Sound System! - + DSP source codes for Echo, Dynamic Amplification, Compressor and Volume Envelope - + Reverse playback source code - + SoundTouch algorithms implementation for Tempo/BPM - + Beat position algorithm fixes - + 8/16/32-bit support - + Fixed-point support - + Multi-channel support - + Add-on support - + MacOSX support - + Android support -* Ian, you're the best programmer in the whole world! - - -Credits - API/Sample Contributors -================================= -Delphi - Roger Johansson, Alex Graham (bigjim), DJ-Chris -BASS_FX.CHM - Thijs van Vliet - - -Bug reports, Suggestions, Comments, Enquiries, etc... -===================================================== -If you have any of the aforementioned please check the BASS forum (at -the website)... If you can't find an answer there, you can email: - - bass_fx@jobnik.org - - -System - Desktop/PC -=================== - --------------------------------------------------- - BASS_FX.DLL - Windows - developed and tested using: - --------------------------------------------------- - System : Intel Core i7 Haswell 4770 3.9GHz 8MB, 16GB DDR3 1600MHz CL9 - Intel Core i7 860 2.8GHz 8MB, 4GB DDR3 1600MHz CL7 - VMware 10 - - OS : Microsoft Windows: - x86: 8, 7 Ultimate, Vista Ultimate, XP Pro SP3, 2000 Pro SP4 & 98 - x64: 8.1 Pro, 7 Enterprise/Ultimate, Vista Ultimate SP1, XP Pro SP1 - - Sound Card : RealTek HD 7.1 (onboard) - - Compiler : x86: Microsoft Visual C++ v6.0 SP5 with a Processor Pack - x64: Microsoft Visual C++ 2005 v8.0 - - DirectX : 11, 10, 9.0c and 7.0 - BASS.DLL : 2.4.11 - - ---------------------------------------------------- - LIBBASS_FX.DYLIB - OSX - developed and tested using: - ---------------------------------------------------- - System : VMware 10 - - OS : Apple Macintosh OS X: - Intel Mac : 10.9, 10.8.2, 10.5.8 and 10.4.10 - PowerPC : 10.3.9 and 10.4 - - Compiler : GCC 4.0.1 - IDE : XCode 3.1.4 - LIBBASS.DYLIB : 2.4.11 - - --------------------------------------------------- - LIBBASS_FX.SO - Linux - developed and tested using: - --------------------------------------------------- - System : VMware 10 - - OS : Ubuntu Desktop x86 and x64 v8.04 - - Compiler : x86 and x64: GCC 4.2.4 (g++) - - IDE : Code::Blocks v8.02 - LIBBASS.SO : 2.4.11 - - -System - Mobile/Portable -======================== - ------------------------------------------------ - LIBBASS_FX.A - iOS - developed and tested using: - ------------------------------------------------ - System : VMware 10 - - OS : Apple Macintosh OS X: Intel Mac 10.9 - - Compiler : GCC 4.2 / LLVM - IDE : XCode 3.1.4 / XCode 5.0.2 for armv7s/arm64 architectures - LIBBASS.A : 2.4.11 - - ----------------------------------------------------- - LIBBASS_FX.SO - Android - developed and tested using: - ----------------------------------------------------- - System : Samsung Galaxy S3 GT-I9300 - Samsung Galaxy S2 GT-I9100 - Android Virtual Device - - OS : Android JB 4.1.1/2 - Android ICS 4.0.3/4 - Android GB 2.3.3 - - Compiler : Android NDK R8: GCC 4.4.3 - - IDE : Eclipse - LIBBASS.SO : 2.4.11 - - ------------------------------------------------- - BASS_FX.DLL - WinCE - developed and tested using: - ------------------------------------------------- - System : GPS Device with CPU @ 372MHz - Pocket PC 2003 SE Emulator - - OS : Windows CE 5 - Windows Mobile 2003 SE version 4.21.1088 - - Compiler : Microsoft Visual C++ 2005 v8.0 - BASS.DLL : 2.4.11 - - ------------------------------------------------------- - LIBBASS_FX.SO - Linux ARM - developed and tested using: - ------------------------------------------------------- - System : VMware 8 - - OS : Ubuntu Desktop x86 v11.10 - - Compiler : GCC: (crosstool-NG 1.15.2) 4.7.1 20120402 (prerelease) - - IDE : Code::Blocks v8.02 - LIBBASS.SO : 2.4.11 - - -More Credits ;) -=============== - * BiQuad filters -(c) Robert Bristow-JohnsonD - @ http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt - - * Peaking Equalizer (BiQuad filter) - The main source is based on - Manu Webber's - source code. - @ http://www.un4seen.com/forum/?topic=1246.msg6484#msg6484 - - * Tempo/Pitch/Rate/BPM [SoundTouch v1.8.0] -(c) Copyright (c) 2002-2014 Olli Parviainen - @ http://www.surina.net/soundtouch - L LGPL license - - * Auto Wah, Chorus, Distortion, Echo (some parts from 1st algorithm) and Phaser -(c) Copyright (c) 2000 Aleksey Smoli - @ http://st.karelia.ru/~smlalx (offline) - - * Freeverb -(c) Copyright (c) 2000 Jezar at Dreampoint - @ http://www.dreampoint.co.uk - L Public domain - - * Pitch shifting using FFT [smbPitchShift v1.2] -(c) Copyright (c) 1999-2009 Stephan M. Bernsee - @ http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/ - L WOL license - - * BASS_FX is fully useable in commercial software, as long as credit is given. - ------------------------------------------------------------------------------------ -* BASS_FX.TXT & File_ID.Diz are better viewed in DOS mode OR with - Courier - font. ------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/src/lib/bassmidi/bassmidi.pas b/src/lib/bassmidi/bassmidi.pas deleted file mode 100644 index 8fd6eb35..00000000 --- a/src/lib/bassmidi/bassmidi.pas +++ /dev/null @@ -1,223 +0,0 @@ -{ - BASSMIDI 2.4 Delphi unit - Copyright (c) 2006-2011 Un4seen Developments Ltd. - - See the BASSMIDI.CHM file for more detailed documentation -} - -unit BassMIDI; - -interface - -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} - -uses Bass; - -const - // Additional config options - BASS_CONFIG_MIDI_COMPACT = $10400; - BASS_CONFIG_MIDI_VOICES = $10401; - BASS_CONFIG_MIDI_AUTOFONT = $10402; - - // Additional BASS_SetConfigPtr options - BASS_CONFIG_MIDI_DEFFONT = $10403; - - // Additional sync types - BASS_SYNC_MIDI_MARKER = $10000; - BASS_SYNC_MIDI_CUE = $10001; - BASS_SYNC_MIDI_LYRIC = $10002; - BASS_SYNC_MIDI_TEXT = $10003; - BASS_SYNC_MIDI_EVENT = $10004; - BASS_SYNC_MIDI_TICK = $10005; - BASS_SYNC_MIDI_TIMESIG = $10006; - BASS_SYNC_MIDI_KEYSIG = $10007; - - // Additional BASS_MIDI_StreamCreateFile/etc flags - BASS_MIDI_DECAYEND = $1000; - BASS_MIDI_NOFX = $2000; - BASS_MIDI_DECAYSEEK = $4000; - - // Marker types - BASS_MIDI_MARK_MARKER = 0; // marker events - BASS_MIDI_MARK_CUE = 1; // cue events - BASS_MIDI_MARK_LYRIC = 2; // lyric events - BASS_MIDI_MARK_TEXT = 3; // text events - BASS_MIDI_MARK_TIMESIG = 4; // time signature - BASS_MIDI_MARK_KEYSIG = 5; // key signature - - // MIDI events - MIDI_EVENT_NOTE = 1; - MIDI_EVENT_PROGRAM = 2; - MIDI_EVENT_CHANPRES = 3; - MIDI_EVENT_PITCH = 4; - MIDI_EVENT_PITCHRANGE = 5; - MIDI_EVENT_DRUMS = 6; - MIDI_EVENT_FINETUNE = 7; - MIDI_EVENT_COARSETUNE = 8; - MIDI_EVENT_MASTERVOL = 9; - MIDI_EVENT_BANK = 10; - MIDI_EVENT_MODULATION = 11; - MIDI_EVENT_VOLUME = 12; - MIDI_EVENT_PAN = 13; - MIDI_EVENT_EXPRESSION = 14; - MIDI_EVENT_SUSTAIN = 15; - MIDI_EVENT_SOUNDOFF = 16; - MIDI_EVENT_RESET = 17; - MIDI_EVENT_NOTESOFF = 18; - MIDI_EVENT_PORTAMENTO = 19; - MIDI_EVENT_PORTATIME = 20; - MIDI_EVENT_PORTANOTE = 21; - MIDI_EVENT_MODE = 22; - MIDI_EVENT_REVERB = 23; - MIDI_EVENT_CHORUS = 24; - MIDI_EVENT_CUTOFF = 25; - MIDI_EVENT_RESONANCE = 26; - MIDI_EVENT_RELEASE = 27; - MIDI_EVENT_ATTACK = 28; - MIDI_EVENT_REVERB_MACRO = 30; - MIDI_EVENT_CHORUS_MACRO = 31; - MIDI_EVENT_REVERB_TIME = 32; - MIDI_EVENT_REVERB_DELAY = 33; - MIDI_EVENT_REVERB_LOCUTOFF = 34; - MIDI_EVENT_REVERB_HICUTOFF = 35; - MIDI_EVENT_REVERB_LEVEL = 36; - MIDI_EVENT_CHORUS_DELAY = 37; - MIDI_EVENT_CHORUS_DEPTH = 38; - MIDI_EVENT_CHORUS_RATE = 39; - MIDI_EVENT_CHORUS_FEEDBACK = 40; - MIDI_EVENT_CHORUS_LEVEL = 41; - MIDI_EVENT_CHORUS_REVERB = 42; - MIDI_EVENT_DRUM_FINETUNE = 50; - MIDI_EVENT_DRUM_COARSETUNE = 51; - MIDI_EVENT_DRUM_PAN = 52; - MIDI_EVENT_DRUM_REVERB = 53; - MIDI_EVENT_DRUM_CHORUS = 54; - MIDI_EVENT_DRUM_CUTOFF = 55; - MIDI_EVENT_DRUM_RESONANCE = 56; - MIDI_EVENT_DRUM_LEVEL = 57; - MIDI_EVENT_SOFT = 60; - MIDI_EVENT_SYSTEM = 61; - MIDI_EVENT_TEMPO = 62; - MIDI_EVENT_SCALETUNING = 63; - MIDI_EVENT_MIXLEVEL = $10000; - MIDI_EVENT_TRANSPOSE = $10001; - MIDI_EVENT_SYSTEMEX = $10002; - - MIDI_SYSTEM_DEFAULT = 0; - MIDI_SYSTEM_GM1 = 1; - MIDI_SYSTEM_GM2 = 2; - MIDI_SYSTEM_XG = 3; - MIDI_SYSTEM_GS = 4; - - // BASS_MIDI_StreamEvents modes - BASS_MIDI_EVENTS_STRUCT = 0; // BASS_MIDI_EVENT structures - BASS_MIDI_EVENTS_RAW = $10000; // raw MIDI event data - BASS_MIDI_EVENTS_SYNC = $1000000; // FLAG: trigger event syncs - - // BASS_CHANNELINFO type - BASS_CTYPE_STREAM_MIDI = $10d00; - - // Additional attributes - BASS_ATTRIB_MIDI_PPQN = $12000; - BASS_ATTRIB_MIDI_CPU = $12001; - BASS_ATTRIB_MIDI_CHANS = $12002; - BASS_ATTRIB_MIDI_VOICES = $12003; - BASS_ATTRIB_MIDI_TRACK_VOL = $12100; // + track # - - // Additional tag type - BASS_TAG_MIDI_TRACK = $11000; // + track #, track text : array of null-terminated ANSI strings - - // BASS_ChannelGetLength/GetPosition/SetPosition mode - BASS_POS_MIDI_TICK = 2; // tick position - - -type - HSOUNDFONT = DWORD; // soundfont handle - - BASS_MIDI_FONT = record - font: HSOUNDFONT; // soundfont - preset: LongInt; // preset number (-1=all) - bank: Longint; - end; - - BASS_MIDI_FONTINFO = record - name: PAnsiChar; - copyright: PAnsiChar; - comment: PAnsiChar; - presets: DWORD; // number of presets/instruments - samsize: DWORD; // total size (in bytes) of the sample data - samload: DWORD; // amount of sample data currently loaded - samtype: DWORD; // sample format (CTYPE) if packed - end; - - BASS_MIDI_MARK = record - track: DWORD; // track containing marker - pos: DWORD; // marker position - text: PAnsiChar; // marker text - end; - - BASS_MIDI_EVENT = record - event: DWORD; // MIDI_EVENT_xxx - param: DWORD; - chan: DWORD; - tick: DWORD; // event position (ticks) - pos: DWORD; // event position (bytes) - end; - - BASS_MIDI_DEVICEINFO = record - name: PAnsiChar; // description - id: DWORD; - flags: DWORD; - end; - - // callback function types - MIDIINPROC = procedure(device: DWORD; time: Double; buffer: Pointer; length: DWORD; user: Pointer); stdcall; - { - User MIDI input callback function. - device : MIDI input device - time : Timestamp - buffer : Buffer containing MIDI data - length : Number of bytes of data - user : The 'user' parameter value given when calling BASS_MIDI_InInit - } - - -const - bassmididll = 'bassmidi.dll'; - -function BASS_MIDI_StreamCreate(channels,flags,freq:DWORD): HSTREAM; stdcall; external bassmididll; -function BASS_MIDI_StreamCreateFile(mem:BOOL; fl:pointer; offset,length:QWORD; flags,freq:DWORD): HSTREAM; stdcall; external bassmididll; -function BASS_MIDI_StreamCreateURL(URL:PAnsiChar; offset:DWORD; flags:DWORD; proc:DOWNLOADPROC; user:Pointer; freq:DWORD): HSTREAM; stdcall; external bassmididll; -function BASS_MIDI_StreamCreateFileUser(system,flags:DWORD; var procs:BASS_FILEPROCS; user:Pointer; freq:DWORD): HSTREAM; stdcall; external bassmididll; -function BASS_MIDI_StreamGetMark(handle:HSTREAM; type_,index:DWORD; var mark:BASS_MIDI_MARK): BOOL; stdcall; external bassmididll; -function BASS_MIDI_StreamSetFonts(handle:HSTREAM; var fonts:BASS_MIDI_FONT; count:DWORD): BOOL; stdcall; external bassmididll; -function BASS_MIDI_StreamGetFonts(handle:HSTREAM; var fonts:BASS_MIDI_FONT; count:DWORD): DWORD; stdcall; external bassmididll; -function BASS_MIDI_StreamLoadSamples(handle:HSTREAM): BOOL; stdcall; external bassmididll; -function BASS_MIDI_StreamEvent(handle:HSTREAM; chan,event,param:DWORD): BOOL; stdcall; external bassmididll; -function BASS_MIDI_StreamEvents(handle:HSTREAM; mode:DWORD; events:Pointer; length:DWORD): DWORD; stdcall; external bassmididll; -function BASS_MIDI_StreamGetEvent(handle:HSTREAM; chan,event:DWORD): DWORD; stdcall; external bassmididll; -function BASS_MIDI_StreamGetEvents(handle:HSTREAM; chan,filter:DWORD; var events:BASS_MIDI_EVENT): DWORD; stdcall; external bassmididll; -function BASS_MIDI_StreamGetChannel(handle:HSTREAM; chan:DWORD): HSTREAM; stdcall; external bassmididll; - -function BASS_MIDI_FontInit(fname:PChar; flags:DWORD): HSOUNDFONT; stdcall; external bassmididll; -function BASS_MIDI_FontFree(handle:HSOUNDFONT): BOOL; stdcall; external bassmididll; -function BASS_MIDI_FontGetInfo(handle:HSOUNDFONT; var info:BASS_MIDI_FONTINFO): BOOL; stdcall; external bassmididll; -function BASS_MIDI_FontGetPreset(handle:HSOUNDFONT; preset,bank:LongInt): PAnsiChar; stdcall; external bassmididll; -function BASS_MIDI_FontLoad(handle:HSOUNDFONT; preset,bank:LongInt): BOOL; stdcall; external bassmididll; -function BASS_MIDI_FontCompact(handle:HSOUNDFONT): BOOL; stdcall; external bassmididll; -function BASS_MIDI_FontPack(handle:HSOUNDFONT; outfile,encoder:PChar; flags:DWORD): BOOL; stdcall; external bassmididll; -function BASS_MIDI_FontUnpack(handle:HSOUNDFONT; outfile:PChar; flags:DWORD): BOOL; stdcall; external bassmididll; -function BASS_MIDI_FontSetVolume(handle:HSOUNDFONT; volume:Single): BOOL; stdcall; external bassmididll; -function BASS_MIDI_FontGetVolume(handle:HSOUNDFONT): Single; stdcall; external bassmididll; - -function BASS_MIDI_InGetDeviceInfo(device:DWORD; var info: BASS_MIDI_DEVICEINFO): BOOL; stdcall; external bassmididll; -function BASS_MIDI_InInit(device:DWORD; proc:MIDIINPROC; user:Pointer): BOOL; stdcall; external bassmididll; -function BASS_MIDI_InFree(device:DWORD): BOOL; stdcall; external bassmididll; -function BASS_MIDI_InStart(device:DWORD): BOOL; stdcall; external bassmididll; -function BASS_MIDI_InStop(device:DWORD): BOOL; stdcall; external bassmididll; - -implementation - -end. diff --git a/src/lib/collections/CollArray.pas b/src/lib/collections/CollArray.pas deleted file mode 100644 index a10ba905..00000000 --- a/src/lib/collections/CollArray.pas +++ /dev/null @@ -1,183 +0,0 @@ -unit CollArray; - -(***************************************************************************** - * Copyright 2003 by Matthew Greet - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. (http://opensource.org/licenses/lgpl-license.php) - * - * See http://www.warmachine.u-net.com/delphi_collections for updates and downloads. - * - * $Version: v1.0.3 $ - * $Revision: 1.2 $ - * $Log: D:\QVCS Repositories\Delphi Collections\CollArray.qbt $ - * - * Colllection implementations based on arrays. - * - * Revision 1.2 by: Matthew Greet Rev date: 12/06/04 20:02:16 - * Capacity property. - * - * Revision 1.1 by: Matthew Greet Rev date: 06/04/03 10:30:36 - * Size property dropped. - * Unused abstract functions still implemented. - * - * Revision 1.0 by: Matthew Greet Rev date: 01/03/03 10:50:02 - * Initial revision. - * - * FPC compatibility fixes by: UltraStar Deluxe Team - * - * $Endlog$ - *****************************************************************************) - -{$IFDEF FPC} - {$MODE Delphi}{$H+} -{$ENDIF} - -interface - -uses - Collections; - -type - TArray = class(TAbstractList) - private - FArray: array of ICollectable; - protected - function TrueGetItem(Index: Integer): ICollectable; override; - procedure TrueSetItem(Index: Integer; const Value: ICollectable); override; - procedure TrueAppend(const Item: ICollectable); override; - procedure TrueClear; override; - function TrueDelete(Index: Integer): ICollectable; override; - procedure TrueInsert(Index: Integer; const Item: ICollectable); override; - public - constructor Create(NaturalItemsOnly: Boolean); override; - constructor Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean = false); override; - constructor Create(Size: Integer; NaturalItemsOnly: Boolean = false); overload; virtual; - constructor Create(const Collection: ICollection); override; - destructor Destroy; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetFixedSize: Boolean; override; - function GetSize: Integer; override; - end; - -implementation - -constructor TArray.Create(NaturalItemsOnly: Boolean); -begin - Create(0, NaturalItemsOnly); -end; - -constructor TArray.Create(Size: Integer; NaturalItemsOnly: Boolean = false); -begin - inherited Create(NaturalItemsOnly); - SetLength(FArray, Size); -end; - -constructor TArray.Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); -var - Item: ICollectable; - ItemError: TCollectionError; - I: Integer; -begin - inherited Create(ItemArray, NaturalItemsOnly); - SetLength(FArray, Length(ItemArray)); - for I := Low(ItemArray) to High(ItemArray) do - begin - Item := ItemArray[I]; - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - end - else - Items[I] := Item; - end; -end; - -constructor TArray.Create(const Collection: ICollection); -var - Iterator: IIterator; - I: Integer; -begin - inherited Create(Collection); - SetLength(FArray, Collection.GetSize); - Iterator := Collection.GetIterator; - I := 0; - while not Iterator.EOF do - begin - Items[I] := Iterator.CurrentItem; - Inc(I); - Iterator.Next; - end; -end; - -destructor TArray.Destroy; -var - I: Integer; -begin - // Delete interface references to all items - for I := Low(FArray) to High(FArray) do - begin - FArray[I] := nil; - end; - inherited Destroy; -end; - -function TArray.TrueGetItem(Index: Integer): ICollectable; -begin - Result := FArray[Index]; -end; - -procedure TArray.TrueSetItem(Index: Integer; const Value: ICollectable); -begin - FArray[Index] := Value; -end; - -procedure TArray.TrueAppend(const Item: ICollectable); -begin - // Ignored as collection is fixed size -end; - -procedure TArray.TrueClear; -begin - // Ignored as collection is fixed size -end; - -function TArray.TrueDelete(Index: Integer): ICollectable; -begin - // Ignored as collection is fixed size -end; - -procedure TArray.TrueInsert(Index: Integer; const Item: ICollectable); -begin - // Ignored as collection is fixed size -end; - -function TArray.GetCapacity: Integer; -begin - Result := Size; -end; - -procedure TArray.SetCapacity(Value: Integer); -begin - // Ignored -end; - -function TArray.GetFixedSize: Boolean; -begin - Result := true; -end; - -function TArray.GetSize: Integer; -begin - Result := Length(FArray); -end; - -end. diff --git a/src/lib/collections/CollHash.pas b/src/lib/collections/CollHash.pas deleted file mode 100644 index 796fc740..00000000 --- a/src/lib/collections/CollHash.pas +++ /dev/null @@ -1,1497 +0,0 @@ -unit CollHash; - -(***************************************************************************** - * Copyright 2003 by Matthew Greet - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. (http://opensource.org/licenses/lgpl-license.php) - * - * See http://www.warmachine.u-net.com/delphi_collections for updates and downloads. - * - * $Version: v1.0.3 $ - * $Revision: 1.1.1.2 $ - * $Log: D:\QVCS Repositories\Delphi Collections\CollHash.qbt $ - * - * Collection implementations based on hash tables. - * - * Revision 1.1.1.2 by: Matthew Greet Rev date: 12/06/04 20:04:30 - * Capacity property. - * - * Revision 1.1.1.1 by: Matthew Greet Rev date: 24/10/03 16:48:16 - * v1.0 branch. - * - * Revision 1.1 by: Matthew Greet Rev date: 06/04/03 10:40:16 - * Added integer map and string map versions. - * THashSet uses its own implementation, not THashMap. - * DefaulMaxLoadFactor changed. - * - * Revision 1.0 by: Matthew Greet Rev date: 01/03/03 10:50:02 - * Initial revision. - * - * FPC compatibility fixes by: UltraStar Deluxe Team - * - * $Endlog$ - *****************************************************************************) - -{$IFDEF FPC} - {$MODE Delphi}{$H+} -{$ENDIF} - -interface - -uses - Classes, Math, - Collections; - -const - DefaultTableSize = 100; - MaxLoadFactorMin = 0.01; // Minimum allowed value for MaxLoadFactor property. - DefaultMaxLoadFactor = 5.0; - -type - THashMap = class(TAbstractMap) - private - FArray: TListArray; - FCapacity: Integer; - FMaxLoadFactor: Double; - FSize: Integer; - FTableSize: Integer; - protected - function GetAssociationIterator: IMapIterator; override; - procedure SetMaxLoadFactor(Value: Double); virtual; - procedure SetTableSize(Value: Integer); virtual; - procedure ChangeCapacity(Value: TListArray); virtual; - procedure CheckLoadFactor(AlwaysChangeCapacity: Boolean); virtual; - function GetHash(const Key: ICollectable): Integer; virtual; - function GetKeyPosition(const Key: ICollectable): TCollectionPosition; override; - procedure Rehash; - procedure TrueClear; override; - function TrueGet(Position: TCollectionPosition): IAssociation; override; - function TruePut(Position: TCollectionPosition; const Association: IAssociation): IAssociation; override; - function TrueRemove2(Position: TCollectionPosition): IAssociation; override; - public - constructor Create(NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); override; - destructor Destroy; override; - class function GetAlwaysNaturalKeys: Boolean; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetNaturalKeyIID: TGUID; override; - function GetSize: Integer; override; - property MaxLoadFactor: Double read FMaxLoadFactor write SetMaxLoadFactor; - property TableSize: Integer read FTableSize write SetTableSize; - end; - - THashSet = class(TAbstractSet) - private - FArray: TListArray; - FCapacity: Integer; - FMaxLoadFactor: Double; - FSize: Integer; - FTableSize: Integer; - protected - procedure SetMaxLoadFactor(Value: Double); virtual; - procedure SetTableSize(Value: Integer); virtual; - procedure ChangeCapacity(Value: TListArray); virtual; - procedure CheckLoadFactor(AlwaysChangeCapacity: Boolean); virtual; - function GetHash(const Item: ICollectable): Integer; virtual; - function GetPosition(const Item: ICollectable): TCollectionPosition; override; - procedure Rehash; - procedure TrueAdd2(Position: TCollectionPosition; const Item: ICollectable); override; - procedure TrueClear; override; - function TrueGet(Position: TCollectionPosition): ICollectable; override; - procedure TrueRemove2(Position: TCollectionPosition); override; - public - constructor Create(NaturalItemsOnly: Boolean); override; - destructor Destroy; override; - class function GetAlwaysNaturalItems: Boolean; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetIterator: IIterator; override; - function GetNaturalItemIID: TGUID; override; - function GetSize: Integer; override; - property MaxLoadFactor: Double read FMaxLoadFactor write SetMaxLoadFactor; - property TableSize: Integer read FTableSize write SetTableSize; - end; - - THashIntegerMap = class(TAbstractIntegerMap) - private - FArray: TListArray; - FCapacity: Integer; - FMaxLoadFactor: Double; - FSize: Integer; - FTableSize: Integer; - protected - function GetAssociationIterator: IIntegerMapIterator; override; - procedure SetMaxLoadFactor(Value: Double); virtual; - procedure SetTableSize(Value: Integer); virtual; - procedure ChangeCapacity(Value: TListArray); virtual; - procedure CheckLoadFactor(AlwaysChangeCapacity: Boolean); virtual; - function GetHash(const Key: Integer): Integer; virtual; - function GetKeyPosition(const Key: Integer): TCollectionPosition; override; - procedure Rehash; - procedure TrueClear; override; - function TrueGet(Position: TCollectionPosition): IIntegerAssociation; override; - function TruePut(Position: TCollectionPosition; const Association: IIntegerAssociation): IIntegerAssociation; override; - function TrueRemove2(Position: TCollectionPosition): IIntegerAssociation; override; - public - constructor Create; override; - constructor Create(NaturalItemsOnly: Boolean); override; - constructor Create(NaturalItemsOnly: Boolean; TableSize: Integer; MaxLoadFactor: Double = DefaultMaxLoadFactor); overload; virtual; - destructor Destroy; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetSize: Integer; override; - property MaxLoadFactor: Double read FMaxLoadFactor write SetMaxLoadFactor; - property TableSize: Integer read FTableSize write SetTableSize; - end; - - THashStringMap = class(TAbstractStringMap) - private - FArray: TListArray; - FCapacity: Integer; - FMaxLoadFactor: Double; - FSize: Integer; - FTableSize: Integer; - protected - function GetAssociationIterator: IStringMapIterator; override; - procedure SetMaxLoadFactor(Value: Double); virtual; - procedure SetTableSize(Value: Integer); virtual; - procedure ChangeCapacity(Value: TListArray); virtual; - procedure CheckLoadFactor(AlwaysChangeCapacity: Boolean); virtual; - function GetHash(const Key: String): Integer; virtual; - function GetKeyPosition(const Key: String): TCollectionPosition; override; - procedure Rehash; - procedure TrueClear; override; - function TrueGet(Position: TCollectionPosition): IStringAssociation; override; - function TruePut(Position: TCollectionPosition; const Association: IStringAssociation): IStringAssociation; override; - function TrueRemove2(Position: TCollectionPosition): IStringAssociation; override; - public - constructor Create; override; - constructor Create(NaturalItemsOnly: Boolean); override; - constructor Create(NaturalItemsOnly: Boolean; TableSize: Integer; MaxLoadFactor: Double = DefaultMaxLoadFactor); overload; virtual; - destructor Destroy; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetSize: Integer; override; - property MaxLoadFactor: Double read FMaxLoadFactor write SetMaxLoadFactor; - property TableSize: Integer read FTableSize write SetTableSize; - end; - -implementation - -const - (* (sqrt(5) - 1)/2 - See Introduction to Algorithms in Pascal, 1995, by Thomas W. Parsons, - published by John Wiley & Sons, Inc, ISBN 0-471-11600-9 - *) - HashFactor = 0.618033988749894848204586834365638; - -type - THashIterator = class(TAbstractIterator) - private - FHashSet: THashSet; - FHash: Integer; - FChainIndex: Integer; - protected - constructor Create(HashSet: THashSet); - function TrueFirst: ICollectable; override; - function TrueNext: ICollectable; override; - procedure TrueRemove; override; - end; - - THashAssociationIterator = class(TAbstractAssociationIterator) - private - FHashMap: THashMap; - FHash: Integer; - FChainIndex: Integer; - protected - constructor Create(HashMap: THashMap); - function TrueFirst: IAssociation; override; - function TrueNext: IAssociation; override; - procedure TrueRemove; override; - end; - - THashIntegerIterator = class(TAbstractIntegerAssociationIterator) - private - FHashIntegerMap: THashIntegerMap; - FHash: Integer; - FChainIndex: Integer; - protected - constructor Create(HashIntegerMap: THashIntegerMap); - function TrueFirst: IIntegerAssociation; override; - function TrueNext: IIntegerAssociation; override; - procedure TrueRemove; override; - end; - - THashStringIterator = class(TAbstractStringAssociationIterator) - private - FHashStringMap: THashStringMap; - FHash: Integer; - FChainIndex: Integer; - protected - constructor Create(HashStringMap: THashStringMap); - function TrueFirst: IStringAssociation; override; - function TrueNext: IStringAssociation; override; - procedure TrueRemove; override; - end; - - THashPosition = class(TCollectionPosition) - private - FChain: TList; - FIndex: Integer; - public - constructor Create(Found: Boolean; Chain: TList; Index: Integer); - property Chain: TList read FChain; - property Index: Integer read FIndex; - end; - -{ THashMap } -constructor THashMap.Create(NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); -var - I: Integer; -begin - // Force use of natural keys - inherited Create(NaturalItemsOnly, true); - FTableSize := DefaultTableSize; - FMaxLoadFactor := DefaultMaxLoadFactor; - SetLength(FArray, FTableSize); - for I := Low(FArray) to High(FArray) do - FArray[I] := TList.Create; - FCapacity := 0; - FSize := 0; - ChangeCapacity(FArray); -end; - -destructor THashMap.Destroy; -var - I: Integer; -begin - for I := Low(FArray) to High(FArray) do - FArray[I].Free; - FArray := nil; - inherited Destroy; -end; - -class function THashMap.GetAlwaysNaturalKeys: Boolean; -begin - Result := true; -end; - -function THashMap.GetNaturalKeyIID: TGUID; -begin - Result := HashableIID; -end; - -function THashMap.GetAssociationIterator: IMapIterator; -begin - Result := THashAssociationIterator.Create(Self); -end; - -procedure THashMap.SetTableSize(Value: Integer); -begin - if (FTableSize <> Value) and (Value >= 1) then - begin - FTableSize := Value; - Rehash; - end; -end; - -procedure THashMap.SetMaxLoadFactor(Value: Double); -begin - if (FMaxLoadFactor <> Value) and (Value >= MaxLoadFactorMin) then - begin - FMaxLoadFactor := Value; - CheckLoadFactor(false); - end; -end; - -procedure THashMap.ChangeCapacity(Value: TListArray); -var - Chain: TList; - I, Total, ChainCapacity: Integer; -begin - if FCapacity mod FTableSize = 0 then - ChainCapacity := Trunc(FCapacity / FTableSize) - else - ChainCapacity := Trunc(FCapacity / FTableSize) + 1; - Total := 0; - for I := Low(Value) to High(Value) do - begin - Chain := Value[I]; - Chain.Capacity := ChainCapacity; - Total := Total + Chain.Capacity; - end; - FCapacity := Total; -end; - -procedure THashMap.CheckLoadFactor(AlwaysChangeCapacity: Boolean); -var - LoadFactor: Double; -begin - LoadFactor := Capacity / TableSize; - if LoadFactor > MaxLoadFactor then - TableSize := Trunc(Capacity / Max(MaxLoadFactor, MaxLoadFactorMin)) - else if AlwaysChangeCapacity then - ChangeCapacity(FArray); -end; - -function THashMap.GetHash(const Key: ICollectable): Integer; -var - Hashable: IHashable; - HashCode: Cardinal; -begin - Key.QueryInterface(IHashable, Hashable); - HashCode := Hashable.HashCode; - Result := Trunc(Frac(HashCode * HashFactor) * TableSize); -end; - -function THashMap.GetKeyPosition(const Key: ICollectable): TCollectionPosition; -var - Chain: TList; - I: Integer; - Success: Boolean; -begin - Chain := FArray[GetHash(Key)]; - Success := false; - for I := 0 to Chain.Count - 1 do - begin - Success := KeyComparator.Equals(Key, IAssociation(Chain[I]).GetKey); - if Success then - Break; - end; - Result := THashPosition.Create(Success, Chain, I); -end; - -procedure THashMap.Rehash; -var - NewArray: TListArray; - OldChain, NewChain: TList; - Association: IAssociation; - Total: Integer; - I, J: Integer; - Hash: Integer; -begin - // Create new chains - SetLength(NewArray, TableSize); - for I := Low(NewArray) to High(NewArray) do - begin - NewChain := TList.Create; - NewArray[I] := NewChain; - end; - ChangeCapacity(NewArray); - - // Transfer from old chains to new and drop old - for I := Low(FArray) to High(FArray) do - begin - OldChain := FArray[I]; - for J := 0 to OldChain.Count - 1 do - begin - Association := IAssociation(OldChain[J]); - Hash := GetHash(Association.GetKey); - NewArray[Hash].Add(Pointer(Association)); - end; - OldChain.Free; - end; - FArray := NewArray; - - // Find actual, new capacity - Total := 0; - for I := Low(FArray) to High(FArray) do - begin - NewChain := FArray[I]; - Total := Total + NewChain.Capacity; - end; - FCapacity := Total; -end; - -procedure THashMap.TrueClear; -var - Association: IAssociation; - Chain: TList; - I, J: Integer; -begin - for I := Low(FArray) to High(FArray) do - begin - Chain := FArray[I]; - for J := 0 to Chain.Count - 1 do - begin - Association := IAssociation(Chain[J]); - Chain[J] := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; - end; - Chain.Clear; - end; - FSize := 0; -end; - -function THashMap.TrueGet(Position: TCollectionPosition): IAssociation; -var - HashPosition: THashPosition; -begin - HashPosition := THashPosition(Position); - Result := IAssociation(HashPosition.Chain.Items[HashPosition.Index]); -end; - -function THashMap.TruePut(Position: TCollectionPosition; const Association: IAssociation): IAssociation; -var - HashPosition: THashPosition; - OldAssociation: IAssociation; -begin - HashPosition := THashPosition(Position); - if HashPosition.Found then - begin - OldAssociation := IAssociation(HashPosition.Chain.Items[HashPosition.Index]); - HashPosition.Chain.Items[HashPosition.Index] := Pointer(Association); - Result := OldAssociation; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._AddRef; - OldAssociation._Release; - end - else - begin - HashPosition.Chain.Add(Pointer(Association)); - Inc(FSize); - Result := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._AddRef; - end; -end; - -function THashMap.TrueRemove2(Position: TCollectionPosition): IAssociation; -var - Association: IAssociation; - HashPosition: THashPosition; -begin - HashPosition := THashPosition(Position); - Association := IAssociation(TrueGet(Position)); - HashPosition.Chain.Delete(HashPosition.Index); - Dec(FSize); - Result := Association; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; -end; - -function THashMap.GetCapacity; -begin - Result := FCapacity; -end; - -procedure THashMap.SetCapacity(Value: Integer); -begin - FCapacity := Value; - CheckLoadFactor(true); -end; - -function THashMap.GetSize: Integer; -begin - Result := FSize; -end; - -{ THashSet } -constructor THashSet.Create(NaturalItemsOnly: Boolean); -var - I: Integer; -begin - // Force use of natural items - inherited Create(true); - FTableSize := DefaultTableSize; - FMaxLoadFactor := DefaultMaxLoadFactor; - SetLength(FArray, FTableSize); - for I := Low(FArray) to High(FArray) do - FArray[I] := TList.Create; - FSize := 0; -end; - -destructor THashSet.Destroy; -var - I: Integer; -begin - for I := Low(FArray) to High(FArray) do - FArray[I].Free; - FArray := nil; - inherited Destroy; -end; - -procedure THashSet.SetTableSize(Value: Integer); -begin - if (FTableSize <> Value) and (Value >= 1) then - begin - FTableSize := Value; - Rehash; - end; -end; - -procedure THashSet.SetMaxLoadFactor(Value: Double); -begin - if (FMaxLoadFactor <> Value) and (Value >= MaxLoadFactorMin) then - begin - FMaxLoadFactor := Value; - CheckLoadFactor(false); - end; -end; - -procedure THashSet.ChangeCapacity(Value: TListArray); -var - Chain: TList; - I, Total, ChainCapacity: Integer; -begin - if FCapacity mod FTableSize = 0 then - ChainCapacity := Trunc(FCapacity / FTableSize) - else - ChainCapacity := Trunc(FCapacity / FTableSize) + 1; - Total := 0; - for I := Low(Value) to High(Value) do - begin - Chain := Value[I]; - Chain.Capacity := ChainCapacity; - Total := Total + Chain.Capacity; - end; - FCapacity := Total; -end; - -procedure THashSet.CheckLoadFactor(AlwaysChangeCapacity: Boolean); -var - LoadFactor: Double; -begin - LoadFactor := Capacity / TableSize; - if LoadFactor > MaxLoadFactor then - TableSize := Trunc(Capacity / Max(MaxLoadFactor, MaxLoadFactorMin)) - else if AlwaysChangeCapacity then - ChangeCapacity(FArray); -end; - -function THashSet.GetHash(const Item: ICollectable): Integer; -var - Hashable: IHashable; - HashCode: Cardinal; -begin - Item.QueryInterface(IHashable, Hashable); - HashCode := Hashable.HashCode; - Result := Trunc(Frac(HashCode * HashFactor) * TableSize); -end; - -function THashSet.GetPosition(const Item: ICollectable): TCollectionPosition; -var - Chain: TList; - I: Integer; - Success: Boolean; -begin - Chain := FArray[GetHash(Item)]; - Success := false; - for I := 0 to Chain.Count - 1 do - begin - Success := Comparator.Equals(Item, ICollectable(Chain[I])); - if Success then - Break; - end; - Result := THashPosition.Create(Success, Chain, I); -end; - -procedure THashSet.Rehash; -var - NewArray: TListArray; - OldChain, NewChain: TList; - Item: ICollectable; - Total: Integer; - I, J: Integer; - Hash: Integer; -begin - // Create new chains - SetLength(NewArray, TableSize); - for I := Low(NewArray) to High(NewArray) do - begin - NewChain := TList.Create; - NewArray[I] := NewChain; - end; - ChangeCapacity(NewArray); - - // Transfer from old chains to new and drop old - for I := Low(FArray) to High(FArray) do - begin - OldChain := FArray[I]; - for J := 0 to OldChain.Count - 1 do - begin - Item := ICollectable(OldChain[J]); - Hash := GetHash(Item); - NewArray[Hash].Add(Pointer(Item)); - end; - OldChain.Free; - end; - FArray := NewArray; - - // Find actual, new capacity - Total := 0; - for I := Low(FArray) to High(FArray) do - begin - NewChain := FArray[I]; - Total := Total + NewChain.Capacity; - end; - FCapacity := Total; -end; - -procedure THashSet.TrueAdd2(Position: TCollectionPosition; const Item: ICollectable); -var - HashPosition: THashPosition; -begin - HashPosition := THashPosition(Position); - HashPosition.Chain.Add(Pointer(Item)); - Inc(FSize); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Item._AddRef; -end; - -procedure THashSet.TrueClear; -var - Item: ICollectable; - Chain: TList; - I, J: Integer; -begin - for I := Low(FArray) to High(FArray) do - begin - Chain := FArray[I]; - for J := 0 to Chain.Count - 1 do - begin - Item := ICollectable(Chain[J]); - Chain[J] := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Item._Release; - end; - Chain.Clear; - end; - FSize := 0; -end; - -function THashSet.TrueGet(Position: TCollectionPosition): ICollectable; -var - HashPosition: THashPosition; -begin - HashPosition := THashPosition(Position); - Result := ICollectable(HashPosition.Chain.Items[HashPosition.Index]); -end; - -procedure THashSet.TrueRemove2(Position: TCollectionPosition); -var - Item: ICollectable; - HashPosition: THashPosition; -begin - HashPosition := THashPosition(Position); - Item := TrueGet(Position); - HashPosition.Chain.Delete(HashPosition.Index); - Dec(FSize); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Item._Release; -end; - -class function THashSet.GetAlwaysNaturalItems: Boolean; -begin - Result := true; -end; - -function THashSet.GetIterator: IIterator; -begin - Result := THashIterator.Create(Self); -end; - -function THashSet.GetNaturalItemIID: TGUID; -begin - Result := HashableIID; -end; - -function THashSet.GetCapacity; -begin - Result := FCapacity; -end; - -procedure THashSet.SetCapacity(Value: Integer); -begin - FCapacity := Value; - CheckLoadFactor(true); -end; - -function THashSet.GetSize: Integer; -begin - Result := FSize; -end; - -{ THashIntegerMap } -constructor THashIntegerMap.Create; -begin - Create(false, DefaultTableSize, DefaultMaxLoadFactor); -end; - -constructor THashIntegerMap.Create(NaturalItemsOnly: Boolean); -begin - Create(NaturalItemsOnly, DefaultTableSize, DefaultMaxLoadFactor); -end; - -constructor THashIntegerMap.Create(NaturalItemsOnly: Boolean; TableSize: Integer; MaxLoadFactor: Double = DefaultMaxLoadFactor); -var - I: Integer; -begin - inherited Create(NaturalItemsOnly); - SetLength(FArray, TableSize); - for I := Low(FArray) to High(FArray) do - FArray[I] := TList.Create; - FTableSize := TableSize; - FMaxLoadFactor := MaxLoadFactor; - FSize := 0; -end; - -destructor THashIntegerMap.Destroy; -var - I: Integer; -begin - for I := Low(FArray) to High(FArray) do - FArray[I].Free; - FArray := nil; - inherited Destroy; -end; - -function THashIntegerMap.GetAssociationIterator: IIntegerMapIterator; -begin - Result := THashIntegerIterator.Create(Self); -end; - -procedure THashIntegerMap.SetTableSize(Value: Integer); -begin - if (FTableSize <> Value) and (Value >= 1) then - begin - FTableSize := Value; - Rehash; - end; -end; - -procedure THashIntegerMap.SetMaxLoadFactor(Value: Double); -begin - if (FMaxLoadFactor <> Value) and (Value >= MaxLoadFactorMin) then - begin - FMaxLoadFactor := Value; - CheckLoadFactor(false); - end; -end; - -procedure THashIntegerMap.ChangeCapacity; -var - Chain: TList; - I, Total, ChainCapacity: Integer; -begin - if FCapacity mod FTableSize = 0 then - ChainCapacity := Trunc(FCapacity / FTableSize) - else - ChainCapacity := Trunc(FCapacity / FTableSize) + 1; - Total := 0; - for I := Low(Value) to High(Value) do - begin - Chain := Value[I]; - Chain.Capacity := ChainCapacity; - Total := Total + Chain.Capacity; - end; - FCapacity := Total; -end; - -procedure THashIntegerMap.CheckLoadFactor(AlwaysChangeCapacity: Boolean); -var - LoadFactor: Double; -begin - LoadFactor := Capacity / TableSize; - if LoadFactor > MaxLoadFactor then - TableSize := Trunc(Capacity / Max(MaxLoadFactor, MaxLoadFactorMin)) - else if AlwaysChangeCapacity then - ChangeCapacity(FArray); -end; - -function THashIntegerMap.GetHash(const Key: Integer): Integer; -begin - Result := Trunc(Frac(Cardinal(Key) * HashFactor) * TableSize); -end; - -function THashIntegerMap.GetKeyPosition(const Key: Integer): TCollectionPosition; -var - Chain: TList; - I: Integer; - Success: Boolean; -begin - Chain := FArray[GetHash(Key)]; - Success := false; - for I := 0 to Chain.Count - 1 do - begin - Success := (Key = IIntegerAssociation(Chain[I]).GetKey); - if Success then - Break; - end; - Result := THashPosition.Create(Success, Chain, I); -end; - -procedure THashIntegerMap.Rehash; -var - NewArray: TListArray; - OldChain, NewChain: TList; - Association: IIntegerAssociation; - Total: Integer; - I, J: Integer; - Hash: Integer; -begin - // Create new chains - SetLength(NewArray, TableSize); - for I := Low(NewArray) to High(NewArray) do - begin - NewChain := TList.Create; - NewArray[I] := NewChain; - end; - ChangeCapacity(NewArray); - - // Transfer from old chains to new and drop old - for I := Low(FArray) to High(FArray) do - begin - OldChain := FArray[I]; - for J := 0 to OldChain.Count - 1 do - begin - Association := IIntegerAssociation(OldChain[J]); - Hash := GetHash(Association.GetKey); - NewArray[Hash].Add(Pointer(Association)); - end; - OldChain.Free; - end; - FArray := NewArray; - - // Find actual, new capacity - Total := 0; - for I := Low(FArray) to High(FArray) do - begin - NewChain := FArray[I]; - Total := Total + NewChain.Capacity; - end; - FCapacity := Total; -end; - -procedure THashIntegerMap.TrueClear; -var - Association: IIntegerAssociation; - Chain: TList; - I, J: Integer; -begin - for I := Low(FArray) to High(FArray) do - begin - Chain := FArray[I]; - for J := 0 to Chain.Count - 1 do - begin - Association := IIntegerAssociation(Chain[J]); - Chain[J] := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; - end; - Chain.Clear; - end; - FSize := 0; -end; - -function THashIntegerMap.TrueGet(Position: TCollectionPosition): IIntegerAssociation; -var - HashPosition: THashPosition; -begin - HashPosition := THashPosition(Position); - Result := IIntegerAssociation(HashPosition.Chain.Items[HashPosition.Index]); -end; - -function THashIntegerMap.TruePut(Position: TCollectionPosition; const Association: IIntegerAssociation): IIntegerAssociation; -var - HashPosition: THashPosition; - OldAssociation: IIntegerAssociation; -begin - HashPosition := THashPosition(Position); - if HashPosition.Found then - begin - OldAssociation := IIntegerAssociation(HashPosition.Chain.Items[HashPosition.Index]); - HashPosition.Chain.Items[HashPosition.Index] := Pointer(Association); - Result := OldAssociation; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._AddRef; - OldAssociation._Release; - end - else - begin - HashPosition.Chain.Add(Pointer(Association)); - Inc(FSize); - Result := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._AddRef; - end; -end; - -function THashIntegerMap.TrueRemove2(Position: TCollectionPosition): IIntegerAssociation; -var - Association: IIntegerAssociation; - HashPosition: THashPosition; -begin - HashPosition := THashPosition(Position); - Association := IIntegerAssociation(TrueGet(Position)); - HashPosition.Chain.Delete(HashPosition.Index); - Dec(FSize); - Result := Association; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; -end; - -function THashIntegerMap.GetCapacity; -begin - Result := FCapacity; -end; - -procedure THashIntegerMap.SetCapacity(Value: Integer); -begin - FCapacity := Value; - CheckLoadFactor(true); -end; - -function THashIntegerMap.GetSize: Integer; -begin - Result := FSize; -end; - -{ THashStringMap } -constructor THashStringMap.Create; -begin - Create(false, DefaultTableSize, DefaultMaxLoadFactor); -end; - -constructor THashStringMap.Create(NaturalItemsOnly: Boolean); -begin - Create(NaturalItemsOnly, DefaultTableSize, DefaultMaxLoadFactor); -end; - -constructor THashStringMap.Create(NaturalItemsOnly: Boolean; TableSize: Integer; MaxLoadFactor: Double = DefaultMaxLoadFactor); -var - I: Integer; -begin - inherited Create(NaturalItemsOnly); - SetLength(FArray, TableSize); - for I := Low(FArray) to High(FArray) do - FArray[I] := TList.Create; - FTableSize := TableSize; - FMaxLoadFactor := MaxLoadFactor; - FSize := 0; -end; - -destructor THashStringMap.Destroy; -var - I: Integer; -begin - for I := Low(FArray) to High(FArray) do - FArray[I].Free; - FArray := nil; - inherited Destroy; -end; - -function THashStringMap.GetAssociationIterator: IStringMapIterator; -begin - Result := THashStringIterator.Create(Self); -end; - -procedure THashStringMap.SetTableSize(Value: Integer); -begin - if (FTableSize <> Value) and (Value >= 1) then - begin - FTableSize := Value; - Rehash; - end; -end; - -procedure THashStringMap.SetMaxLoadFactor(Value: Double); -begin - if (FMaxLoadFactor <> Value) and (Value >= MaxLoadFactorMin) then - begin - FMaxLoadFactor := Value; - CheckLoadFactor(false); - end; -end; - -procedure THashStringMap.ChangeCapacity; -var - Chain: TList; - I, Total, ChainCapacity: Integer; -begin - if FCapacity mod FTableSize = 0 then - ChainCapacity := Trunc(FCapacity / FTableSize) - else - ChainCapacity := Trunc(FCapacity / FTableSize) + 1; - Total := 0; - for I := Low(Value) to High(Value) do - begin - Chain := Value[I]; - Chain.Capacity := ChainCapacity; - Total := Total + Chain.Capacity; - end; - FCapacity := Total; -end; - -procedure THashStringMap.CheckLoadFactor(AlwaysChangeCapacity: Boolean); -var - LoadFactor: Double; -begin - LoadFactor := Capacity / TableSize; - if LoadFactor > MaxLoadFactor then - TableSize := Trunc(Capacity / Max(MaxLoadFactor, MaxLoadFactorMin)) - else if AlwaysChangeCapacity then - ChangeCapacity(FArray); -end; - -function THashStringMap.GetHash(const Key: String): Integer; -var - HashCode: Cardinal; - I: Integer; -begin - HashCode := 0; - for I := 1 to Length(Key) do - HashCode := (HashCode shl 1) xor Ord(Key[I]); - Result := Trunc(Frac(HashCode * HashFactor) * TableSize); -end; - -function THashStringMap.GetKeyPosition(const Key: String): TCollectionPosition; -var - Chain: TList; - I: Integer; - Success: Boolean; -begin - Chain := FArray[GetHash(Key)]; - Success := false; - for I := 0 to Chain.Count - 1 do - begin - Success := (Key = IStringAssociation(Chain[I]).GetKey); - if Success then - Break; - end; - Result := THashPosition.Create(Success, Chain, I); -end; - -procedure THashStringMap.Rehash; -var - NewArray: TListArray; - OldChain, NewChain: TList; - Association: IStringAssociation; - Total: Integer; - I, J: Integer; - Hash: Integer; -begin - // Create new chains - SetLength(NewArray, TableSize); - for I := Low(NewArray) to High(NewArray) do - begin - NewChain := TList.Create; - NewArray[I] := NewChain; - end; - ChangeCapacity(NewArray); - - // Transfer from old chains to new and drop old - for I := Low(FArray) to High(FArray) do - begin - OldChain := FArray[I]; - for J := 0 to OldChain.Count - 1 do - begin - Association := IStringAssociation(OldChain[J]); - Hash := GetHash(Association.GetKey); - NewArray[Hash].Add(Pointer(Association)); - end; - OldChain.Free; - end; - FArray := NewArray; - - // Find actual, new capacity - Total := 0; - for I := Low(FArray) to High(FArray) do - begin - NewChain := FArray[I]; - Total := Total + NewChain.Capacity; - end; - FCapacity := Total; -end; - -procedure THashStringMap.TrueClear; -var - Association: IStringAssociation; - Chain: TList; - I, J: Integer; -begin - for I := Low(FArray) to High(FArray) do - begin - Chain := FArray[I]; - for J := 0 to Chain.Count - 1 do - begin - Association := IStringAssociation(Chain[J]); - Chain[J] := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; - end; - Chain.Clear; - end; - FSize := 0; -end; - -function THashStringMap.TrueGet(Position: TCollectionPosition): IStringAssociation; -var - HashPosition: THashPosition; -begin - HashPosition := THashPosition(Position); - Result := IStringAssociation(HashPosition.Chain.Items[HashPosition.Index]); -end; - -function THashStringMap.TruePut(Position: TCollectionPosition; const Association: IStringAssociation): IStringAssociation; -var - HashPosition: THashPosition; - OldAssociation: IStringAssociation; -begin - HashPosition := THashPosition(Position); - if HashPosition.Found then - begin - OldAssociation := IStringAssociation(HashPosition.Chain.Items[HashPosition.Index]); - HashPosition.Chain.Items[HashPosition.Index] := Pointer(Association); - Result := OldAssociation; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._AddRef; - OldAssociation._Release; - end - else - begin - HashPosition.Chain.Add(Pointer(Association)); - Inc(FSize); - Result := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._AddRef; - end; -end; - -function THashStringMap.TrueRemove2(Position: TCollectionPosition): IStringAssociation; -var - Association: IStringAssociation; - HashPosition: THashPosition; -begin - HashPosition := THashPosition(Position); - Association := IStringAssociation(TrueGet(Position)); - HashPosition.Chain.Delete(HashPosition.Index); - Dec(FSize); - Result := Association; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; -end; - -function THashStringMap.GetCapacity; -begin - Result := FCapacity; -end; - -procedure THashStringMap.SetCapacity(Value: Integer); -begin - FCapacity := Value; - CheckLoadFactor(true); -end; - -function THashStringMap.GetSize: Integer; -begin - Result := FSize; -end; - -{ THashPosition } -constructor THashPosition.Create(Found: Boolean; Chain: TList; Index: Integer); -begin - inherited Create(Found); - FChain := Chain; - FIndex := Index; -end; - -{ THashIterator } -constructor THashIterator.Create(HashSet: THashSet); -begin - inherited Create(true); - FHashSet := HashSet; - First; -end; - -function THashIterator.TrueFirst: ICollectable; -var - Chain: TList; - Success: Boolean; -begin - FHash := 0; - FChainIndex := 0; - Success := false; - while FHash < FHashSet.TableSize do - begin - Chain := FHashSet.FArray[FHash]; - Success := Chain.Count > 0; - if Success then - Break; - Inc(FHash); - end; - if Success then - Result := ICollectable(FHashSet.FArray[FHash].Items[FChainIndex]) - else - Result := nil; -end; - -function THashIterator.TrueNext: ICollectable; -var - Chain: TList; - Success: Boolean; -begin - Success := false; - Chain := FHashSet.FArray[FHash]; - repeat - Inc(FChainIndex); - if FChainIndex >= Chain.Count then - begin - Inc(FHash); - FChainIndex := -1; - if FHash < FHashSet.TableSize then - Chain := FHashSet.FArray[FHash]; - end - else - Success := true; - until Success or (FHash >= FHashSet.TableSize); - if Success then - Result := ICollectable(FHashSet.FArray[FHash].Items[FChainIndex]) - else - Result := nil; -end; - -procedure THashIterator.TrueRemove; -var - Item: ICollectable; -begin - Item := ICollectable(FHashSet.FArray[FHash].Items[FChainIndex]); - FHashSet.FArray[FHash].Delete(FChainIndex); - Dec(FChainIndex); - Dec(FHashSet.FSize); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Item._Release; -end; - - -{ THashAssociationIterator } -constructor THashAssociationIterator.Create(HashMap: THashMap); -begin - inherited Create(true); - FHashMap := HashMap; - First; -end; - -function THashAssociationIterator.TrueFirst: IAssociation; -var - Chain: TList; - Success: Boolean; -begin - FHash := 0; - FChainIndex := 0; - Success := false; - while FHash < FHashMap.TableSize do - begin - Chain := FHashMap.FArray[FHash]; - Success := Chain.Count > 0; - if Success then - Break; - Inc(FHash); - end; - if Success then - Result := IAssociation(FHashMap.FArray[FHash].Items[FChainIndex]) - else - Result := nil; -end; - -function THashAssociationIterator.TrueNext: IAssociation; -var - Chain: TList; - Success: Boolean; -begin - Success := false; - Chain := FHashMap.FArray[FHash]; - repeat - Inc(FChainIndex); - if FChainIndex >= Chain.Count then - begin - Inc(FHash); - FChainIndex := -1; - if FHash < FHashMap.TableSize then - Chain := FHashMap.FArray[FHash]; - end - else - Success := true; - until Success or (FHash >= FHashMap.TableSize); - if Success then - Result := IAssociation(FHashMap.FArray[FHash].Items[FChainIndex]) - else - Result := nil; -end; - -procedure THashAssociationIterator.TrueRemove; -var - Association: IAssociation; -begin - Association := IAssociation(FHashMap.FArray[FHash].Items[FChainIndex]); - FHashMap.FArray[FHash].Delete(FChainIndex); - Dec(FChainIndex); - Dec(FHashMap.FSize); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; -end; - - -{ THashIntegerIterator } -constructor THashIntegerIterator.Create(HashIntegerMap: THashIntegerMap); -begin - inherited Create(true); - FHashIntegerMap := HashIntegerMap; - First; -end; - -function THashIntegerIterator.TrueFirst: IIntegerAssociation; -var - Chain: TList; - Success: Boolean; -begin - FHash := 0; - FChainIndex := 0; - Success := false; - while FHash < FHashIntegerMap.TableSize do - begin - Chain := FHashIntegerMap.FArray[FHash]; - Success := Chain.Count > 0; - if Success then - Break; - Inc(FHash); - end; - if Success then - Result := IIntegerAssociation(FHashIntegerMap.FArray[FHash].Items[FChainIndex]) - else - Result := nil; -end; - -function THashIntegerIterator.TrueNext: IIntegerAssociation; -var - Chain: TList; - Success: Boolean; -begin - Success := false; - Chain := FHashIntegerMap.FArray[FHash]; - repeat - Inc(FChainIndex); - if FChainIndex >= Chain.Count then - begin - Inc(FHash); - FChainIndex := -1; - if FHash < FHashIntegerMap.TableSize then - Chain := FHashIntegerMap.FArray[FHash]; - end - else - Success := true; - until Success or (FHash >= FHashIntegerMap.TableSize); - if Success then - Result := IIntegerAssociation(FHashIntegerMap.FArray[FHash].Items[FChainIndex]) - else - Result := nil; -end; - -procedure THashIntegerIterator.TrueRemove; -var - Association: IIntegerAssociation; -begin - Association := IIntegerAssociation(FHashIntegerMap.FArray[FHash].Items[FChainIndex]); - FHashIntegerMap.FArray[FHash].Delete(FChainIndex); - Dec(FChainIndex); - Dec(FHashIntegerMap.FSize); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; -end; - -{ THashStringIterator } -constructor THashStringIterator.Create(HashStringMap: THashStringMap); -begin - inherited Create(true); - FHashStringMap := HashStringMap; - First; -end; - -function THashStringIterator.TrueFirst: IStringAssociation; -var - Chain: TList; - Success: Boolean; -begin - FHash := 0; - FChainIndex := 0; - Success := false; - while FHash < FHashStringMap.TableSize do - begin - Chain := FHashStringMap.FArray[FHash]; - Success := Chain.Count > 0; - if Success then - Break; - Inc(FHash); - end; - if Success then - Result := IStringAssociation(FHashStringMap.FArray[FHash].Items[FChainIndex]) - else - Result := nil; -end; - -function THashStringIterator.TrueNext: IStringAssociation; -var - Chain: TList; - Success: Boolean; -begin - Success := false; - Chain := FHashStringMap.FArray[FHash]; - repeat - Inc(FChainIndex); - if FChainIndex >= Chain.Count then - begin - Inc(FHash); - FChainIndex := -1; - if FHash < FHashStringMap.TableSize then - Chain := FHashStringMap.FArray[FHash]; - end - else - Success := true; - until Success or (FHash >= FHashStringMap.TableSize); - if Success then - Result := IStringAssociation(FHashStringMap.FArray[FHash].Items[FChainIndex]) - else - Result := nil; -end; - -procedure THashStringIterator.TrueRemove; -var - Association: IStringAssociation; -begin - Association := IStringAssociation(FHashStringMap.FArray[FHash].Items[FChainIndex]); - FHashStringMap.FArray[FHash].Delete(FChainIndex); - Dec(FChainIndex); - Dec(FHashStringMap.FSize); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; -end; - - -end. diff --git a/src/lib/collections/CollLibrary.pas b/src/lib/collections/CollLibrary.pas deleted file mode 100644 index b7e3d268..00000000 --- a/src/lib/collections/CollLibrary.pas +++ /dev/null @@ -1,131 +0,0 @@ -unit CollLibrary; - -(***************************************************************************** - * Copyright 2003 by Matthew Greet - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. (http://opensource.org/licenses/lgpl-license.php) - * - * See http://www.warmachine.u-net.com/delphi_collections for updates and downloads. - * - * $Version: v1.0.3 $ - * $Revision: 1.0.1.1 $ - * $Log: D:\QVCS Repositories\Delphi Collections\CollLibrary.qbt $ - * - * Initial version. - * - * Revision 1.0.1.1 by: Matthew Greet Rev date: 24/10/03 16:48:16 - * v1.0 branch. - * - * Revision 1.0 by: Matthew Greet Rev date: 06/04/03 10:40:32 - * Initial revision. - * - * FPC compatibility fixes by: UltraStar Deluxe Team - * - * $Endlog$ - *****************************************************************************) - -{$IFDEF FPC} - {$MODE Delphi}{$H+} -{$ENDIF} - -interface - -uses - Collections, CollArray, CollHash, CollList, CollPArray, CollWrappers; - -type - TMiscCollectionLibrary = class - public - class function ClassNameToClassType(ClassName: String): TAbstractCollectionClass; - class function EqualIID(const IID1, IID2: TGUID): Boolean; - class function HashCode(Value: String): Integer; - class procedure ShuffleArray(var ItemArray: array of ICollectable); - class procedure ShuffleList(const List: IList); - end; - -implementation - -{ TMiscCollectionLibrary } -class function TMiscCollectionLibrary.ClassNameToClassType(ClassName: String): TAbstractCollectionClass; -begin - if ClassName = 'TArray' then - Result := TArray - else if ClassName = 'THashSet' then - Result := THashSet - else if ClassName = 'THashMap' then - Result := THashMap - else if ClassName = 'THashIntegerMap' then - Result := THashIntegerMap - else if ClassName = 'THashStringMap' then - Result := THashStringMap - else if ClassName = 'TListSet' then - Result := TListSet - else if ClassName = 'TListMap' then - Result := TListMap - else if ClassName = 'TPArrayBag' then - Result := TPArrayBag - else if ClassName = 'TPArraySet' then - Result := TPArraySet - else if ClassName = 'TPArrayList' then - Result := TPArrayList - else if ClassName = 'TPArrayMap' then - Result := TPArrayMap - else - Result := nil; -end; - -class function TMiscCollectionLibrary.EqualIID(const IID1, IID2: TGUID): Boolean; -begin - Result := (IID1.D1 = IID2.D1) and (IID1.D2 = IID2.D2) and (IID1.D3 = IID2.D3) and - (IID1.D4[0] = IID2.D4[0]) and (IID1.D4[1] = IID2.D4[1]) and - (IID1.D4[2] = IID2.D4[2]) and (IID1.D4[3] = IID2.D4[3]) and - (IID1.D4[4] = IID2.D4[4]) and (IID1.D4[5] = IID2.D4[5]) and - (IID1.D4[6] = IID2.D4[6]) and (IID1.D4[7] = IID2.D4[7]); -end; - -class function TMiscCollectionLibrary.HashCode(Value: String): Integer; -var - I: Integer; -begin - Result := 0; - for I := 1 to Length(Value) do - Result := (Result shl 1) xor Ord(Value[I]); -end; - -class procedure TMiscCollectionLibrary.ShuffleArray(var ItemArray: array of ICollectable); -var - Item: ICollectable; - ArraySize, I, Index: Integer; -begin - Randomize; - ArraySize := Length(ItemArray); - for I := 0 to ArraySize - 1 do - begin - Index := (I + Random(ArraySize - 1) + 1) mod ArraySize; - Item := ItemArray[I]; - ItemArray[I] := ItemArray[Index]; - ItemArray[Index] := Item; - end; -end; - -class procedure TMiscCollectionLibrary.ShuffleList(const List: IList); -var - ListSize, I: Integer; -begin - Randomize; - ListSize := List.GetSize; - for I := 0 to ListSize - 1 do - begin - List.Exchange(I, (I + Random(ListSize - 1) + 1) mod ListSize); - end; -end; - - -end. diff --git a/src/lib/collections/CollList.pas b/src/lib/collections/CollList.pas deleted file mode 100644 index 68aa0d66..00000000 --- a/src/lib/collections/CollList.pas +++ /dev/null @@ -1,270 +0,0 @@ -unit CollList; - -(***************************************************************************** - * Copyright 2003 by Matthew Greet - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. (http://opensource.org/licenses/lgpl-license.php) - * - * See http://www.warmachine.u-net.com/delphi_collections for updates and downloads. - * - * $Version: v1.0.3 $ - * $Revision: 1.1.1.2 $ - * $Log: D:\QVCS Repositories\Delphi Collections\CollList.qbt $ - * - * Collection implementations based on sorted TPArrayList instances. - * - * Revision 1.1.1.2 by: Matthew Greet Rev date: 12/06/04 20:05:54 - * Capacity property. - * - * Revision 1.1.1.1 by: Matthew Greet Rev date: 14/02/04 17:45:38 - * v1.0 branch. - * - * Revision 1.1 by: Matthew Greet Rev date: 06/04/03 10:41:52 - * Uses TExposedPArrayList to improve performance. - * - * Revision 1.0 by: Matthew Greet Rev date: 01/03/03 10:50:02 - * Initial revision. - * - * FPC compatibility fixes by: UltraStar Deluxe Team - * - * $Endlog$ - *****************************************************************************) - -interface - -{$IFDEF FPC} - {$MODE Delphi}{$H+} -{$ENDIF} - -uses - Collections, CollPArray; - -type - TListSet = class(TAbstractSet) - private - FList: TExposedPArrayList; - protected - function GetPosition(const Item: ICollectable): TCollectionPosition; override; - procedure TrueAdd2(Position: TCollectionPosition; const Item: ICollectable); override; - procedure TrueClear; override; - function TrueGet(Position: TCollectionPosition): ICollectable; override; - procedure TrueRemove2(Position: TCollectionPosition); override; - public - constructor Create(NaturalItemsOnly: Boolean); override; - destructor Destroy; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetIterator: IIterator; override; - function GetNaturalItemIID: TGUID; override; - function GetSize: Integer; override; - end; - - TListMap = class(TAbstractMap) - private - FList: TExposedPArrayList; - protected - function GetAssociationIterator: IMapIterator; override; - function GetKeyPosition(const Key: ICollectable): TCollectionPosition; override; - procedure TrueClear; override; - function TrueGet(Position: TCollectionPosition): IAssociation; override; - function TruePut(Position: TCollectionPosition; const Association: IAssociation): IAssociation; override; - function TrueRemove2(Position: TCollectionPosition): IAssociation; override; - public - constructor Create(NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); override; - destructor Destroy; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - procedure SetKeyComparator(const Value: IComparator); override; - function GetNaturalKeyIID: TGUID; override; - function GetSize: Integer; override; - end; - -implementation - -type - TListPosition = class(TCollectionPosition) - private - FSearchResult: TSearchResult; - public - constructor Create(Found: Boolean; SearchResult: TSearchResult); - property SearchResult: TSearchResult read FSearchResult; - end; - -constructor TListSet.Create(NaturalItemsOnly: Boolean); -begin - inherited Create(NaturalItemsOnly); - FList := TExposedPArrayList.Create(NaturalItemsOnly); - FList.Comparator := Comparator; - FList.Sort; -end; - -destructor TListSet.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -function TListSet.GetPosition(const Item: ICollectable): TCollectionPosition; -var - SearchResult: TSearchResult; -begin - SearchResult := FList.Search(Item); - Result := TListPosition.Create((SearchResult.ResultType = srFoundAtIndex), SearchResult); -end; - -procedure TListSet.TrueAdd2(Position: TCollectionPosition; const Item: ICollectable); -var - SearchResult: TSearchResult; - Index: Integer; -begin - SearchResult := TListPosition(Position).SearchResult; - Index := SearchResult.Index; - if SearchResult.ResultType = srBeforeIndex then - FList.TrueInsert(Index, Item) - else - FList.TrueAppend(Item); -end; - -procedure TListSet.TrueClear; -begin - FList.Clear; -end; - -function TListSet.TrueGet(Position: TCollectionPosition): ICollectable; -begin - Result := FList.Items[TListPosition(Position).SearchResult.Index]; -end; - -procedure TListSet.TrueRemove2(Position: TCollectionPosition); -begin - FList.Delete(TListPosition(Position).SearchResult.Index); -end; - -function TListSet.GetCapacity: Integer; -begin - Result := FList.Capacity; -end; - -procedure TListSet.SetCapacity(Value: Integer); -begin - FList.Capacity := Value; -end; - -function TListSet.GetIterator: IIterator; -begin - Result := FList.GetIterator; -end; - -function TListSet.GetNaturalItemIID: TGUID; -begin - Result := ComparableIID; -end; - -function TListSet.GetSize: Integer; -begin - Result := FList.Size; -end; - -constructor TListMap.Create(NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); -begin - inherited Create(NaturalItemsOnly, NaturalKeysOnly); - FList := TExposedPArrayList.Create(false); - FList.Comparator := AssociationComparator; - FList.Sort; -end; - -destructor TListMap.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -function TListMap.GetAssociationIterator: IMapIterator; -begin - Result := TAssociationIterator.Create(FList.GetIterator); -end; - -function TListMap.GetKeyPosition(const Key: ICollectable): TCollectionPosition; -var - Association: IAssociation; - SearchResult: TSearchResult; -begin - Association := TAssociation.Create(Key, nil); - SearchResult := FList.Search(Association); - Result := TListPosition.Create((SearchResult.ResultType = srFoundAtIndex), SearchResult); -end; - -procedure TListMap.TrueClear; -begin - FList.Clear; -end; - -function TListMap.TrueGet(Position: TCollectionPosition): IAssociation; -begin - Result := (FList.Items[TListPosition(Position).SearchResult.Index]) as IAssociation; -end; - -function TListMap.TruePut(Position: TCollectionPosition; const Association: IAssociation): IAssociation; -var - SearchResult: TSearchResult; - Index: Integer; -begin - SearchResult := TListPosition(Position).SearchResult; - Index := SearchResult.Index; - if SearchResult.ResultType = srFoundAtIndex then - begin - Result := (FList.Items[Index]) as IAssociation; - FList.Items[Index] := Association; - end - else if SearchResult.ResultType = srBeforeIndex then - FList.TrueInsert(Index, Association) - else - FList.TrueAppend(Association); -end; - -function TListMap.TrueRemove2(Position: TCollectionPosition): IAssociation; -begin - Result := (FList.Items[TListPosition(Position).SearchResult.Index]) as IAssociation; - FList.Delete(TListPosition(Position).SearchResult.Index); -end; - -procedure TListMap.SetKeyComparator(const Value: IComparator); -begin - inherited SetKeyComparator(Value); - FList.Sort; -end; - -function TListMap.GetCapacity: Integer; -begin - Result := FList.Capacity; -end; - -procedure TListMap.SetCapacity(Value: Integer); -begin - FList.Capacity := Value; -end; - -function TListMap.GetNaturalKeyIID: TGUID; -begin - Result := ComparableIID; -end; - -function TListMap.GetSize: Integer; -begin - Result := FList.Size; -end; - -constructor TListPosition.Create(Found: Boolean; SearchResult: TSearchResult); -begin - inherited Create(Found); - FSearchResult := SearchResult; -end; - -end. diff --git a/src/lib/collections/CollPArray.pas b/src/lib/collections/CollPArray.pas deleted file mode 100644 index 5ebd534b..00000000 --- a/src/lib/collections/CollPArray.pas +++ /dev/null @@ -1,689 +0,0 @@ -unit CollPArray; - -(***************************************************************************** - * Copyright 2003 by Matthew Greet - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. (http://opensource.org/licenses/lgpl-license.php) - * - * See http://www.warmachine.u-net.com/delphi_collections for updates and downloads. - * - * $Version: v1.0.3 $ - * $Revision: 1.2.1.2 $ - * $Log: D:\QVCS Repositories\Delphi Collections\CollPArray.qbt $ - * - * Collection implementations based on TList. - * - * Revision 1.2.1.2 by: Matthew Greet Rev date: 12/06/04 20:08:30 - * Capacity property. - * - * Revision 1.2.1.1 by: Matthew Greet Rev date: 14/02/04 17:46:10 - * v1.0 branch. - * - * Revision 1.2 by: Matthew Greet Rev date: 28/04/03 15:07:14 - * Correctly handles nil items. - * - * Revision 1.1 by: Matthew Greet Rev date: 06/04/03 10:43:16 - * Added TPArrayMap and TExposedPArrayList. - * - * Revision 1.0 by: Matthew Greet Rev date: 01/03/03 10:50:02 - * Initial revision. - * - * FPC compatibility fixes by: UltraStar Deluxe Team - * - * $Endlog$ - *****************************************************************************) - -{$IFDEF FPC} - {$MODE Delphi}{$H+} -{$ENDIF} - -interface - -uses - Classes, - Collections; - -type - TPArrayBag = class(TAbstractBag) - private - FList: TList; - protected - function TrueAdd(const Item: ICollectable): Boolean; override; - procedure TrueClear; override; - function TrueRemove(const Item: ICollectable): ICollectable; override; - function TrueRemoveAll(const Item: ICollectable): ICollection; override; - public - constructor Create(NaturalItemsOnly: Boolean); override; - destructor Destroy; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetIterator: IIterator; override; - function GetSize: Integer; override; - function TrueContains(const Item: ICollectable): Boolean; override; - end; - - TPArraySet = class(TAbstractSet) - private - FList: TList; - protected - function GetPosition(const Item: ICollectable): TCollectionPosition; override; - procedure TrueAdd2(Position: TCollectionPosition; const Item: ICollectable); override; - procedure TrueClear; override; - function TrueGet(Position: TCollectionPosition): ICollectable; override; - procedure TrueRemove2(Position: TCollectionPosition); override; - public - constructor Create(NaturalItemsOnly: Boolean); override; - destructor Destroy; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetIterator: IIterator; override; - function GetSize: Integer; override; - end; - - TPArrayList = class(TAbstractList) - private - FList: TList; - protected - function TrueGetItem(Index: Integer): ICollectable; override; - procedure TrueSetItem(Index: Integer; const Item: ICollectable); override; - procedure TrueAppend(const Item: ICollectable); override; - procedure TrueClear; override; - function TrueDelete(Index: Integer): ICollectable; override; - procedure TrueInsert(Index: Integer; const Item: ICollectable); override; - public - constructor Create(NaturalItemsOnly: Boolean); override; - destructor Destroy; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetIterator: IIterator; override; - function GetSize: Integer; override; - end; - - TPArrayMap = class(TAbstractMap) - private - FList: TList; - protected - function GetAssociationIterator: IMapIterator; override; - function GetKeyPosition(const Key: ICollectable): TCollectionPosition; override; - procedure TrueClear; override; - function TrueGet(Position: TCollectionPosition): IAssociation; override; - function TruePut(Position: TCollectionPosition; const Association: IAssociation): IAssociation; override; - function TrueRemove2(Position: TCollectionPosition): IAssociation; override; - public - constructor Create(NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); override; - destructor Destroy; override; - function GetCapacity: Integer; override; - procedure SetCapacity(Value: Integer); override; - function GetSize: Integer; override; - end; - - // Same as TPArrayList but raises method visibilities so items can be manually - // appended or inserted without resetting sort flag. - TExposedPArrayList = class(TPArrayList) - public - procedure TrueAppend(const Item: ICollectable); override; - procedure TrueInsert(Index: Integer; const Item: ICollectable); override; - end; - - -implementation - -type - TPArrayIterator = class(TAbstractIterator) - private - FList: TList; - FIndex: Integer; - protected - constructor Create(List: TList; AllowRemove: Boolean); - function TrueFirst: ICollectable; override; - function TrueNext: ICollectable; override; - procedure TrueRemove; override; - end; - - TPArrayAssociationIterator = class(TAbstractAssociationIterator) - private - FList: TList; - FIndex: Integer; - protected - constructor Create(List: TList; AllowRemove: Boolean); - function TrueFirst: IAssociation; override; - function TrueNext: IAssociation; override; - procedure TrueRemove; override; - end; - - TPArrayPosition = class(TCollectionPosition) - private - FIndex: Integer; - public - constructor Create(Found: Boolean; Index: Integer); - property Index: Integer read FIndex; - end; - -constructor TPArrayBag.Create(NaturalItemsOnly: Boolean); -begin - inherited Create(NaturalItemsOnly); - FList := TList.Create; -end; - -destructor TPArrayBag.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -function TPArrayBag.TrueAdd(const Item: ICollectable): Boolean; -begin - FList.Add(Pointer(Item)); - Result := true; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - if Item <> nil then - Item._AddRef; -end; - -procedure TPArrayBag.TrueClear; -var - Item: ICollectable; - I: Integer; -begin - // Delete all interface references - for I := 0 to FList.Count - 1 do - begin - Item := ICollectable(FList[I]); - FList[I] := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - if Item <> nil then - Item._Release; - end; - FList.Clear; -end; - -function TPArrayBag.TrueContains(const Item: ICollectable): Boolean; -var - I: Integer; - Success: Boolean; -begin - // Sequential search - I := 0; - Success := false; - while (I < FList.Count) and not Success do - begin - Success := Comparator.Equals(Item, ICollectable(FList[I])); - Inc(I); - end; - Result := Success; -end; - -function TPArrayBag.TrueRemove(const Item: ICollectable): ICollectable; -var - Item2: ICollectable; - I: Integer; - Found: Boolean; -begin - // Sequential search - I := 0; - Found := false; - Result := nil; - while (I < FList.Count) and not Found do - begin - Item2 := ICollectable(FList[I]); - if Comparator.Equals(Item, Item2) then - begin - Found := true; - Result := Item2; - FList.Delete(I); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - if Item2 <> nil then - Item2._Release; - end - else - Inc(I); - end; -end; - -function TPArrayBag.TrueRemoveAll(const Item: ICollectable): ICollection; -var - ResultCollection: TPArrayBag; - Item2: ICollectable; - I: Integer; -begin - // Sequential search - I := 0; - ResultCollection := TPArrayBag.Create; - while I < FList.Count do - begin - Item2 := ICollectable(FList[I]); - if Comparator.Equals(Item, Item2) then - begin - ResultCollection.Add(Item2); - FList.Delete(I); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - if Item <> nil then - Item._Release; - end - else - Inc(I); - end; - Result := ResultCollection; -end; - -function TPArrayBag.GetCapacity: Integer; -begin - Result := FList.Capacity; -end; - -procedure TPArrayBag.SetCapacity(Value: Integer); -begin - FList.Capacity := Value; -end; - -function TPArrayBag.GetIterator: IIterator; -begin - Result := TPArrayIterator.Create(FList, true); -end; - -function TPArrayBag.GetSize: Integer; -begin - Result := FList.Count; -end; - -constructor TPArraySet.Create(NaturalItemsOnly: Boolean); -begin - inherited Create(NaturalItemsOnly); - FList := TList.Create; -end; - -destructor TPArraySet.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -function TPArraySet.GetPosition(const Item: ICollectable): TCollectionPosition; -var - I: Integer; - Success: Boolean; -begin - // Sequential search - I := 0; - Success := false; - while (I < FList.Count) do - begin - Success := Comparator.Equals(Item, ICollectable(FList[I])); - if Success then - break; - Inc(I); - end; - Result := TPArrayPosition.Create(Success, I); -end; - -procedure TPArraySet.TrueAdd2(Position: TCollectionPosition; const Item: ICollectable); -begin - FList.Add(Pointer(Item)); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Item._AddRef; -end; - -procedure TPArraySet.TrueClear; -var - Item: ICollectable; - I: Integer; -begin - // Delete all interface references - for I := 0 to FList.Count - 1 do - begin - Item := ICollectable(FList[I]); - FList[I] := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Item._Release; - end; - FList.Clear; -end; - -function TPArraySet.TrueGet(Position: TCollectionPosition): ICollectable; -begin - Result := ICollectable(FList.Items[TPArrayPosition(Position).Index]); -end; - -procedure TPArraySet.TrueRemove2(Position: TCollectionPosition); -var - Item: ICollectable; -begin - Item := ICollectable(FList[TPArrayPosition(Position).Index]); - FList.Delete(TPArrayPosition(Position).Index); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Item._Release; -end; - -function TPArraySet.GetCapacity: Integer; -begin - Result := FList.Capacity; -end; - -procedure TPArraySet.SetCapacity(Value: Integer); -begin - FList.Capacity := Value; -end; - -function TPArraySet.GetIterator: IIterator; -begin - Result := TPArrayIterator.Create(FList, true); -end; - -function TPArraySet.GetSize: Integer; -begin - Result := FList.Count; -end; - -constructor TPArrayList.Create(NaturalItemsOnly: Boolean); -begin - inherited Create(NaturalItemsOnly); - FList := TList.Create; -end; - -destructor TPArrayList.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -function TPArrayList.TrueGetItem(Index: Integer): ICollectable; -begin - Result := ICollectable(FList.Items[Index]); -end; - -procedure TPArrayList.TrueSetItem(Index: Integer; const Item: ICollectable); -var - OldItem: ICollectable; -begin - OldItem := ICollectable(FList[Index]); - FList[Index] := Pointer(Item); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - if Item <> nil then - Item._AddRef; - if OldItem <> nil then - OldItem._Release; -end; - -procedure TPArrayList.TrueAppend(const Item: ICollectable); -begin - FList.Add(Pointer(Item)); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - if Item <> nil then - Item._AddRef; -end; - -procedure TPArrayList.TrueClear; -var - Item: ICollectable; - I: Integer; -begin - // Delete all interface references - for I := 0 to FList.Count - 1 do - begin - Item := ICollectable(FList[I]); - FList[I] := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - if Item <> nil then - Item._Release; - end; - FList.Clear; -end; - -function TPArrayList.TrueDelete(Index: Integer): ICollectable; -begin - Result := ICollectable(FList[Index]); - FList.Delete(Index); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - if Result <> nil then - Result._Release; -end; - -procedure TPArrayList.TrueInsert(Index: Integer; const Item: ICollectable); -begin - FList.Insert(Index, Pointer(Item)); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - if Item <> nil then - Item._AddRef; -end; - -function TPArrayList.GetCapacity: Integer; -begin - Result := FList.Capacity; -end; - -procedure TPArrayList.SetCapacity(Value: Integer); -begin - FList.Capacity := Value; -end; - -function TPArrayList.GetIterator: IIterator; -begin - Result := TPArrayIterator.Create(FList, true); -end; - -function TPArrayList.GetSize: Integer; -begin - Result := FList.Count; -end; - -constructor TPArrayMap.Create(NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); -begin - inherited Create(NaturalItemsOnly, NaturalKeysOnly); - FList := TList.Create; -end; - -destructor TPArrayMap.Destroy; -begin - FList.Free; - inherited Destroy; -end; - -function TPArrayMap.GetAssociationIterator: IMapIterator; -begin - Result := TPArrayAssociationIterator.Create(FList, true); -end; - -function TPArrayMap.GetKeyPosition(const Key: ICollectable): TCollectionPosition; -var - I: Integer; - Success: Boolean; -begin - // Sequential search - I := 0; - Success := false; - while (I < FList.Count) do - begin - Success := KeyComparator.Equals(Key, IAssociation(FList[I]).GetKey); - if Success then - break; - Inc(I); - end; - Result := TPArrayPosition.Create(Success, I); -end; - -procedure TPArrayMap.TrueClear; -var - Association: IAssociation; - I: Integer; -begin - // Delete all interface references - for I := 0 to FList.Count - 1 do - begin - Association := IAssociation(FList[I]); - FList[I] := nil; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; - end; - FList.Clear; -end; - -function TPArrayMap.TrueGet(Position: TCollectionPosition): IAssociation; -begin - Result := IAssociation(FList.Items[TPArrayPosition(Position).Index]); -end; - -function TPArrayMap.TruePut(Position: TCollectionPosition; const Association: IAssociation): IAssociation; -var - OldAssociation: IAssociation; - Index: Integer; -begin - if Position.Found then - begin - Index := (Position as TPArrayPosition).Index; - OldAssociation := IAssociation(FList[Index]); - FList[Index] := Pointer(Association); - end - else - begin - OldAssociation := nil; - FList.Add(Pointer(Association)); - end; - Result := OldAssociation; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._AddRef; - if OldAssociation <> nil then - OldAssociation._Release; -end; - -function TPArrayMap.TrueRemove2(Position: TCollectionPosition): IAssociation; -var - OldAssociation: IAssociation; -begin - OldAssociation := IAssociation(FList[TPArrayPosition(Position).Index]); - FList.Delete(TPArrayPosition(Position).Index); - Result := OldAssociation; - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - OldAssociation._Release; -end; - -function TPArrayMap.GetCapacity: Integer; -begin - Result := FList.Capacity; -end; - -procedure TPArrayMap.SetCapacity(Value: Integer); -begin - FList.Capacity := Value; -end; - -function TPArrayMap.GetSize: Integer; -begin - Result := FList.Count; -end; - -procedure TExposedPArrayList.TrueAppend(const Item: ICollectable); -begin - inherited TrueAppend(Item); -end; - -procedure TExposedPArrayList.TrueInsert(Index: Integer; const Item: ICollectable); -begin - inherited TrueInsert(Index, Item); -end; - -{ TPArrayIterator } -constructor TPArrayIterator.Create(List: TList; AllowRemove: Boolean); -begin - inherited Create(AllowRemove); - FList := List; - FIndex := -1; -end; - -function TPArrayIterator.TrueFirst: ICollectable; -begin - FIndex := 0; - if FIndex < FList.Count then - Result := ICollectable(FList[FIndex]) - else - Result := nil; -end; - -function TPArrayIterator.TrueNext: ICollectable; -begin - Inc(FIndex); - if FIndex < FList.Count then - Result := ICollectable(FList[FIndex]) - else - Result := nil; -end; - -procedure TPArrayIterator.TrueRemove; -var - Item: ICollectable; -begin - Item := ICollectable(FList[FIndex]); - FList.Delete(FIndex); - Dec(FIndex); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Item._Release; -end; - -{ TPArrayAssociationIterator } -constructor TPArrayAssociationIterator.Create(List: TList; AllowRemove: Boolean); -begin - inherited Create(AllowRemove); - FList := List; - FIndex := -1; -end; - -function TPArrayAssociationIterator.TrueFirst: IAssociation; -begin - FIndex := 0; - if FIndex < FList.Count then - Result := IAssociation(FList[FIndex]) - else - Result := nil; -end; - -function TPArrayAssociationIterator.TrueNext: IAssociation; -begin - Inc(FIndex); - if FIndex < FList.Count then - Result := IAssociation(FList[FIndex]) - else - Result := nil; -end; - -procedure TPArrayAssociationIterator.TrueRemove; -var - Association: IAssociation; -begin - Association := IAssociation(FList[FIndex]); - FList.Delete(FIndex); - Dec(FIndex); - // Storing interface reference as a pointer does not update reference - // count automatically, so this must be done manually - Association._Release; -end; - -{ TPArrayPosition } -constructor TPArrayPosition.Create(Found: Boolean; Index: Integer); -begin - inherited Create(Found); - FIndex := Index; -end; - -end. diff --git a/src/lib/collections/CollWrappers.pas b/src/lib/collections/CollWrappers.pas deleted file mode 100644 index 513103a2..00000000 --- a/src/lib/collections/CollWrappers.pas +++ /dev/null @@ -1,876 +0,0 @@ -unit CollWrappers; - -(***************************************************************************** - * Copyright 2003 by Matthew Greet - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. (http://opensource.org/licenses/lgpl-license.php) - * - * See http://www.warmachine.u-net.com/delphi_collections for updates and downloads. - * - * $Version: v1.0.3 $ - * $Revision: 1.1.1.1 $ - * $Log: D:\QVCS Repositories\Delphi Collections\CollWrappers.qbt $ - * - * Various primitive type wrappers, adapters and abstract base classes for - * natural items. - * - * Revision 1.1.1.1 by: Matthew Greet Rev date: 24/10/03 16:48:16 - * v1.0 branch. - * - * Revision 1.1 by: Matthew Greet Rev date: 06/04/03 10:51:04 - * Primitive type wrapper interfaces added. - * Abstract, template classes added. - * All classes implement reference counting by descending from - * TInterfacedObject. - * - * - * Revision 1.0 by: Matthew Greet Rev date: 01/03/03 10:50:02 - * Initial revision. - * - * FPC compatibility fixes by: UltraStar Deluxe Team - * - * $Endlog$ - *****************************************************************************) - -{$IFDEF FPC} - {$MODE Delphi}{$H+} -{$ENDIF} - -interface - -uses - SysUtils, - Collections; - -type - IAssociationWrapper = interface - ['{54DF42E0-64F2-11D7-8120-0002E3165EF8}'] - function GetAutoDestroy: Boolean; - procedure SetAutoDestroy(Value: Boolean); - function GetKey: ICollectable; - function GetValue: TObject; - property AutoDestroy: Boolean read GetAutoDestroy write SetAutoDestroy; - property Key: ICollectable read GetKey; - property Value: TObject read GetValue; - end; - - IBoolean = interface - ['{62D1D160-64F2-11D7-8120-0002E3165EF8}'] - function GetValue: Boolean; - property Value: Boolean read GetValue; - end; - - ICardinal = interface - ['{6AF7B1C0-64F2-11D7-8120-0002E3165EF8}'] - function GetValue: Cardinal; - property Value: Cardinal read GetValue; - end; - - IChar = interface - ['{73AD00E0-64F2-11D7-8120-0002E3165EF8}'] - function GetValue: Char; - property Value: Char read GetValue; - end; - - IClass = interface - ['{7A84B660-64F2-11D7-8120-0002E3165EF8}'] - function GetValue: TClass; - property Value: TClass read GetValue; - end; - - IDouble = interface - ['{815C6BE0-64F2-11D7-8120-0002E3165EF8}'] - function GetValue: Double; - property Value: Double read GetValue; - end; - - IInteger = interface - ['{88ECC300-64F2-11D7-8120-0002E3165EF8}'] - function GetValue: Integer; - property Value: Integer read GetValue; - end; - - IIntegerAssociationWrapper = interface - ['{8F582220-64F2-11D7-8120-0002E3165EF8}'] - function GetAutoDestroy: Boolean; - procedure SetAutoDestroy(Value: Boolean); - function GetKey: Integer; - function GetValue: TObject; - property AutoDestroy: Boolean read GetAutoDestroy write SetAutoDestroy; - property Key: Integer read GetKey; - property Value: TObject read GetValue; - end; - - IInterfaceWrapper = interface - ['{962E5100-64F2-11D7-8120-0002E3165EF8}'] - function GetValue: IUnknown; - property Value: IUnknown read GetValue; - end; - - IObject = interface - ['{9C675580-64F2-11D7-8120-0002E3165EF8}'] - function GetAutoDestroy: Boolean; - procedure SetAutoDestroy(Value: Boolean); - function GetValue: TObject; - property Value: TObject read GetValue; - end; - - IString = interface - ['{A420DF80-64F2-11D7-8120-0002E3165EF8}'] - function GetValue: String; - property Value: String read GetValue; - end; - - IStringAssociationWrapper = interface - ['{AB98CCA0-64F2-11D7-8120-0002E3165EF8}'] - function GetAutoDestroy: Boolean; - procedure SetAutoDestroy(Value: Boolean); - function GetKey: String; - function GetValue: TObject; - property AutoDestroy: Boolean read GetAutoDestroy write SetAutoDestroy; - property Key: String read GetKey; - property Value: TObject read GetValue; - end; - - TAbstractItem = class(TInterfacedObject, ICollectable) - public - function GetInstance: TObject; virtual; - end; - - TAbstractIntegerMappable = class(TAbstractItem, IEquatable, IIntegerMappable) - private - FKey: Integer; - protected - function MakeKey: Integer; virtual; abstract; - public - procedure AfterConstruction; override; - function Equals(const Item: ICollectable): Boolean; virtual; - function GetKey: Integer; virtual; - end; - - TAbstractMappable = class(TAbstractItem, IEquatable, IMappable) - private - FKey: ICollectable; - protected - function MakeKey: ICollectable; virtual; abstract; - public - destructor Destroy; override; - procedure AfterConstruction; override; - function Equals(const Item: ICollectable): Boolean; virtual; - function GetKey: ICollectable; virtual; - end; - - TAbstractStringMappable = class(TAbstractItem, IEquatable, IStringMappable) - private - FKey: String; - protected - function MakeKey: String; virtual; abstract; - public - procedure AfterConstruction; override; - function Equals(const Item: ICollectable): Boolean; virtual; - function GetKey: String; virtual; - end; - - TAssociationWrapper = class(TAbstractItem, IEquatable, IMappable, IAssociationWrapper) - private - FAutoDestroy: Boolean; - FKey: ICollectable; - FValue: TObject; - public - constructor Create(const Key: ICollectable; Value: TObject); overload; - constructor Create(Key: Integer; Value: TObject); overload; - constructor Create(Key: String; Value: TObject); overload; - constructor Create(Key, Value: TObject; AutoDestroyKey: Boolean = true); overload; - destructor Destroy; override; - function GetAutoDestroy: Boolean; - procedure SetAutoDestroy(Value: Boolean); - function GetKey: ICollectable; - function GetValue: TObject; - function Equals(const Item: ICollectable): Boolean; - property AutoDestroy: Boolean read GetAutoDestroy write SetAutoDestroy; - property Key: ICollectable read GetKey; - property Value: TObject read GetValue; - end; - - TBooleanWrapper = class(TAbstractItem, IEquatable, IHashable, IComparable, IBoolean) - private - FValue: Boolean; - public - constructor Create(Value: Boolean); - function GetValue: Boolean; - function CompareTo(const Item: ICollectable): Integer; - function Equals(const Item: ICollectable): Boolean; - function HashCode: Integer; - property Value: Boolean read GetValue; - end; - - TCardinalWrapper = class(TAbstractItem, IEquatable, IHashable, IComparable, ICardinal) - private - FValue: Cardinal; - public - constructor Create(Value: Cardinal); - function GetValue: Cardinal; - function Equals(const Item: ICollectable): Boolean; - function HashCode: Integer; - function CompareTo(const Item: ICollectable): Integer; - property Value: Cardinal read GetValue; - end; - - TCharWrapper = class(TAbstractItem, IEquatable, IHashable, IComparable, IChar) - private - FValue: Char; - public - constructor Create(Value: Char); - function GetValue: Char; - function Equals(const Item: ICollectable): Boolean; - function HashCode: Integer; - function CompareTo(const Item: ICollectable): Integer; - property Value: Char read GetValue; - end; - - TClassWrapper = class(TAbstractItem, IEquatable, IHashable, IClass) - private - FValue: TClass; - public - constructor Create(Value: TClass); - function GetValue: TClass; - function Equals(const Item: ICollectable): Boolean; - function HashCode: Integer; - property Value: TClass read GetValue; - end; - - TDoubleWrapper = class(TAbstractItem, IEquatable, IHashable, IComparable, IDouble) - private - FValue: Double; - public - constructor Create(Value: Double); - function GetValue: Double; - function Equals(const Item: ICollectable): Boolean; - function HashCode: Integer; - function CompareTo(const Item: ICollectable): Integer; - property Value: Double read GetValue; - end; - - TIntegerWrapper = class(TAbstractItem, IEquatable, IHashable, IComparable, IInteger) - private - FValue: Integer; - public - constructor Create(Value: Integer); - function GetValue: Integer; - function Equals(const Item: ICollectable): Boolean; - function HashCode: Integer; - function CompareTo(const Item: ICollectable): Integer; - property Value: Integer read GetValue; - end; - - TIntegerAssociationWrapper = class(TAbstractItem, IEquatable, IIntegerMappable, IIntegerAssociationWrapper) - private - FAutoDestroy: Boolean; - FKey: Integer; - FValue: TObject; - public - constructor Create(const Key: Integer; Value: TObject); overload; - destructor Destroy; override; - function Equals(const Item: ICollectable): Boolean; - function GetAutoDestroy: Boolean; - procedure SetAutoDestroy(Value: Boolean); - function GetKey: Integer; - function GetValue: TObject; - property AutoDestroy: Boolean read GetAutoDestroy write SetAutoDestroy; - property Key: Integer read GetKey; - property Value: TObject read GetValue; - end; - - TInterfaceWrapper = class(TAbstractItem, IHashable, IEquatable, IInterfaceWrapper) - private - FValue: IUnknown; - public - constructor Create(const Value: IUnknown); - destructor Destroy; override; - function GetValue: IUnknown; - function Equals(const Item: ICollectable): Boolean; - function HashCode: Integer; - property Value: IUnknown read GetValue; - end; - - TObjectWrapper = class(TAbstractItem, IEquatable, IComparable, IHashable, IObject) - private - FAutoDestroy: Boolean; - FValue: TObject; - public - constructor Create(Value: TObject); overload; - destructor Destroy; override; - function GetAutoDestroy: Boolean; - procedure SetAutoDestroy(Value: Boolean); - function GetValue: TObject; - function CompareTo(const Item: ICollectable): Integer; - function Equals(const Item: ICollectable): Boolean; - function HashCode: Integer; - property AutoDestroy: Boolean read FAutoDestroy write FAutoDestroy; - property Value: TObject read GetValue; - end; - - TStringWrapper = class(TAbstractItem, IEquatable, IHashable, IComparable, IString) - private - FValue: String; - public - constructor Create(Value: String); - function GetValue: String; - function Equals(const Item: ICollectable): Boolean; - function HashCode: Integer; - function CompareTo(const Item: ICollectable): Integer; - property Value: String read FValue; - end; - - TStringAssociationWrapper = class(TAbstractItem, IEquatable, IStringMappable, IStringAssociationWrapper) - private - FAutoDestroy: Boolean; - FKey: String; - FValue: TObject; - public - constructor Create(const Key: String; Value: TObject); overload; - destructor Destroy; override; - function GetAutoDestroy: Boolean; - procedure SetAutoDestroy(Value: Boolean); - function GetKey: String; - function GetValue: TObject; - function Equals(const Item: ICollectable): Boolean; - property AutoDestroy: Boolean read GetAutoDestroy write SetAutoDestroy; - property Key: String read GetKey; - property Value: TObject read GetValue; - end; - -implementation - -{ TAbstractItem } -function TAbstractItem.GetInstance: TObject; -begin - Result := Self; -end; - - -{ TAbstractIntegerMappable } -procedure TAbstractIntegerMappable.AfterConstruction; -begin - inherited AfterConstruction; - FKey := MakeKey; -end; - -function TAbstractIntegerMappable.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self = Item.GetInstance); -end; - -function TAbstractIntegerMappable.GetKey: Integer; -begin - Result := FKey; -end; - -{ TAbstractMappable } -destructor TAbstractMappable.Destroy; -begin - FKey := nil; - inherited Destroy; -end; - -procedure TAbstractMappable.AfterConstruction; -begin - inherited AfterConstruction; - FKey := MakeKey; -end; - -function TAbstractMappable.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self = Item.GetInstance); -end; - -function TAbstractMappable.GetKey: ICollectable; -begin - Result := FKey; -end; - -{ TAbstractStringMappable } -procedure TAbstractStringMappable.AfterConstruction; -begin - inherited AfterConstruction; - FKey := MakeKey; -end; - -function TAbstractStringMappable.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self = Item.GetInstance); -end; - -function TAbstractStringMappable.GetKey: String; -begin - Result := FKey; -end; - -{ TAssociationWrapper } -constructor TAssociationWrapper.Create(const Key: ICollectable; Value: TObject); -begin - inherited Create; - FAutoDestroy := true; - FKey := Key; - FValue := Value; -end; - -constructor TAssociationWrapper.Create(Key: Integer; Value: TObject); -begin - Create(TIntegerWrapper.Create(Key) as ICollectable, Value); -end; - -constructor TAssociationWrapper.Create(Key: String; Value: TObject); -begin - Create(TStringWrapper.Create(Key) as ICollectable, Value); -end; - -constructor TAssociationWrapper.Create(Key, Value: TObject; AutoDestroyKey: Boolean); -var - KeyWrapper: TObjectWrapper; -begin - KeyWrapper := TObjectWrapper.Create(Key); - KeyWrapper.AutoDestroy := AutoDestroyKey; - Create(KeyWrapper as ICollectable, Value); -end; - -destructor TAssociationWrapper.Destroy; -begin - if FAutoDestroy then - FValue.Free; - FKey := nil; - inherited Destroy; -end; - -function TAssociationWrapper.GetAutoDestroy: Boolean; -begin - Result := FAutoDestroy; -end; - -procedure TAssociationWrapper.SetAutoDestroy(Value: Boolean); -begin - FAutoDestroy := Value; -end; - -function TAssociationWrapper.GetKey: ICollectable; -begin - Result := FKey; -end; - -function TAssociationWrapper.GetValue: TObject; -begin - Result := FValue; -end; - -function TAssociationWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TAssociationWrapper).Value) -end; - -{ TCardinalWrapper } -constructor TCardinalWrapper.Create(Value: Cardinal); -begin - inherited Create; - FValue := Value; -end; - -function TCardinalWrapper.GetValue: Cardinal; -begin - Result := FValue; -end; - -function TCardinalWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TCardinalWrapper).Value) -end; - -function TCardinalWrapper.HashCode: Integer; -begin - Result := FValue; -end; - -function TCardinalWrapper.CompareTo(const Item: ICollectable): Integer; -var - Value2: Cardinal; -begin - Value2 := (Item.GetInstance as TCardinalWrapper).Value; - if Value < Value2 then - Result := -1 - else if Value > Value2 then - Result := 1 - else - Result := 0; -end; - -{ TBooleanWrapper } -constructor TBooleanWrapper.Create(Value: Boolean); -begin - inherited Create; - FValue := Value; -end; - -function TBooleanWrapper.GetValue: Boolean; -begin - Result := FValue; -end; - -function TBooleanWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TBooleanWrapper).Value) -end; - -function TBooleanWrapper.HashCode: Integer; -begin - Result := Ord(FValue); -end; - -function TBooleanWrapper.CompareTo(const Item: ICollectable): Integer; -var - Value2: Boolean; -begin - Value2 := (Item.GetInstance as TBooleanWrapper).Value; - if not Value and Value2 then - Result := -1 - else if Value and not Value2 then - Result := 1 - else - Result := 0; -end; - -{ TCharWrapper } -constructor TCharWrapper.Create(Value: Char); -begin - inherited Create; - FValue := Value; -end; - -function TCharWrapper.GetValue: Char; -begin - Result := FValue; -end; - -function TCharWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TCharWrapper).Value) -end; - -function TCharWrapper.HashCode: Integer; -begin - Result := Integer(FValue); -end; - -function TCharWrapper.CompareTo(const Item: ICollectable): Integer; -var - Value2: Char; -begin - Value2 := (Item.GetInstance as TCharWrapper).Value; - if Value < Value2 then - Result := -1 - else if Value > Value2 then - Result := 1 - else - Result := 0; -end; - -{ TClassWrapper } -constructor TClassWrapper.Create(Value: TClass); -begin - inherited Create; - FValue := Value; -end; - -function TClassWrapper.GetValue: TClass; -begin - Result := FValue; -end; - -function TClassWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TClassWrapper).Value) -end; - -function TClassWrapper.HashCode: Integer; -begin - Result := Integer(FValue.ClassInfo); -end; - -{ TDoubleWrapper } -constructor TDoubleWrapper.Create(Value: Double); -begin - inherited Create; - FValue := Value; -end; - -function TDoubleWrapper.GetValue: Double; -begin - Result := FValue; -end; - -function TDoubleWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TDoubleWrapper).Value) -end; - -function TDoubleWrapper.HashCode: Integer; -var - DblAsInt: array[0..1] of Integer; -begin - Double(DblAsInt) := Value; - Result := DblAsInt[0] xor DblAsInt[1]; -end; - -function TDoubleWrapper.CompareTo(const Item: ICollectable): Integer; -var - Value2: Double; -begin - Value2 := (Item.GetInstance as TDoubleWrapper).Value; - if Value < Value2 then - Result := -1 - else if Value > Value2 then - Result := 1 - else - Result := 0; -end; - -{ TIntegerWrapper } -constructor TIntegerWrapper.Create(Value: Integer); -begin - inherited Create; - FValue := Value; -end; - -function TIntegerWrapper.GetValue: Integer; -begin - Result := FValue; -end; - -function TIntegerWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TIntegerWrapper).Value) -end; - -function TIntegerWrapper.HashCode: Integer; -begin - Result := FValue; -end; - -function TIntegerWrapper.CompareTo(const Item: ICollectable): Integer; -var - Value2: Integer; -begin - Value2 := (Item.GetInstance as TIntegerWrapper).Value; - if Value < Value2 then - Result := -1 - else if Value > Value2 then - Result := 1 - else - Result := 0; -end; - -{ TIntegerAssociationWrapper } -constructor TIntegerAssociationWrapper.Create(const Key: Integer; Value: TObject); -begin - inherited Create; - FAutoDestroy := true; - FKey := Key; - FValue := Value; -end; - -destructor TIntegerAssociationWrapper.Destroy; -begin - if FAutoDestroy then - FValue.Free; - inherited Destroy; -end; - -function TIntegerAssociationWrapper.GetAutoDestroy: Boolean; -begin - Result := FAutoDestroy; -end; - -procedure TIntegerAssociationWrapper.SetAutoDestroy(Value: Boolean); -begin - FAutoDestroy := Value; -end; - -function TIntegerAssociationWrapper.GetValue: TObject; -begin - Result := FValue; -end; - -function TIntegerAssociationWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TIntegerAssociationWrapper).Value) -end; - -function TIntegerAssociationWrapper.GetKey: Integer; -begin - Result := FKey; -end; - -{ TStringAssociationWrapper } -constructor TStringAssociationWrapper.Create(const Key: String; Value: TObject); -begin - inherited Create; - FAutoDestroy := true; - FKey := Key; - FValue := Value; -end; - -destructor TStringAssociationWrapper.Destroy; -begin - if FAutoDestroy then - FValue.Free; - inherited Destroy; -end; - -function TStringAssociationWrapper.GetAutoDestroy: Boolean; -begin - Result := FAutoDestroy; -end; - -procedure TStringAssociationWrapper.SetAutoDestroy(Value: Boolean); -begin - FAutoDestroy := Value; -end; - -function TStringAssociationWrapper.GetValue: TObject; -begin - Result := FValue; -end; - -function TStringAssociationWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TStringAssociationWrapper).Value) -end; - -function TStringAssociationWrapper.GetKey: String; -begin - Result := FKey; -end; - -{ TInterfaceWrapper } -constructor TInterfaceWrapper.Create(const Value: IUnknown); -begin - inherited Create; - FValue := Value; -end; - -destructor TInterfaceWrapper.Destroy; -begin - FValue := nil; - inherited Destroy; -end; - -function TInterfaceWrapper.GetValue: IUnknown; -begin - Result := FValue; -end; - -function TInterfaceWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TInterfaceWrapper).Value) -end; - -function TInterfaceWrapper.HashCode: Integer; -begin - Result := Integer(Pointer(FValue)); -end; - -{ TObjectWrapper } -constructor TObjectWrapper.Create(Value: TObject); -begin - inherited Create; - FAutoDestroy := true; - FValue := Value; -end; - -destructor TObjectWrapper.Destroy; -begin - if FAutoDestroy then - FValue.Free; - inherited Destroy; -end; - -function TObjectWrapper.GetAutoDestroy: Boolean; -begin - Result := FAutoDestroy; -end; - -procedure TObjectWrapper.SetAutoDestroy(Value: Boolean); -begin - FAutoDestroy := Value; -end; - -function TObjectWrapper.GetValue: TObject; -begin - Result := FValue; -end; - -function TObjectWrapper.CompareTo(const Item: ICollectable): Integer; -var - Value1, Value2: Integer; -begin - Value1 := Integer(Pointer(Self)); - if Item <> nil then - Value2 := Integer(Pointer(Item)) - else - Value2 := Low(Integer); - if (Value1 < Value2) then - Result := -1 - else if (Value1 > Value2) then - Result := 1 - else - Result := 0; -end; - -function TObjectWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TObjectWrapper).Value) -end; - -function TObjectWrapper.HashCode: Integer; -begin - Result := Integer(Pointer(FValue)); -end; - -{ TStringWrapper } -constructor TStringWrapper.Create(Value: String); -begin - inherited Create; - FValue := Value; -end; - -function TStringWrapper.GetValue: String; -begin - Result := FValue; -end; - -function TStringWrapper.Equals(const Item: ICollectable): Boolean; -begin - Result := (Self.Value = (Item.GetInstance as TStringWrapper).Value) -end; - -function TStringWrapper.HashCode: Integer; -var - I: Integer; -begin - Result := 0; - for I := 1 to Length(FValue) do - Result := (Result shl 1) xor Ord(FValue[I]); -end; - -function TStringWrapper.CompareTo(const Item: ICollectable): Integer; -begin - Result := CompareStr(Self.Value, (Item.GetInstance as TStringWrapper).Value) -end; - - -end. diff --git a/src/lib/collections/Collections.pas b/src/lib/collections/Collections.pas deleted file mode 100644 index 0c94173d..00000000 --- a/src/lib/collections/Collections.pas +++ /dev/null @@ -1,5318 +0,0 @@ -unit Collections; -(***************************************************************************** - * Copyright 2003 by Matthew Greet - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. (http://opensource.org/licenses/lgpl-license.php) - * - * See http://www.warmachine.u-net.com/delphi_collections for updates and downloads. - * - * $Version: v1.0 $ - * $Revision: 1.1.1.4 $ - * $Log: D:\QVCS Repositories\Delphi Collections\Collections.qbt $ - * - * Main unit containing all interface and abstract class definitions. - * - * Revision 1.1.1.4 by: Matthew Greet Rev date: 14/03/05 23:26:32 - * Fixed RemoveAll for TAbstractList for sorted lists. - * - * Revision 1.1.1.3 by: Matthew Greet Rev date: 14/10/04 16:31:18 - * Fixed memory lean in ContainsKey of TAbstractStringMap and - * TAbstractIntegerMap. - * - * Revision 1.1.1.2 by: Matthew Greet Rev date: 12/06/04 20:03:26 - * Capacity property. - * Memory leak fixed. - * - * Revision 1.1.1.1 by: Matthew Greet Rev date: 13/02/04 16:12:10 - * v1.0 branch. - * - * Revision 1.1 by: Matthew Greet Rev date: 06/04/03 10:36:30 - * Added integer map and string map collection types with supporting - * classes. - * Add clone and filter functions with supporting classes. - * Added nil not allowed collection error. - * Properties appear in collection interfaces as well as abstract - * classes. - * - * Revision 1.0 by: Matthew Greet Rev date: 01/03/03 10:50:02 - * Initial revision. - * - * FPC compatibility fixes by: UltraStar Deluxe Team - * - * $Endlog$ - *****************************************************************************) - -{$IFDEF FPC} - {$MODE Delphi}{$H+} -{$ENDIF} - -interface - -uses - Classes, SysUtils; - -const - EquatableIID: TGUID = '{EAC823A7-0B90-11D7-8120-0002E3165EF8}'; - HashableIID: TGUID = '{98998440-4C3E-11D7-8120-0002E3165EF8}'; - ComparableIID: TGUID = '{9F4C96C0-0CF0-11D7-8120-0002E3165EF8}'; - MappableIID: TGUID = '{DAEC8CA0-0DBB-11D7-8120-0002E3165EF8}'; - StringMappableIID: TGUID = '{3CC61F40-5F92-11D7-8120-0002E3165EF8}'; - IntegerMappableIID: TGUID = '{774FC760-5F92-11D7-8120-0002E3165EF8}'; - -type - TDefaultComparator = class; - TNaturalComparator = class; - ICollectable = interface; - - TCollectableArray = array of ICollectable; - TIntegerArray = array of Integer; - TStringArray = array of String; - TListArray = array of TList; - - TCollectionError = (ceOK, ceDuplicate, ceDuplicateKey, ceFixedSize, ceNilNotAllowed, ceNotNaturalItem, ceOutOfRange); - TCollectionErrors = set of TCollectionError; - - TSearchResultType = (srNotFound, srFoundAtIndex, srBeforeIndex, srAfterEnd); - - TCollectionType = (ctBag, ctSet, ctList, ctMap, ctIntegerMap, ctStringMap); - - TCollectionFilterFunc = function (const Item: ICollectable): Boolean of object; - TCollectionCompareFunc = function (const Item1, Item2: ICollectable): Integer of object; - - TSearchResult = record - ResultType: TSearchResultType; - Index: Integer; - end; - - ICollectable = interface - ['{98998441-4C3E-11D7-8120-0002E3165EF8}'] - function GetInstance: TObject; - end; - - IEquatable = interface - ['{EAC823A7-0B90-11D7-8120-0002E3165EF8}'] - function GetInstance: TObject; - function Equals(const Item: ICollectable): Boolean; - end; - - IHashable = interface(IEquatable) - ['{98998440-4C3E-11D7-8120-0002E3165EF8}'] - function HashCode: Integer; - end; - - IComparable = interface(IEquatable) - ['{9F4C96C0-0CF0-11D7-8120-0002E3165EF8}'] - function CompareTo(const Item: ICollectable): Integer; - end; - - IMappable = interface(IEquatable) - ['{DAEC8CA0-0DBB-11D7-8120-0002E3165EF8}'] - function GetKey: ICollectable; - end; - - IStringMappable = interface(IEquatable) - ['{3CC61F40-5F92-11D7-8120-0002E3165EF8}'] - function GetKey: String; - end; - - IIntegerMappable = interface(IEquatable) - ['{774FC760-5F92-11D7-8120-0002E3165EF8}'] - function GetKey: Integer; - end; - - IComparator = interface - ['{1F20CD60-10FE-11D7-8120-0002E3165EF8}'] - function GetInstance: TObject; - function Compare(const Item1, Item2: ICollectable): Integer; - function Equals(const Item1, Item2: ICollectable): Boolean; overload; - function Equals(const Comparator: IComparator): Boolean; overload; - end; - - IFilter = interface - ['{27FE44C0-638E-11D7-8120-0002E3165EF8}'] - function Accept(const Item: ICollectable): Boolean; - end; - - IIterator = interface - ['{F6930500-1113-11D7-8120-0002E3165EF8}'] - function GetAllowRemoval: Boolean; - function CurrentItem: ICollectable; - function EOF: Boolean; - function First: ICollectable; - function Next: ICollectable; - function Remove: Boolean; - end; - - IMapIterator = interface(IIterator) - ['{848CC0E0-2A31-11D7-8120-0002E3165EF8}'] - function CurrentKey: ICollectable; - end; - - IIntegerMapIterator = interface(IIterator) - ['{C7169780-606C-11D7-8120-0002E3165EF8}'] - function CurrentKey: Integer; - end; - - IStringMapIterator = interface(IIterator) - ['{1345ED20-5F93-11D7-8120-0002E3165EF8}'] - function CurrentKey: String; - end; - - IAssociation = interface(ICollectable) - ['{556CD700-4DB3-11D7-8120-0002E3165EF8}'] - function GetKey: ICollectable; - function GetValue: ICollectable; - end; - - IIntegerAssociation = interface(ICollectable) - ['{ED954420-5F94-11D7-8120-0002E3165EF8}'] - function GetKey: Integer; - function GetValue: ICollectable; - end; - - IStringAssociation = interface(ICollectable) - ['{FB87D2A0-5F94-11D7-8120-0002E3165EF8}'] - function GetKey: String; - function GetValue: ICollectable; - end; - - IAssociationComparator = interface(IComparator) - ['{EA9BE6E0-A852-11D8-B93A-0002E3165EF8}'] - function GetKeyComparator: IComparator; - procedure SetKeyComparator(Value: IComparator); - property KeyComparator: IComparator read GetKeyComparator write SetKeyComparator; - end; - - IIntegerAssociationComparator = interface(IComparator) - ['{EA9BE6E1-A852-11D8-B93A-0002E3165EF8}'] - end; - - IStringAssociationComparator = interface(IComparator) - ['{EA9BE6E2-A852-11D8-B93A-0002E3165EF8}'] - end; - - ICollection = interface - ['{EAC823AC-0B90-11D7-8120-0002E3165EF8}'] - function GetAsArray: TCollectableArray; - function GetCapacity: Integer; - procedure SetCapacity(Value: Integer); - function GetComparator: IComparator; - procedure SetComparator(const Value: IComparator); - function GetDuplicates: Boolean; - function GetFixedSize: Boolean; - function GetIgnoreErrors: TCollectionErrors; - procedure SetIgnoreErrors(Value: TCollectionErrors); - function GetInstance: TObject; - function GetIterator: IIterator; overload; - function GetIterator(const Filter: IFilter): IIterator; overload; - function GetIterator(FilterFunc: TCollectionFilterFunc): IIterator; overload; - function GetNaturalItemIID: TGUID; - function GetNaturalItemsOnly: Boolean; - function GetSize: Integer; - function GetType: TCollectionType; - function Add(const Item: ICollectable): Boolean; overload; - function Add(const ItemArray: array of ICollectable): Integer; overload; - function Add(const Collection: ICollection): Integer; overload; - function Clear: Integer; - function Clone: ICollection; - function Contains(const Item: ICollectable): Boolean; overload; - function Contains(const ItemArray: array of ICollectable): Boolean; overload; - function Contains(const Collection: ICollection): Boolean; overload; - function Equals(const Collection: ICollection): Boolean; - function Find(const Filter: IFilter): ICollectable; overload; - function Find(FilterFunc: TCollectionFilterFunc): ICollectable; overload; - function FindAll(const Filter: IFilter = nil): ICollection; overload; - function FindAll(FilterFunc: TCollectionFilterFunc): ICollection; overload; - function IsEmpty: Boolean; - function IsNaturalItem(const Item: ICollectable): Boolean; - function IsNilAllowed: Boolean; - function ItemAllowed(const Item: ICollectable): TCollectionError; - function ItemCount(const Item: ICollectable): Integer; overload; - function ItemCount(const ItemArray: array of ICollectable): Integer; overload; - function ItemCount(const Collection: ICollection): Integer; overload; - function Matching(const ItemArray: array of ICollectable): ICollection; overload; - function Matching(const Collection: ICollection): ICollection; overload; - function Remove(const Item: ICollectable): ICollectable; overload; - function Remove(const ItemArray: array of ICollectable): ICollection; overload; - function Remove(const Collection: ICollection): ICollection; overload; - function RemoveAll(const Item: ICollectable): ICollection; overload; - function RemoveAll(const ItemArray: array of ICollectable): ICollection; overload; - function RemoveAll(const Collection: ICollection): ICollection; overload; - function Retain(const ItemArray: array of ICollectable): ICollection; overload; - function Retain(const Collection: ICollection): ICollection; overload; - property AsArray: TCollectableArray read GetAsArray; - property Capacity: Integer read GetCapacity write SetCapacity; - property Comparator: IComparator read GetComparator write SetComparator; - property FixedSize: Boolean read GetFixedSize; - property IgnoreErrors: TCollectionErrors read GetIgnoreErrors write SetIgnoreErrors; - property NaturalItemIID: TGUID read GetNaturalItemIID; - property NaturalItemsOnly: Boolean read GetNaturalItemsOnly; - property Size: Integer read GetSize; - end; - - IBag = interface(ICollection) - ['{C29C9560-2D59-11D7-8120-0002E3165EF8}'] - function CloneAsBag: IBag; - end; - - ISet = interface(ICollection) - ['{DD7888E2-0BB1-11D7-8120-0002E3165EF8}'] - function CloneAsSet: ISet; - function Complement(const Universe: ISet): ISet; - function Intersect(const Set2: ISet): ISet; - function Union(const Set2: ISet): ISet; - end; - - IList = interface(ICollection) - ['{EE81AB60-0B9F-11D7-8120-0002E3165EF8}'] - function GetDuplicates: Boolean; - procedure SetDuplicates(Value: Boolean); - function GetItem(Index: Integer): ICollectable; - procedure SetItem(Index: Integer; const Item: ICollectable); - function GetSorted: Boolean; - procedure SetSorted(Value: Boolean); - function CloneAsList: IList; - function Delete(Index: Integer): ICollectable; - procedure Exchange(Index1, Index2: Integer); - function First: ICollectable; - function IndexOf(const Item: ICollectable): Integer; - function Insert(Index: Integer; const Item: ICollectable): Boolean; overload; - function Insert(Index: Integer; const ItemArray: array of ICollectable): Integer; overload; - function Insert(Index: Integer; const Collection: ICollection): Integer; overload; - function Last: ICollectable; - procedure Sort(const Comparator: IComparator); overload; - procedure Sort(CompareFunc: TCollectionCompareFunc); overload; - property Duplicates: Boolean read GetDuplicates write SetDuplicates; - property Items[Index: Integer]: ICollectable read GetItem write SetItem; default; - property Sorted: Boolean read GetSorted write SetSorted; - end; - - IMap = interface(ICollection) - ['{AD458280-2A6B-11D7-8120-0002E3165EF8}'] - function GetItem(const Key: ICollectable): ICollectable; - procedure SetItem(const Key, Item: ICollectable); - function GetKeyComparator: IComparator; - procedure SetKeyComparator(const Value: IComparator); - function GetKeyIterator: IIterator; - function GetKeys: ISet; - function GetMapIterator: IMapIterator; - function GetMapIteratorByKey(const Filter: IFilter): IMapIterator; overload; - function GetMapIteratorByKey(FilterFunc: TCollectionFilterFunc): IMapIterator; overload; - function GetNaturalKeyIID: TGUID; - function GetNaturalKeysOnly: Boolean; - function GetValues: ICollection; - function CloneAsMap: IMap; - function ContainsKey(const Key: ICollectable): Boolean; overload; - function ContainsKey(const KeyArray: array of ICollectable): Boolean; overload; - function ContainsKey(const Collection: ICollection): Boolean; overload; - function Get(const Key: ICollectable): ICollectable; - function IsNaturalKey(const Key: ICollectable): Boolean; - function KeyAllowed(const Key: ICollectable): TCollectionError; - function MatchingKey(const KeyArray: array of ICollectable): ICollection; overload; - function MatchingKey(const Collection: ICollection): ICollection; overload; - function Put(const Item: ICollectable): ICollectable; overload; - function Put(const Key, Item: ICollectable): ICollectable; overload; - function Put(const ItemArray: array of ICollectable): ICollection; overload; - function Put(const Collection: ICollection): ICollection; overload; - function Put(const Map: IMap): ICollection; overload; - function RemoveKey(const Key: ICollectable): ICollectable; overload; - function RemoveKey(const KeyArray: array of ICollectable): ICollection; overload; - function RemoveKey(const Collection: ICollection): ICollection; overload; - function RetainKey(const KeyArray: array of ICollectable): ICollection; overload; - function RetainKey(const Collection: ICollection): ICollection; overload; - property KeyComparator: IComparator read GetKeyComparator write SetKeyComparator; - property Items[const Key: ICollectable]: ICollectable read GetItem write SetItem; default; - property NaturalKeyIID: TGUID read GetNaturalKeyIID; - property NaturalKeysOnly: Boolean read GetNaturalKeysOnly; - end; - - IIntegerMap = interface(ICollection) - ['{93DBA9A0-606C-11D7-8120-0002E3165EF8}'] - function GetItem(const Key: Integer): ICollectable; - procedure SetItem(const Key: Integer; const Item: ICollectable); - function GetKeys: ISet; - function GetMapIterator: IIntegerMapIterator; - function GetValues: ICollection; - function CloneAsIntegerMap: IIntegerMap; - function ContainsKey(const Key: Integer): Boolean; overload; - function ContainsKey(const KeyArray: array of Integer): Boolean; overload; - function Get(const Key: Integer): ICollectable; - function Put(const Item: ICollectable): ICollectable; overload; - function Put(const Key: Integer; const Item: ICollectable): ICollectable; overload; - function Put(const ItemArray: array of ICollectable): ICollection; overload; - function Put(const Collection: ICollection): ICollection; overload; - function Put(const Map: IIntegerMap): ICollection; overload; - function RemoveKey(const Key: Integer): ICollectable; overload; - function RemoveKey(const KeyArray: array of Integer): ICollection; overload; - function RetainKey(const KeyArray: array of Integer): ICollection; overload; - property Items[const Key: Integer]: ICollectable read GetItem write SetItem; default; - end; - - IStringMap = interface(ICollection) - ['{20531A20-5F92-11D7-8120-0002E3165EF8}'] - function GetItem(const Key: String): ICollectable; - procedure SetItem(const Key: String; const Item: ICollectable); - function GetKeys: ISet; - function GetMapIterator: IStringMapIterator; - function GetValues: ICollection; - function CloneAsStringMap: IStringMap; - function ContainsKey(const Key: String): Boolean; overload; - function ContainsKey(const KeyArray: array of String): Boolean; overload; - function Get(const Key: String): ICollectable; - function Put(const Item: ICollectable): ICollectable; overload; - function Put(const Key: String; const Item: ICollectable): ICollectable; overload; - function Put(const ItemArray: array of ICollectable): ICollection; overload; - function Put(const Collection: ICollection): ICollection; overload; - function Put(const Map: IStringMap): ICollection; overload; - function RemoveKey(const Key: String): ICollectable; overload; - function RemoveKey(const KeyArray: array of String): ICollection; overload; - function RetainKey(const KeyArray: array of String): ICollection; overload; - property Items[const Key: String]: ICollectable read GetItem write SetItem; default; - end; - - TCollectionPosition = class - private - FFound: Boolean; - public - constructor Create(Found: Boolean); - property Found: Boolean read FFound; - end; - - TAbstractComparator = class(TInterfacedObject, IComparator) - public - class function GetDefaultComparator: IComparator; - class function GetNaturalComparator: IComparator; - class function GetReverseNaturalComparator: IComparator; - function GetInstance: TObject; - function Compare(const Item1, Item2: ICollectable): Integer; virtual; abstract; - function Equals(const Item1, Item2: ICollectable): Boolean; overload; virtual; abstract; - function Equals(const Comparator: IComparator): Boolean; overload; virtual; - end; - - TDefaultComparator = class(TAbstractComparator) - protected - constructor Create; - public - function Compare(const Item1, Item2: ICollectable): Integer; override; - function Equals(const Item1, Item2: ICollectable): Boolean; override; - end; - - TNaturalComparator = class(TAbstractComparator) - protected - constructor Create; - public - function Compare(const Item1, Item2: ICollectable): Integer; override; - function Equals(const Item1, Item2: ICollectable): Boolean; override; - end; - - TReverseNaturalComparator = class(TAbstractComparator) - protected - constructor Create; - public - function Compare(const Item1, Item2: ICollectable): Integer; override; - function Equals(const Item1, Item2: ICollectable): Boolean; override; - end; - - TAssociation = class(TInterfacedObject, ICollectable, IAssociation) - private - FKey: ICollectable; - FValue: ICollectable; - public - constructor Create(const Key, Value: ICollectable); virtual; - destructor Destroy; override; - function GetInstance: TObject; virtual; - function GetKey: ICollectable; - function GetValue: ICollectable; - end; - - TIntegerAssociation = class(TInterfacedObject, ICollectable, IIntegerAssociation) - private - FKey: Integer; - FValue: ICollectable; - public - constructor Create(const Key: Integer; const Value: ICollectable); virtual; - destructor Destroy; override; - function GetInstance: TObject; virtual; - function GetKey: Integer; - function GetValue: ICollectable; - end; - - TStringAssociation = class(TInterfacedObject, ICollectable, IStringAssociation) - private - FKey: String; - FValue: ICollectable; - public - constructor Create(const Key: String; const Value: ICollectable); virtual; - destructor Destroy; override; - function GetInstance: TObject; virtual; - function GetKey: String; - function GetValue: ICollectable; - end; - - TAssociationComparator = class(TAbstractComparator, IAssociationComparator) - private - FKeyComparator: IComparator; - public - constructor Create(NaturalKeys: Boolean = false); - destructor Destroy; override; - function GetKeyComparator: IComparator; - procedure SetKeyComparator(Value: IComparator); - function Compare(const Item1, Item2: ICollectable): Integer; override; - function Equals(const Item1, Item2: ICollectable): Boolean; override; - property KeyComparator: IComparator read GetKeyComparator write SetKeyComparator; - end; - - TIntegerAssociationComparator = class(TAbstractComparator, IIntegerAssociationComparator) - public - constructor Create; - destructor Destroy; override; - function Compare(const Item1, Item2: ICollectable): Integer; override; - function Equals(const Item1, Item2: ICollectable): Boolean; override; - end; - - TStringAssociationComparator = class(TAbstractComparator, IStringAssociationComparator) - public - constructor Create; - destructor Destroy; override; - function Compare(const Item1, Item2: ICollectable): Integer; override; - function Equals(const Item1, Item2: ICollectable): Boolean; override; - end; - - - - TAbstractCollection = class(TInterfacedObject, ICollection) - private - FCreated: Boolean; // Required to avoid passing destroyed object reference to exception - FComparator: IComparator; - FIgnoreErrors: TCollectionErrors; - FNaturalItemsOnly: Boolean; - protected - procedure CollectionError(ErrorType: TCollectionError); - procedure InitFrom(const Collection: ICollection); overload; virtual; - function TrueAdd(const Item: ICollectable): Boolean; virtual; abstract; - procedure TrueClear; virtual; abstract; - function TrueContains(const Item: ICollectable): Boolean; virtual; abstract; - function TrueItemCount(const Item: ICollectable): Integer; virtual; - function TrueRemove(const Item: ICollectable): ICollectable; virtual; abstract; - function TrueRemoveAll(const Item: ICollectable): ICollection; virtual; abstract; - public - constructor Create; overload; virtual; - constructor Create(NaturalItemsOnly: Boolean); overload; virtual; - constructor Create(const ItemArray: array of ICollectable); overload; virtual; - constructor Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); overload; virtual; - constructor Create(const Collection: ICollection); overload; virtual; - destructor Destroy; override; - class function GetAlwaysNaturalItems: Boolean; virtual; - function GetAsArray: TCollectableArray; virtual; - function GetCapacity: Integer; virtual; abstract; - procedure SetCapacity(Value: Integer); virtual; abstract; - function GetComparator: IComparator; virtual; - procedure SetComparator(const Value: IComparator); virtual; - function GetDuplicates: Boolean; virtual; - function GetFixedSize: Boolean; virtual; - function GetIgnoreErrors: TCollectionErrors; - procedure SetIgnoreErrors(Value: TCollectionErrors); - function GetInstance: TObject; - function GetIterator: IIterator; overload; virtual; abstract; - function GetIterator(const Filter: IFilter): IIterator; overload; virtual; - function GetIterator(FilterFunc: TCollectionFilterFunc): IIterator; overload; virtual; - function GetNaturalItemIID: TGUID; virtual; abstract; - function GetNaturalItemsOnly: Boolean; virtual; - function GetSize: Integer; virtual; abstract; - function GetType: TCollectionType; virtual; abstract; - function Add(const Item: ICollectable): Boolean; overload; virtual; - function Add(const ItemArray: array of ICollectable): Integer; overload; virtual; - function Add(const Collection: ICollection): Integer; overload; virtual; - procedure AfterConstruction; override; - procedure BeforeDestruction; override; - function Clear: Integer; virtual; - function Clone: ICollection; virtual; - function Contains(const Item: ICollectable): Boolean; overload; virtual; - function Contains(const ItemArray: array of ICollectable): Boolean; overload; virtual; - function Contains(const Collection: ICollection): Boolean; overload; virtual; - function Equals(const Collection: ICollection): Boolean; virtual; - function Find(const Filter: IFilter): ICollectable; overload; virtual; - function Find(FilterFunc: TCollectionFilterFunc): ICollectable; overload; virtual; - function FindAll(const Filter: IFilter): ICollection; overload; virtual; - function FindAll(FilterFunc: TCollectionFilterFunc): ICollection; overload; virtual; - function IsEmpty: Boolean; virtual; - function IsNaturalItem(const Item: ICollectable): Boolean; virtual; - function IsNilAllowed: Boolean; virtual; abstract; - function ItemAllowed(const Item: ICollectable): TCollectionError; virtual; - function ItemCount(const Item: ICollectable): Integer; overload; virtual; - function ItemCount(const ItemArray: array of ICollectable): Integer; overload; virtual; - function ItemCount(const Collection: ICollection): Integer; overload; virtual; - function Matching(const ItemArray: array of ICollectable): ICollection; overload; virtual; - function Matching(const Collection: ICollection): ICollection; overload; virtual; - function Remove(const Item: ICollectable): ICollectable; overload; virtual; - function Remove(const ItemArray: array of ICollectable): ICollection; overload; virtual; - function Remove(const Collection: ICollection): ICollection; overload; virtual; - function RemoveAll(const Item: ICollectable): ICollection; overload; virtual; - function RemoveAll(const ItemArray: array of ICollectable): ICollection; overload; virtual; - function RemoveAll(const Collection: ICollection): ICollection; overload; virtual; - function Retain(const ItemArray: array of ICollectable): ICollection; overload; virtual; - function Retain(const Collection: ICollection): ICollection; overload; virtual; - property AsArray: TCollectableArray read GetAsArray; - property Capacity: Integer read GetCapacity write SetCapacity; - property Comparator: IComparator read GetComparator write SetComparator; - property FixedSize: Boolean read GetFixedSize; - property IgnoreErrors: TCollectionErrors read GetIgnoreErrors write SetIgnoreErrors; - property NaturalItemIID: TGUID read GetNaturalItemIID; - property NaturalItemsOnly: Boolean read GetNaturalItemsOnly; - property Size: Integer read GetSize; - end; - - TAbstractBag = class(TAbstractCollection, IBag) - public - function CloneAsBag: IBag; virtual; - function GetNaturalItemIID: TGUID; override; - function GetType: TCollectionType; override; - function IsNilAllowed: Boolean; override; - end; - - TAbstractSet = class (TAbstractCollection, ISet) - protected - function GetPosition(const Item: ICollectable): TCollectionPosition; virtual; abstract; - function TrueAdd(const Item: ICollectable): Boolean; override; - procedure TrueAdd2(Position: TCollectionPosition; const Item: ICollectable); virtual; abstract; - function TrueContains(const Item: ICollectable): Boolean; override; - function TrueGet(Position: TCollectionPosition): ICollectable; virtual; abstract; - function TrueRemove(const Item: ICollectable): ICollectable; override; - procedure TrueRemove2(Position: TCollectionPosition); virtual; abstract; - function TrueRemoveAll(const Item: ICollectable): ICollection; override; - public - function GetDuplicates: Boolean; override; - function GetNaturalItemIID: TGUID; override; - function GetType: TCollectionType; override; - function CloneAsSet: ISet; virtual; - function Complement(const Universe: ISet): ISet; overload; virtual; - function Intersect(const Set2: ISet): ISet; overload; virtual; - function IsNilAllowed: Boolean; override; - function Union(const Set2: ISet): ISet; overload; virtual; - end; - - TAbstractList = class(TAbstractCollection, IList) - private - FDuplicates: Boolean; - FSorted: Boolean; - protected - function BinarySearch(const Item: ICollectable): TSearchResult; virtual; - procedure InitFrom(const Collection: ICollection); override; - procedure QuickSort(Lo, Hi: Integer; const Comparator: IComparator); overload; virtual; - procedure QuickSort(Lo, Hi: Integer; CompareFunc: TCollectionCompareFunc); overload; virtual; - function SequentialSearch(const Item: ICollectable; const SearchComparator: IComparator = nil): TSearchResult; virtual; - function TrueContains(const Item: ICollectable): Boolean; override; - function TrueGetItem(Index: Integer): ICollectable; virtual; abstract; - procedure TrueSetItem(Index: Integer; const Item: ICollectable); virtual; abstract; - function TrueAdd(const Item: ICollectable): Boolean; override; - procedure TrueAppend(const Item: ICollectable); virtual; abstract; - function TrueDelete(Index: Integer): ICollectable; virtual; abstract; - procedure TrueInsert(Index: Integer; const Item: ICollectable); virtual; abstract; - function TrueItemCount(const Item: ICollectable): Integer; override; - function TrueRemove(const Item: ICollectable): ICollectable; override; - function TrueRemoveAll(const Item: ICollectable): ICollection; override; - public - constructor Create(NaturalItemsOnly: Boolean); override; - function GetDuplicates: Boolean; override; - procedure SetDuplicates(Value: Boolean); virtual; - function GetItem(Index: Integer): ICollectable; virtual; - procedure SetItem(Index: Integer; const Item: ICollectable); virtual; - function GetIterator: IIterator; override; - function GetNaturalItemIID: TGUID; override; - function GetSorted: Boolean; virtual; - procedure SetSorted(Value: Boolean); virtual; - function GetType: TCollectionType; override; - function CloneAsList: IList; virtual; - function Delete(Index: Integer): ICollectable; virtual; - procedure Exchange(Index1, Index2: Integer); virtual; - function First: ICollectable; virtual; - function IndexOf(const Item: ICollectable): Integer; virtual; - function Insert(Index: Integer; const Item: ICollectable): Boolean; overload; virtual; - function Insert(Index: Integer; const ItemArray: array of ICollectable): Integer; overload; virtual; - function Insert(Index: Integer; const Collection: ICollection): Integer; overload; virtual; - function IsNilAllowed: Boolean; override; - function Last: ICollectable; virtual; - function Search(const Item: ICollectable; const SearchComparator: IComparator = nil): TSearchResult; virtual; - procedure Sort(const SortComparator: IComparator = nil); overload; virtual; - procedure Sort(CompareFunc: TCollectionCompareFunc); overload; virtual; - property Duplicates: Boolean read GetDuplicates write SetDuplicates; - property Items[Index: Integer]: ICollectable read GetItem write SetItem; default; - property Sorted: Boolean read GetSorted write SetSorted; - end; - - TAbstractMap = class(TAbstractCollection, IMap) - private - FAssociationComparator: IAssociationComparator; - FKeyComparator: IComparator; - FNaturalKeysOnly: Boolean; - protected - function GetAssociationIterator: IMapIterator; virtual; abstract; - function GetKeyPosition(const Key: ICollectable): TCollectionPosition; virtual; abstract; - procedure InitFrom(const Collection: ICollection); override; - function TrueAdd(const Item: ICollectable): Boolean; override; - function TrueContains(const Item: ICollectable): Boolean; override; - function TrueGet(Position: TCollectionPosition): IAssociation; virtual; abstract; - function TruePut(Position: TCollectionPosition; const Association: IAssociation): IAssociation; virtual; abstract; - function TrueRemove(const Item: ICollectable): ICollectable; override; - function TrueRemove2(Position: TCollectionPosition): IAssociation; virtual; abstract; - function TrueRemoveAll(const Item: ICollectable): ICollection; override; - property AssociationComparator: IAssociationComparator read FAssociationComparator; - public - constructor Create; override; - constructor Create(NaturalItemsOnly: Boolean); override; - constructor Create(NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); overload; virtual; - constructor Create(const ItemArray: array of ICollectable); overload; override; - constructor Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); overload; override; - constructor Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); overload; virtual; - constructor Create(const KeyArray, ItemArray: array of ICollectable); overload; virtual; - constructor Create(const KeyArray, ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); overload; virtual; - constructor Create(const KeyArray, ItemArray: array of ICollectable; NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); overload; virtual; -// Don't use this parameter signature as it hits a compiler bug in D5. -// constructor Create(const KeyArray, ItemArray: TCollectableArray; NaturalItemsOnly: Boolean = false; NaturalKeysOnly: Boolean = true); overload; virtual; - constructor Create(const Map: IMap); overload; virtual; - destructor Destroy; override; - class function GetAlwaysNaturalKeys: Boolean; virtual; - function GetItem(const Key: ICollectable): ICollectable; virtual; - procedure SetItem(const Key, Item: ICollectable); virtual; - function GetIterator: IIterator; override; - function GetKeyComparator: IComparator; virtual; - procedure SetKeyComparator(const Value: IComparator); virtual; - function GetKeyIterator: IIterator; virtual; - function GetKeys: ISet; virtual; - function GetMapIterator: IMapIterator; virtual; - function GetMapIteratorByKey(const Filter: IFilter): IMapIterator; overload; virtual; - function GetMapIteratorByKey(FilterFunc: TCollectionFilterFunc): IMapIterator; overload; virtual; - function GetNaturalItemIID: TGUID; override; - function GetNaturalKeyIID: TGUID; virtual; - function GetNaturalKeysOnly: Boolean; virtual; - function GetType: TCollectionType; override; - function GetValues: ICollection; virtual; - function Clone: ICollection; override; - function CloneAsMap: IMap; virtual; - function ContainsKey(const Key: ICollectable): Boolean; overload; virtual; - function ContainsKey(const KeyArray: array of ICollectable): Boolean; overload; virtual; - function ContainsKey(const Collection: ICollection): Boolean; overload; virtual; - function Get(const Key: ICollectable): ICollectable; virtual; - function KeyAllowed(const Key: ICollectable): TCollectionError; virtual; - function IsNaturalKey(const Key: ICollectable): Boolean; virtual; - function IsNilAllowed: Boolean; override; - function MatchingKey(const KeyArray: array of ICollectable): ICollection; overload; virtual; - function MatchingKey(const Collection: ICollection): ICollection; overload; virtual; - function Put(const Item: ICollectable): ICollectable; overload; virtual; - function Put(const Key, Item: ICollectable): ICollectable; overload; virtual; - function Put(const ItemArray: array of ICollectable): ICollection; overload; virtual; - function Put(const Collection: ICollection): ICollection; overload; virtual; - function Put(const Map: IMap): ICollection; overload; virtual; - function RemoveKey(const Key: ICollectable): ICollectable; overload; virtual; - function RemoveKey(const KeyArray: array of ICollectable): ICollection; overload; virtual; - function RemoveKey(const Collection: ICollection): ICollection; overload; virtual; - function RetainKey(const KeyArray: array of ICollectable): ICollection; overload; virtual; - function RetainKey(const Collection: ICollection): ICollection; overload; virtual; - property KeyComparator: IComparator read GetKeyComparator write SetKeyComparator; - property Items[const Key: ICollectable]: ICollectable read GetItem write SetItem; default; - property NaturalKeyIID: TGUID read GetNaturalKeyIID; - property NaturalKeysOnly: Boolean read GetNaturalKeysOnly; - end; - - TAbstractIntegerMap = class(TAbstractCollection, IIntegerMap) - private - FAssociationComparator: IIntegerAssociationComparator; - protected - function GetAssociationIterator: IIntegerMapIterator; virtual; abstract; - function GetKeyPosition(const Key: Integer): TCollectionPosition; virtual; abstract; - function TrueAdd(const Item: ICollectable): Boolean; override; - function TrueContains(const Item: ICollectable): Boolean; override; - function TrueGet(Position: TCollectionPosition): IIntegerAssociation; virtual; abstract; - function TruePut(Position: TCollectionPosition; const Association: IIntegerAssociation): IIntegerAssociation; virtual; abstract; - function TrueRemove(const Item: ICollectable): ICollectable; override; - function TrueRemove2(Position: TCollectionPosition): IIntegerAssociation; virtual; abstract; - function TrueRemoveAll(const Item: ICollectable): ICollection; override; - property AssociationComparator: IIntegerAssociationComparator read FAssociationComparator; - public - constructor Create(NaturalItemsOnly: Boolean); override; - constructor Create(const ItemArray: array of ICollectable); overload; override; - constructor Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); overload; override; - constructor Create(const KeyArray: array of Integer; const ItemArray: array of ICollectable); overload; virtual; - constructor Create(const KeyArray: array of Integer; const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); overload; virtual; - constructor Create(const Map: IIntegerMap); overload; virtual; - destructor Destroy; override; - function GetItem(const Key: Integer): ICollectable; virtual; - procedure SetItem(const Key: Integer; const Item: ICollectable); virtual; - function GetIterator: IIterator; override; - function GetKeys: ISet; virtual; - function GetMapIterator: IIntegerMapIterator; virtual; - function GetNaturalItemIID: TGUID; override; - function GetType: TCollectionType; override; - function GetValues: ICollection; virtual; - function Clone: ICollection; override; - function CloneAsIntegerMap: IIntegerMap; virtual; - function ContainsKey(const Key: Integer): Boolean; overload; virtual; - function ContainsKey(const KeyArray: array of Integer): Boolean; overload; virtual; - function Get(const Key: Integer): ICollectable; virtual; - function IsNilAllowed: Boolean; override; - function Put(const Item: ICollectable): ICollectable; overload; virtual; - function Put(const Key: Integer; const Item: ICollectable): ICollectable; overload; virtual; - function Put(const ItemArray: array of ICollectable): ICollection; overload; virtual; - function Put(const Collection: ICollection): ICollection; overload; virtual; - function Put(const Map: IIntegerMap): ICollection; overload; virtual; - function RemoveKey(const Key: Integer): ICollectable; overload; virtual; - function RemoveKey(const KeyArray: array of Integer): ICollection; overload; virtual; - function RetainKey(const KeyArray: array of Integer): ICollection; overload; virtual; - property Items[const Key: Integer]: ICollectable read GetItem write SetItem; default; - end; - - TAbstractStringMap = class(TAbstractCollection, IStringMap) - private - FAssociationComparator: IStringAssociationComparator; - protected - function GetAssociationIterator: IStringMapIterator; virtual; abstract; - function GetKeyPosition(const Key: String): TCollectionPosition; virtual; abstract; - function TrueAdd(const Item: ICollectable): Boolean; override; - function TrueContains(const Item: ICollectable): Boolean; override; - function TrueGet(Position: TCollectionPosition): IStringAssociation; virtual; abstract; - function TruePut(Position: TCollectionPosition; const Association: IStringAssociation): IStringAssociation; virtual; abstract; - function TrueRemove(const Item: ICollectable): ICollectable; override; - function TrueRemove2(Position: TCollectionPosition): IStringAssociation; virtual; abstract; - function TrueRemoveAll(const Item: ICollectable): ICollection; override; - property AssociationComparator: IStringAssociationComparator read FAssociationComparator; - public - constructor Create(NaturalItemsOnly: Boolean); override; - constructor Create(const ItemArray: array of ICollectable); overload; override; - constructor Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); overload; override; - constructor Create(const KeyArray: array of String; const ItemArray: array of ICollectable); overload; virtual; - constructor Create(const KeyArray: array of String; const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); overload; virtual; - constructor Create(const Map: IStringMap); overload; virtual; - destructor Destroy; override; - function GetItem(const Key: String): ICollectable; virtual; - procedure SetItem(const Key: String; const Item: ICollectable); virtual; - function GetIterator: IIterator; override; - function GetKeys: ISet; virtual; - function GetMapIterator: IStringMapIterator; virtual; - function GetNaturalItemIID: TGUID; override; - function GetType: TCollectionType; override; - function GetValues: ICollection; virtual; - function Clone: ICollection; override; - function CloneAsStringMap: IStringMap; virtual; - function ContainsKey(const Key: String): Boolean; overload; virtual; - function ContainsKey(const KeyArray: array of String): Boolean; overload; virtual; - function Get(const Key: String): ICollectable; virtual; - function IsNilAllowed: Boolean; override; - function Put(const Item: ICollectable): ICollectable; overload; virtual; - function Put(const Key: String; const Item: ICollectable): ICollectable; overload; virtual; - function Put(const ItemArray: array of ICollectable): ICollection; overload; virtual; - function Put(const Collection: ICollection): ICollection; overload; virtual; - function Put(const Map: IStringMap): ICollection; overload; virtual; - function RemoveKey(const Key: String): ICollectable; overload; virtual; - function RemoveKey(const KeyArray: array of String): ICollection; overload; virtual; - function RetainKey(const KeyArray: array of String): ICollection; overload; virtual; - property Items[const Key: String]: ICollectable read GetItem write SetItem; default; - end; - - TAbstractCollectionClass = class of TAbstractCollection; - TAbstractBagClass = class of TAbstractBag; - TAbstractSetClass = class of TAbstractSet; - TAbstractListClass = class of TAbstractList; - TAbstractMapClass = class of TAbstractMap; - TAbstractIntegerMapClass = class of TAbstractIntegerMap; - TAbstractStringMapClass = class of TAbstractStringMap; - - TAbstractIterator = class(TInterfacedObject, IIterator) - private - FAllowRemoval: Boolean; - FEOF: Boolean; - FItem: ICollectable; - protected - constructor Create(AllowRemoval: Boolean = true); - function TrueFirst: ICollectable; virtual; abstract; - function TrueNext: ICollectable; virtual; abstract; - procedure TrueRemove; virtual; abstract; - public - procedure AfterConstruction; override; - function GetAllowRemoval: Boolean; virtual; - function CurrentItem: ICollectable; virtual; - function EOF: Boolean; virtual; - function First: ICollectable; virtual; - function Next: ICollectable; virtual; - function Remove: Boolean; virtual; - property AllowRemoval: Boolean read GetAllowRemoval; - end; - - TAbstractListIterator = class(TAbstractIterator) - private - FCollection: TAbstractList; - FIndex: Integer; - protected - constructor Create(Collection: TAbstractList); - function TrueFirst: ICollectable; override; - function TrueNext: ICollectable; override; - procedure TrueRemove; override; - end; - - TAbstractMapIterator = class(TAbstractIterator, IMapIterator) - public - function CurrentKey: ICollectable; virtual; abstract; - end; - - TAbstractAssociationIterator = class(TInterfacedObject, IIterator, IMapIterator) - private - FAllowRemoval: Boolean; - FEOF: Boolean; - FAssociation: IAssociation; - protected - constructor Create(AllowRemoval: Boolean = true); - function TrueFirst: IAssociation; virtual; abstract; - function TrueNext: IAssociation; virtual; abstract; - procedure TrueRemove; virtual; abstract; - public - procedure AfterConstruction; override; - function GetAllowRemoval: Boolean; virtual; - function CurrentKey: ICollectable; virtual; - function CurrentItem: ICollectable; virtual; - function EOF: Boolean; virtual; - function First: ICollectable; virtual; - function Next: ICollectable; virtual; - function Remove: Boolean; virtual; - property AllowRemoval: Boolean read GetAllowRemoval; - end; - - TAbstractIntegerAssociationIterator = class(TInterfacedObject, IIterator, IIntegerMapIterator) - private - FAllowRemoval: Boolean; - FEOF: Boolean; - FAssociation: IIntegerAssociation; - protected - constructor Create(AllowRemoval: Boolean = true); - function TrueFirst: IIntegerAssociation; virtual; abstract; - function TrueNext: IIntegerAssociation; virtual; abstract; - procedure TrueRemove; virtual; abstract; - public - procedure AfterConstruction; override; - function GetAllowRemoval: Boolean; virtual; - function CurrentKey: Integer; virtual; - function CurrentItem: ICollectable; virtual; - function EOF: Boolean; virtual; - function First: ICollectable; virtual; - function Next: ICollectable; virtual; - function Remove: Boolean; virtual; - property AllowRemoval: Boolean read GetAllowRemoval; - end; - - TAbstractStringAssociationIterator = class(TInterfacedObject, IIterator, IStringMapIterator) - private - FAllowRemoval: Boolean; - FEOF: Boolean; - FAssociation: IStringAssociation; - protected - constructor Create(AllowRemoval: Boolean = true); - function TrueFirst: IStringAssociation; virtual; abstract; - function TrueNext: IStringAssociation; virtual; abstract; - procedure TrueRemove; virtual; abstract; - public - procedure AfterConstruction; override; - function GetAllowRemoval: Boolean; virtual; - function CurrentKey: String; virtual; - function CurrentItem: ICollectable; virtual; - function EOF: Boolean; virtual; - function First: ICollectable; virtual; - function Next: ICollectable; virtual; - function Remove: Boolean; virtual; - property AllowRemoval: Boolean read GetAllowRemoval; - end; - - TAssociationIterator = class(TAbstractIterator, IMapIterator) - private - FIterator: IIterator; - protected - function TrueFirst: ICollectable; override; - function TrueNext: ICollectable; override; - procedure TrueRemove; override; - public - constructor Create(const Iterator: IIterator); - destructor Destroy; override; - function CurrentItem: ICollectable; override; - function CurrentKey: ICollectable; virtual; - end; - - TAssociationKeyIterator = class(TAbstractIterator) - private - FIterator: IMapIterator; - protected - function TrueFirst: ICollectable; override; - function TrueNext: ICollectable; override; - procedure TrueRemove; override; - public - constructor Create(const Iterator: IMapIterator); - destructor Destroy; override; - end; - - TAbstractFilter = class(TInterfacedObject, IFilter) - public - function Accept(const Item: ICollectable): Boolean; virtual; abstract; - end; - - TFilterIterator = class(TAbstractIterator) - private - FIterator: IIterator; - FFilter: IFilter; - protected - function TrueFirst: ICollectable; override; - function TrueNext: ICollectable; override; - procedure TrueRemove; override; - public - constructor Create(const Iterator: IIterator; const Filter: IFilter; AllowRemoval: Boolean = true); virtual; - destructor Destroy; override; - end; - - TFilterFuncIterator = class(TAbstractIterator) - private - FIterator: IIterator; - FFilterFunc: TCollectionFilterFunc; - protected - function TrueFirst: ICollectable; override; - function TrueNext: ICollectable; override; - procedure TrueRemove; override; - public - constructor Create(const Iterator: IIterator; FilterFunc: TCollectionFilterFunc; AllowRemoval: Boolean = true); virtual; - destructor Destroy; override; - end; - - TKeyFilterMapIterator = class(TAbstractMapIterator) - private - FIterator: IMapIterator; - FFilter: IFilter; - protected - function TrueFirst: ICollectable; override; - function TrueNext: ICollectable; override; - procedure TrueRemove; override; - public - constructor Create(const Iterator: IMapIterator; const Filter: IFilter; AllowRemoval: Boolean = true); virtual; - destructor Destroy; override; - function CurrentKey: ICollectable; override; - end; - - TKeyFilterFuncMapIterator = class(TAbstractMapIterator) - private - FIterator: IMapIterator; - FFilterFunc: TCollectionFilterFunc; - protected - function TrueFirst: ICollectable; override; - function TrueNext: ICollectable; override; - procedure TrueRemove; override; - public - constructor Create(const Iterator: IMapIterator; FilterFunc: TCollectionFilterFunc; AllowRemoval: Boolean = true); virtual; - destructor Destroy; override; - function CurrentKey: ICollectable; override; - end; - - - ECollectionError = class(Exception) - private - FCollection: ICollection; - FErrorType: TCollectionError; - public - constructor Create(const Msg: String; const Collection: ICollection; ErrorType: TCollectionError); - property Collection: ICollection read FCollection; - property ErrorType: TCollectionError read FErrorType; - end; - -implementation - -uses - Math, - CollArray, CollHash, CollList, CollPArray, CollWrappers; - -var - FDefaultComparator: IComparator; - FNaturalComparator: IComparator; - FReverseNaturalComparator: IComparator; - -{ TCollectionPosition } -constructor TCollectionPosition.Create(Found: Boolean); -begin - FFound := Found; -end; - -{ TAbstractComparator } -class function TAbstractComparator.GetDefaultComparator: IComparator; -begin - if FDefaultComparator = nil then - FDefaultComparator := TDefaultComparator.Create; - Result := FDefaultComparator; -end; - -class function TAbstractComparator.GetNaturalComparator: IComparator; -begin - if FNaturalComparator = nil then - FNaturalComparator := TNaturalComparator.Create; - Result := FNaturalComparator; -end; - -class function TAbstractComparator.GetReverseNaturalComparator: IComparator; -begin - if FReverseNaturalComparator = nil then - FReverseNaturalComparator := TReverseNaturalComparator.Create; - Result := FReverseNaturalComparator; -end; - -function TAbstractComparator.GetInstance: TObject; -begin - Result := Self; -end; - -function TAbstractComparator.Equals(const Comparator: IComparator): Boolean; -begin - Result := (Self = Comparator.GetInstance); -end; - -{ TDefaultComparator } -constructor TDefaultComparator.Create; -begin - // Empty -end; - -function TDefaultComparator.Compare(const Item1, Item2: ICollectable): Integer; -var - Value1, Value2: Integer; -begin - if Item1 <> nil then - Value1 := Integer(Pointer(Item1)) - else - Value1 := Low(Integer); - if Item2 <> nil then - Value2 := Integer(Pointer(Item2)) - else - Value2 := Low(Integer); - if (Value1 < Value2) then - Result := -1 - else if (Value1 > Value2) then - Result := 1 - else - Result := 0; -end; - -function TDefaultComparator.Equals(const Item1, Item2: ICollectable): Boolean; -begin - Result := (Item1 = Item2); -end; - -{ TNaturalComparator } -constructor TNaturalComparator.Create; -begin - // Empty -end; - -function TNaturalComparator.Compare(const Item1, Item2: ICollectable): Integer; -begin - if (Item1 = nil) and (Item2 <> nil) then - Result := -1 - else if (Item1 <> nil) and (Item2 = nil) then - Result := 1 - else if (Item1 = nil) and (Item2 = nil) then - Result := 0 - else - Result := (Item1 as IComparable).CompareTo(Item2); -end; - -function TNaturalComparator.Equals(const Item1, Item2: ICollectable): Boolean; -begin - if (Item1 = nil) or (Item2 = nil) then - Result := (Item1 = Item2) - else - begin - Result := (Item1 as IEquatable).Equals(Item2); - end; -end; - -{ TReverseNaturalComparator } -constructor TReverseNaturalComparator.Create; -begin - // Empty -end; - -function TReverseNaturalComparator.Compare(const Item1, Item2: ICollectable): Integer; -begin - if (Item1 = nil) and (Item2 <> nil) then - Result := 1 - else if (Item1 <> nil) and (Item2 = nil) then - Result := -1 - else if (Item1 = nil) and (Item2 = nil) then - Result := 0 - else - Result := -(Item1 as IComparable).CompareTo(Item2); -end; - -function TReverseNaturalComparator.Equals(const Item1, Item2: ICollectable): Boolean; -begin - if (Item1 = nil) or (Item2 = nil) then - Result := (Item1 = Item2) - else - Result := (Item1 as IEquatable).Equals(Item2); -end; - -{ TAssociation } -constructor TAssociation.Create(const Key, Value: ICollectable); -begin - FKey := Key; - FValue := Value; -end; - -destructor TAssociation.Destroy; -begin - FKey := nil; - FValue := nil; - inherited Destroy; -end; - -function TAssociation.GetInstance: TObject; -begin - Result := Self; -end; - -function TAssociation.GetKey: ICollectable; -begin - Result := FKey; -end; - -function TAssociation.GetValue: ICollectable; -begin - Result := FValue; -end; - - -{ TIntegerAssociation } -constructor TIntegerAssociation.Create(const Key: Integer; const Value: ICollectable); -begin - FKey := Key; - FValue := Value; -end; - -destructor TIntegerAssociation.Destroy; -begin - FValue := nil; - inherited Destroy; -end; - -function TIntegerAssociation.GetInstance: TObject; -begin - Result := Self; -end; - -function TIntegerAssociation.GetKey: Integer; -begin - Result := FKey; -end; - -function TIntegerAssociation.GetValue: ICollectable; -begin - Result := FValue; -end; - - -{ TStringAssociation } -constructor TStringAssociation.Create(const Key: String; const Value: ICollectable); -begin - FKey := Key; - FValue := Value; -end; - -destructor TStringAssociation.Destroy; -begin - FValue := nil; - inherited Destroy; -end; - -function TStringAssociation.GetInstance: TObject; -begin - Result := Self; -end; - -function TStringAssociation.GetKey: String; -begin - Result := FKey; -end; - -function TStringAssociation.GetValue: ICollectable; -begin - Result := FValue; -end; - - -{ TAbstractIterator } -constructor TAbstractIterator.Create(AllowRemoval: Boolean); -begin - inherited Create; - FAllowRemoval := AllowRemoval; - FEOF := true; - FItem := nil; -end; - -procedure TAbstractIterator.AfterConstruction; -begin - inherited AfterConstruction; - First; -end; - -function TAbstractIterator.GetAllowRemoval: Boolean; -begin - Result := FAllowRemoval; -end; - -function TAbstractIterator.CurrentItem: ICollectable; -begin - Result := FItem; -end; - -function TAbstractIterator.EOF: Boolean; -begin - Result := FEOF; -end; - -function TAbstractIterator.First: ICollectable; -begin - FEOF := false; - FItem := TrueFirst; - if FItem = nil then - FEOF := true; - Result := FItem; -end; - -function TAbstractIterator.Next: ICollectable; -begin - if not FEOF then - begin - FItem := TrueNext; - if FItem = nil then - FEOF := true; - end; - Result := FItem; -end; - -function TAbstractIterator.Remove: Boolean; -begin - if (FItem <> nil) and FAllowRemoval then - begin - TrueRemove; - FItem := nil; - Result := true; - end - else - Result := false; -end; - -{ TAbstractAssociationIterator } -constructor TAbstractAssociationIterator.Create(AllowRemoval: Boolean); -begin - inherited Create; - FAllowRemoval := AllowRemoval; - FEOF := true; - FAssociation := nil; -end; - -procedure TAbstractAssociationIterator.AfterConstruction; -begin - inherited AfterConstruction; - First; -end; - -function TAbstractAssociationIterator.GetAllowRemoval: Boolean; -begin - Result := FAllowRemoval; -end; - -function TAbstractAssociationIterator.CurrentKey: ICollectable; -begin - if FAssociation <> nil then - Result := FAssociation.GetKey - else - Result := nil; -end; - -function TAbstractAssociationIterator.CurrentItem: ICollectable; -begin - if FAssociation <> nil then - Result := FAssociation.GetValue - else - Result := nil; -end; - -function TAbstractAssociationIterator.EOF: Boolean; -begin - Result := FEOF; -end; - -function TAbstractAssociationIterator.First: ICollectable; -begin - FAssociation := TrueFirst; - if FAssociation <> nil then - begin - Result := FAssociation.GetValue; - FEOF := false; - end - else - begin - Result := nil; - FEOF := true; - end; -end; - -function TAbstractAssociationIterator.Next: ICollectable; -begin - if not FEOF then - begin - FAssociation := TrueNext; - if FAssociation <> nil then - Result := FAssociation.GetValue - else - begin - Result := nil; - FEOF := true; - end; - end; -end; - -function TAbstractAssociationIterator.Remove: Boolean; -begin - if (FAssociation <> nil) and FAllowRemoval then - begin - TrueRemove; - FAssociation := nil; - Result := true; - end - else - Result := false; -end; - -{ TAbstractIntegerAssociationIterator } -constructor TAbstractIntegerAssociationIterator.Create(AllowRemoval: Boolean); -begin - inherited Create; - FAllowRemoval := AllowRemoval; - FEOF := true; - FAssociation := nil; -end; - -procedure TAbstractIntegerAssociationIterator.AfterConstruction; -begin - inherited AfterConstruction; - First; -end; - -function TAbstractIntegerAssociationIterator.GetAllowRemoval: Boolean; -begin - Result := FAllowRemoval; -end; - -function TAbstractIntegerAssociationIterator.CurrentKey: Integer; -begin - if FAssociation <> nil then - Result := FAssociation.GetKey - else - Result := 0; -end; - -function TAbstractIntegerAssociationIterator.CurrentItem: ICollectable; -begin - if FAssociation <> nil then - Result := FAssociation.GetValue - else - Result := nil; -end; - -function TAbstractIntegerAssociationIterator.EOF: Boolean; -begin - Result := FEOF; -end; - -function TAbstractIntegerAssociationIterator.First: ICollectable; -begin - FAssociation := TrueFirst; - if FAssociation <> nil then - begin - Result := FAssociation.GetValue; - FEOF := false; - end - else - begin - Result := nil; - FEOF := true; - end; -end; - -function TAbstractIntegerAssociationIterator.Next: ICollectable; -begin - if not FEOF then - begin - FAssociation := TrueNext; - if FAssociation <> nil then - Result := FAssociation.GetValue - else - begin - Result := nil; - FEOF := true; - end; - end; -end; - -function TAbstractIntegerAssociationIterator.Remove: Boolean; -begin - if (FAssociation <> nil) and FAllowRemoval then - begin - TrueRemove; - FAssociation := nil; - Result := true; - end - else - Result := false; -end; - -{ TAbstractStringAssociationIterator } -constructor TAbstractStringAssociationIterator.Create(AllowRemoval: Boolean); -begin - inherited Create; - FAllowRemoval := AllowRemoval; - FEOF := true; - FAssociation := nil; -end; - -procedure TAbstractStringAssociationIterator.AfterConstruction; -begin - inherited AfterConstruction; - First; -end; - -function TAbstractStringAssociationIterator.GetAllowRemoval: Boolean; -begin - Result := FAllowRemoval; -end; - -function TAbstractStringAssociationIterator.CurrentKey: String; -begin - if FAssociation <> nil then - Result := FAssociation.GetKey - else - Result := ''; -end; - -function TAbstractStringAssociationIterator.CurrentItem: ICollectable; -begin - if FAssociation <> nil then - Result := FAssociation.GetValue - else - Result := nil; -end; - -function TAbstractStringAssociationIterator.EOF: Boolean; -begin - Result := FEOF; -end; - -function TAbstractStringAssociationIterator.First: ICollectable; -begin - FAssociation := TrueFirst; - if FAssociation <> nil then - begin - Result := FAssociation.GetValue; - FEOF := false; - end - else - begin - Result := nil; - FEOF := true; - end; -end; - -function TAbstractStringAssociationIterator.Next: ICollectable; -begin - if not FEOF then - begin - FAssociation := TrueNext; - if FAssociation <> nil then - Result := FAssociation.GetValue - else - begin - Result := nil; - FEOF := true; - end; - end; -end; - -function TAbstractStringAssociationIterator.Remove: Boolean; -begin - if (FAssociation <> nil) and FAllowRemoval then - begin - TrueRemove; - FAssociation := nil; - Result := true; - end - else - Result := false; -end; - -{ TAssociationIterator } -constructor TAssociationIterator.Create(const Iterator: IIterator); -begin - inherited Create(Iterator.GetAllowRemoval); - FIterator := Iterator; -end; - -destructor TAssociationIterator.Destroy; -begin - FIterator := nil; - inherited Destroy; -end; - -function TAssociationIterator.TrueFirst: ICollectable; -var - Association: IAssociation; -begin - Association := FIterator.First as IAssociation; - if Association <> nil then - Result := Association.GetValue - else - Result := nil; -end; - -function TAssociationIterator.TrueNext: ICollectable; -var - Association: IAssociation; -begin - Association := (FIterator.Next as IAssociation); - if Association <> nil then - Result := Association.GetValue - else - Result := nil; -end; - -procedure TAssociationIterator.TrueRemove; -begin - FIterator.Remove; -end; - -function TAssociationIterator.CurrentItem: ICollectable; -var - Association: IAssociation; -begin - Association := FIterator.CurrentItem as IAssociation; - if Association <> nil then - Result := Association.GetValue - else - Result := nil; -end; - -function TAssociationIterator.CurrentKey: ICollectable; -var - Association: IAssociation; -begin - Association := FIterator.CurrentItem as IAssociation; - if Association <> nil then - Result := Association.GetKey - else - Result := nil; -end; - -{ TAssociationComparator } -constructor TAssociationComparator.Create(NaturalKeys: Boolean); -begin - inherited Create; - if NaturalKeys then - FKeyComparator := TAbstractComparator.GetNaturalComparator - else - FKeyComparator := TAbstractComparator.GetDefaultComparator; -end; - -destructor TAssociationComparator.Destroy; -begin - FKeyComparator := nil; - inherited Destroy; -end; - -function TAssociationComparator.GetKeyComparator: IComparator; -begin - Result := FKeyComparator; -end; - -procedure TAssociationComparator.SetKeyComparator(Value: IComparator); -begin - FKeyComparator := Value; -end; - -function TAssociationComparator.Compare(const Item1, Item2: ICollectable): Integer; -begin - Result := KeyComparator.Compare((Item1 as IAssociation).GetKey, (Item2 as IAssociation).GetKey); -end; - -function TAssociationComparator.Equals(const Item1, Item2: ICollectable): Boolean; -begin - Result := KeyComparator.Equals((Item1 as IAssociation).GetKey, (Item2 as IAssociation).GetKey); -end; - -{ TIntegerAssociationComparator } -constructor TIntegerAssociationComparator.Create; -begin - inherited Create; -end; - -destructor TIntegerAssociationComparator.Destroy; -begin - inherited Destroy; -end; - -function TIntegerAssociationComparator.Compare(const Item1, Item2: ICollectable): Integer; -var - Key1, Key2: Integer; -begin - Key1 := (Item1 as IIntegerAssociation).GetKey; - Key2 := (Item2 as IIntegerAssociation).GetKey; - if Key1 < Key2 then - Result := -1 - else if Key1 > Key2 then - Result := 1 - else - Result := 0; -end; - -function TIntegerAssociationComparator.Equals(const Item1, Item2: ICollectable): Boolean; -begin - Result := ((Item1 as IIntegerAssociation).GetKey = (Item2 as IIntegerAssociation).GetKey); -end; - -{ TStringAssociationComparator } -constructor TStringAssociationComparator.Create; -begin - inherited Create; -end; - -destructor TStringAssociationComparator.Destroy; -begin - inherited Destroy; -end; - -function TStringAssociationComparator.Compare(const Item1, Item2: ICollectable): Integer; -var - Key1, Key2: String; -begin - Key1 := (Item1 as IStringAssociation).GetKey; - Key2 := (Item2 as IStringAssociation).GetKey; - if Key1 < Key2 then - Result := -1 - else if Key1 > Key2 then - Result := 1 - else - Result := 0; -end; - -function TStringAssociationComparator.Equals(const Item1, Item2: ICollectable): Boolean; -begin - Result := ((Item1 as IStringAssociation).GetKey = (Item2 as IStringAssociation).GetKey); -end; - -{ TAssociationKeyIterator } -constructor TAssociationKeyIterator.Create(const Iterator: IMapIterator); -begin - inherited Create(Iterator.GetAllowRemoval); - FIterator := Iterator; -end; - -destructor TAssociationKeyIterator.Destroy; -begin - FIterator := nil; - inherited Destroy; -end; - -function TAssociationKeyIterator.TrueFirst: ICollectable; -begin - FIterator.First; - Result := FIterator.CurrentKey; -end; - -function TAssociationKeyIterator.TrueNext: ICollectable; -begin - FIterator.Next; - Result := FIterator.CurrentKey; -end; - -procedure TAssociationKeyIterator.TrueRemove; -begin - FIterator.Remove; -end; - -{ TFilterIterator } -constructor TFilterIterator.Create(const Iterator: IIterator; const Filter: IFilter; AllowRemoval: Boolean = true); -begin - FIterator := Iterator; - FFilter := Filter; -end; - -destructor TFilterIterator.Destroy; -begin - FIterator := nil; - FFilter := nil; -end; - -function TFilterIterator.TrueFirst: ICollectable; -var - Item: ICollectable; -begin - Item := FIterator.First; - while not FIterator.EOF do - begin - if FFilter.Accept(Item) then - break - else - Item := FIterator.Next; - end; - Result := Item; -end; - -function TFilterIterator.TrueNext: ICollectable; -var - Item: ICollectable; -begin - Item := FIterator.Next; - while not FIterator.EOF do - begin - if FFilter.Accept(Item) then - break - else - Item := FIterator.Next; - end; - Result := Item; -end; - -procedure TFilterIterator.TrueRemove; -begin - FIterator.Remove; -end; - -{ TFilterFuncIterator } -constructor TFilterFuncIterator.Create(const Iterator: IIterator; FilterFunc: TCollectionFilterFunc; AllowRemoval: Boolean = true); -begin - FIterator := Iterator; - FFilterFunc := FilterFunc; -end; - -destructor TFilterFuncIterator.Destroy; -begin - FIterator := nil; - FFilterFunc := nil; -end; - -function TFilterFuncIterator.TrueFirst: ICollectable; -var - Item: ICollectable; -begin - Item := FIterator.First; - while not FIterator.EOF do - begin - if FFilterFunc(Item) then - break - else - Item := FIterator.Next; - end; - Result := Item; -end; - -function TFilterFuncIterator.TrueNext: ICollectable; -var - Item: ICollectable; -begin - Item := FIterator.Next; - while not FIterator.EOF do - begin - if FFilterFunc(Item) then - break - else - Item := FIterator.Next; - end; - Result := Item; -end; - -procedure TFilterFuncIterator.TrueRemove; -begin - FIterator.Remove; -end; - -{ TKeyFilterMapIterator } -constructor TKeyFilterMapIterator.Create(const Iterator: IMapIterator; const Filter: IFilter; AllowRemoval: Boolean = true); -begin - FIterator := Iterator; - FFilter := Filter; -end; - -destructor TKeyFilterMapIterator.Destroy; -begin - FIterator := nil; - FFilter := nil; -end; - -function TKeyFilterMapIterator.TrueFirst: ICollectable; -var - Key, Item: ICollectable; -begin - Item := FIterator.First; - while not FIterator.EOF do - begin - Key := FIterator.CurrentKey; - if FFilter.Accept(Key) then - break - else - Item := FIterator.Next; - end; - Result := Item; -end; - -function TKeyFilterMapIterator.TrueNext: ICollectable; -var - Key, Item: ICollectable; -begin - Item := FIterator.Next; - while not FIterator.EOF do - begin - Key := FIterator.CurrentKey; - if FFilter.Accept(Key) then - break - else - Item := FIterator.Next; - end; - Result := Item; -end; - -procedure TKeyFilterMapIterator.TrueRemove; -begin - FIterator.Remove; -end; - -function TKeyFilterMapIterator.CurrentKey: ICollectable; -begin - Result := FIterator.CurrentKey; -end; - -{ TKeyFilterFuncMapIterator } -constructor TKeyFilterFuncMapIterator.Create(const Iterator: IMapIterator; FilterFunc: TCollectionFilterFunc; AllowRemoval: Boolean = true); -begin - FIterator := Iterator; - FFilterFunc := FilterFunc; -end; - -destructor TKeyFilterFuncMapIterator.Destroy; -begin - FIterator := nil; - FFilterFunc := nil; -end; - -function TKeyFilterFuncMapIterator.TrueFirst: ICollectable; -var - Key, Item: ICollectable; -begin - Item := FIterator.First; - while not FIterator.EOF do - begin - Key := FIterator.CurrentKey; - if FFilterFunc(Key) then - break - else - Item := FIterator.Next; - end; - Result := Item; -end; - -function TKeyFilterFuncMapIterator.TrueNext: ICollectable; -var - Key, Item: ICollectable; -begin - Item := FIterator.Next; - while not FIterator.EOF do - begin - Key := FIterator.CurrentKey; - if FFilterFunc(Key) then - break - else - Item := FIterator.Next; - end; - Result := Item; -end; - -procedure TKeyFilterFuncMapIterator.TrueRemove; -begin - FIterator.Remove; -end; - -function TKeyFilterFuncMapIterator.CurrentKey: ICollectable; -begin - Result := FIterator.CurrentKey; -end; - - -{ TAbstractCollection } -constructor TAbstractCollection.Create; -begin - Create(false); -end; - -constructor TAbstractCollection.Create(NaturalItemsOnly: Boolean); -begin - FCreated := false; - inherited Create; - FNaturalItemsOnly := NaturalItemsOnly or GetAlwaysNaturalItems; - if FNaturalItemsOnly then - FComparator := TAbstractComparator.GetNaturalComparator - else - FComparator := TAbstractComparator.GetDefaultComparator; - FIgnoreErrors := [ceDuplicate]; -end; - -constructor TAbstractCollection.Create(const ItemArray: array of ICollectable); -begin - Create(ItemArray, false); -end; - -// Fixed size collections must override this. -constructor TAbstractCollection.Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); -var - I: Integer; -begin - Create(NaturalItemsOnly); - if not FixedSize then - begin - Capacity := Length(ItemArray); - for I := Low(ItemArray) to High(ItemArray) do - begin - Add(ItemArray[I]); - end; - end; -end; - -// Fixed size collections must override this. -constructor TAbstractCollection.Create(const Collection: ICollection); -var - Iterator: IIterator; -begin - Create(Collection.GetNaturalItemsOnly); - InitFrom(Collection); - if not FixedSize then - begin - Capacity := Collection.GetSize; - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Add(Iterator.CurrentItem); - Iterator.Next; - end; - end; -end; - -destructor TAbstractCollection.Destroy; -begin - FCreated := false; - FComparator := nil; - inherited Destroy; -end; - -procedure TAbstractCollection.CollectionError(ErrorType: TCollectionError); -var - Msg: String; -begin - if not (ErrorType in FIgnoreErrors) then - begin - case ErrorType of - ceDuplicate: Msg := 'Collection does not allow duplicates.'; - ceDuplicateKey: Msg := 'Collection does not allow duplicate keys.'; - ceFixedSize: Msg := 'Collection has fixed size.'; - ceNilNotAllowed: Msg := 'Collection does not allow nil.'; - ceNotNaturalItem: Msg := 'Collection only accepts natural items.'; - ceOutOfRange: Msg := 'Index out of collection range.'; - end; - // If exception is thrown during construction, collection cannot be - // passed to it as destructor is automatically called and this leaves an - // interface reference to a destroyed object and crashes. - if FCreated then - raise ECollectionError.Create(Msg, Self, ErrorType) - else - raise ECollectionError.Create(Msg, nil, ErrorType); - end; -end; - -procedure TAbstractCollection.InitFrom(const Collection: ICollection); -begin - Comparator := Collection.GetComparator; - IgnoreErrors := Collection.GetIgnoreErrors; -end; - -// Implementations should override this if possible -function TAbstractCollection.TrueItemCount(const Item: ICollectable): Integer; -var - Iterator: IIterator; - Total: Integer; -begin - Total := 0; - Iterator := GetIterator; - while not Iterator.EOF do - begin - if FComparator.Equals(Item, Iterator.CurrentItem) then - Inc(Total); - Iterator.Next; - end; - Result := Total; -end; - -class function TAbstractCollection.GetAlwaysNaturalItems: Boolean; -begin - Result := false; -end; - -function TAbstractCollection.GetAsArray: TCollectableArray; -var - Iterator: IIterator; - Working: TCollectableArray; - I: Integer; -begin - SetLength(Working, Size); - I := 0; - Iterator := GetIterator; - while not Iterator.EOF do - begin - Working[I] := Iterator.CurrentItem; - Inc(I); - Iterator.Next; - end; - Result := Working; -end; - -function TAbstractCollection.GetComparator: IComparator; -begin - Result := FComparator; -end; - -function TAbstractCollection.GetDuplicates: Boolean; -begin - Result := true; // Sets and lists override this. -end; - -procedure TAbstractCollection.SetComparator(const Value: IComparator); -begin - if Value = nil then - begin - if NaturalItemsOnly then - FComparator := TAbstractComparator.GetNaturalComparator - else - FComparator := TAbstractComparator.GetDefaultComparator; - end - else - FComparator := Value; -end; - -function TAbstractCollection.GetFixedSize: Boolean; -begin - Result := false; -end; - -function TAbstractCollection.GetIgnoreErrors: TCollectionErrors; -begin - Result := FIgnoreErrors; -end; - -procedure TAbstractCollection.SetIgnoreErrors(Value: TCollectionErrors); -begin - FIgnoreErrors := Value; -end; - -function TAbstractCollection.GetInstance: TObject; -begin - Result := Self; -end; - -function TAbstractCollection.GetIterator(const Filter: IFilter): IIterator; -var - Iterator: IIterator; -begin - Iterator := GetIterator; - Result := TFilterIterator.Create(Iterator, Filter, Iterator.GetAllowRemoval); -end; - -function TAbstractCollection.GetIterator(FilterFunc: TCollectionFilterFunc): IIterator; -var - Iterator: IIterator; -begin - Iterator := GetIterator; - Result := TFilterFuncIterator.Create(Iterator, FilterFunc, Iterator.GetAllowRemoval); -end; - -function TAbstractCollection.GetNaturalItemsOnly: Boolean; -begin - Result := FNaturalItemsOnly; -end; - -function TAbstractCollection.Add(const Item: ICollectable): Boolean; -var - ItemError: TCollectionError; - Success: Boolean; -begin - ItemError := ItemAllowed(Item); // Can be natural items only error or nil not allowed error - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Success := false; - end - else if FixedSize then - begin - CollectionError(ceFixedSize); - Success := false; - end - else - begin - Success := TrueAdd(Item); - end; - Result := Success; -end; - -function TAbstractCollection.Add(const ItemArray: array of ICollectable): Integer; -var - Item: ICollectable; - ItemError: TCollectionError; - I, Count: Integer; - Success: Boolean; -begin - Count := 0; - if FixedSize then - begin - CollectionError(ceFixedSize); - end - else - begin - for I := Low(ItemArray) to High(ItemArray) do - begin - Item := ItemArray[I]; - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Success := false; - end - else - begin - Success := TrueAdd(Item); - end; - if Success then - Inc(Count); - end; - end; - Result := Count; -end; - -function TAbstractCollection.Add(const Collection: ICollection): Integer; -var - Iterator: IIterator; - Item: ICollectable; - ItemError: TCollectionError; - Count: Integer; - Success: Boolean; -begin - Count := 0; - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Item := Iterator.CurrentItem; - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Success := false; - end - else if FixedSize then - begin - CollectionError(ceFixedSize); - Success := false; - end - else - begin - Success := TrueAdd(Item); - end; - if Success then - Inc(Count); - Iterator.Next; - end; - Result := Count; -end; - -procedure TAbstractCollection.AfterConstruction; -begin - inherited AfterConstruction; - FCreated := true; -end; - -procedure TAbstractCollection.BeforeDestruction; -begin - if not FixedSize then - TrueClear; - inherited BeforeDestruction; -end; - -function TAbstractCollection.Clear: Integer; -begin - if not FixedSize then - begin - Result := Size; - TrueClear; - end - else - begin - CollectionError(ceFixedSize); - Result := 0; - end; -end; - -function TAbstractCollection.Clone: ICollection; -begin - Result := (TAbstractCollectionClass(ClassType)).Create(Self); -end; - -function TAbstractCollection.Contains(const Item: ICollectable): Boolean; -var - ItemError: TCollectionError; - Success: Boolean; -begin - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Success := false; - end - else - begin - Success := TrueContains(Item); - end; - Result := Success; -end; - -function TAbstractCollection.Contains(const ItemArray: array of ICollectable): Boolean; -var - I: Integer; - Success: Boolean; -begin - Success := true; - for I := Low(ItemArray) to High(ItemArray) do - begin - Success := Success and Contains(ItemArray[I]); - if not Success then - break; - end; - Result := Success; -end; - -function TAbstractCollection.Contains(const Collection: ICollection): Boolean; -var - Iterator: IIterator; - Success: Boolean; -begin - Success := true; - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Success := Success and Contains(Iterator.CurrentItem); - if not Success then - break; - Iterator.Next; - end; - Result := Success; -end; - -function TAbstractCollection.Equals(const Collection: ICollection): Boolean; -var - Iterator: IIterator; - Success: Boolean; -begin - if Collection.GetType <> GetType then - Result := false - else if Collection.Size <> Size then - Result := false - else if not Collection.Comparator.Equals(Comparator) then - Result := false - else if not Collection.GetDuplicates and not GetDuplicates then - begin - // Not equal if any item not found in parameter collection - Success := true; - Iterator := GetIterator; - while not Iterator.EOF and Success do - begin - Success := Collection.Contains(Iterator.CurrentItem); - Iterator.Next; - end; - Result := Success; - end - else - begin - // Not equal if any item count not equal to item count in parameter collection - Success := true; - Iterator := GetIterator; - while not Iterator.EOF and Success do - begin - Success := (ItemCount(Iterator.CurrentItem) = Collection.ItemCount(Iterator.CurrentItem)); - Iterator.Next; - end; - Result := Success; - end; -end; - -function TAbstractCollection.Find(const Filter: IFilter): ICollectable; -begin - Result := GetIterator(Filter).First; -end; - -function TAbstractCollection.Find(FilterFunc: TCollectionFilterFunc): ICollectable; -begin - Result := GetIterator(FilterFunc).First; -end; - -function TAbstractCollection.FindAll(const Filter: IFilter): ICollection; -var - ResultCollection: ICollection; - Iterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Self.GetIterator(Filter); - while not Iterator.EOF do - begin - ResultCollection.Add(Iterator.CurrentItem); - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractCollection.FindAll(FilterFunc: TCollectionFilterFunc): ICollection; -var - ResultCollection: ICollection; - Iterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Self.GetIterator(FilterFunc); - while not Iterator.EOF do - begin - ResultCollection.Add(Iterator.CurrentItem); - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractCollection.IsEmpty: Boolean; -begin - Result := (Size = 0); -end; - -function TAbstractCollection.IsNaturalItem(const Item: ICollectable): Boolean; -var - Temp: IUnknown; -begin - if Item <> nil then - Result := (Item.QueryInterface(NaturalItemIID, Temp) <> E_NOINTERFACE) - else - Result := false; -end; - -function TAbstractCollection.ItemAllowed(const Item: ICollectable): TCollectionError; -begin - if NaturalItemsOnly and not IsNaturalItem(Item) then - Result := ceNotNaturalItem - else if not IsNilAllowed and (Item = nil) then - Result := ceNilNotAllowed - else - Result := ceOK; -end; - -function TAbstractCollection.ItemCount(const Item: ICollectable): Integer; -var - ItemError: TCollectionError; -begin - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Result := 0; - end - else if GetDuplicates then - begin - Result := TrueItemCount(Item); - end - else - begin - // Where duplicates are not allowed, TrueContains will be faster than TrueItemCount. - if TrueContains(Item) then - Result := 1 - else - Result := 0; - end; -end; - -function TAbstractCollection.ItemCount(const ItemArray: array of ICollectable): Integer; -var - I: Integer; - Total: Integer; -begin - Total := 0; - for I := Low(ItemArray) to High(ItemArray) do - begin - Total := Total + ItemCount(ItemArray[I]); - end; - Result := Total; -end; - -function TAbstractCollection.ItemCount(const Collection: ICollection): Integer; -var - Iterator: IIterator; - Total: Integer; -begin - Total := 0; - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Total := Total + ItemCount(Iterator.CurrentItem); - Iterator.Next; - end; - Result := Total; -end; - -function TAbstractCollection.Matching(const ItemArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(ItemArray) to High(ItemArray) do - begin - if Contains(ItemArray[I]) then - ResultCollection.Add(ItemArray[I]); - end; - Result := ResultCollection; -end; - -function TAbstractCollection.Matching(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - Iterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - if Contains(Iterator.CurrentItem) then - ResultCollection.Add(Iterator.CurrentItem); - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractCollection.Remove(const Item: ICollectable): ICollectable; -var - ItemError: TCollectionError; -begin - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Result := nil; - end - else if FixedSize then - begin - CollectionError(ceFixedSize); - Result := nil; - end - else - begin - Result := TrueRemove(Item); - end; -end; - -function TAbstractCollection.Remove(const ItemArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(ItemArray) to High(ItemArray) do - begin - ResultCollection.Add(Remove(ItemArray[I])); - end; - Result := ResultCollection; -end; - -function TAbstractCollection.Remove(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - Iterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - ResultCollection.Add(Remove(Iterator.CurrentItem)); - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractCollection.RemoveAll(const Item: ICollectable): ICollection; -var - ItemError: TCollectionError; -begin - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Result := nil; - end - else if FixedSize then - begin - CollectionError(ceFixedSize); - Result := nil; - end - else - begin - Result := TrueRemoveAll(Item); - end; -end; - -function TAbstractCollection.RemoveAll(const ItemArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(ItemArray) to High(ItemArray) do - begin - ResultCollection.Add(RemoveAll(ItemArray[I])); - end; - Result := ResultCollection; -end; - -function TAbstractCollection.RemoveAll(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - Iterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - ResultCollection.Add(RemoveAll(Iterator.CurrentItem)); - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractCollection.Retain(const ItemArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - Iterator: IIterator; - Item: ICollectable; - I: Integer; - Found, Success: Boolean; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := GetIterator; - while not Iterator.EOF do - begin - // Converting the array to a map would be faster but I don't want to - // couple base class code to a complex collection. - Found := false; - for I := Low(ItemArray) to High(ItemArray) do - begin - Item := Iterator.CurrentItem; - Found := Comparator.Equals(Item, ItemArray[I]); - if Found then - break; - end; - if not Found then - begin - Success := Iterator.Remove; - if Success then - ResultCollection.Add(Item); - end; - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractCollection.Retain(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - Iterator: IIterator; - Item: ICollectable; - Success: Boolean; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := GetIterator; - while not Iterator.EOF do - begin - Item := Iterator.CurrentItem; - if not Collection.Contains(Item) then - begin - Success := Iterator.Remove; - if Success then - ResultCollection.Add(Item); - end; - Iterator.Next; - end; - Result := ResultCollection; -end; - -{ TAbstractBag } -function TAbstractBag.CloneAsBag: IBag; -begin - Result := (TAbstractBagClass(ClassType)).Create(Self); -end; - -function TAbstractBag.GetNaturalItemIID: TGUID; -begin - Result := EquatableIID; -end; - -function TAbstractBag.GetType: TCollectionType; -begin - Result := ctBag; -end; - -function TAbstractBag.IsNilAllowed: Boolean; -begin - Result := true; -end; - -{ TAbstractSet } -function TAbstractSet.TrueAdd(const Item: ICollectable): Boolean; -var - Position: TCollectionPosition; -begin - // Adds if not already present otherwise fails - Position := GetPosition(Item); - try - if Position.Found then - begin - CollectionError(ceDuplicate); - Result := false; - end - else - begin - TrueAdd2(Position, Item); - Result := true; - end; - finally - Position.Free; - end; -end; - -function TAbstractSet.TrueContains(const Item: ICollectable): Boolean; -var - Position: TCollectionPosition; -begin - Position := GetPosition(Item); - try - Result := Position.Found; - finally - Position.Free; - end; -end; - -function TAbstractSet.TrueRemove(const Item: ICollectable): ICollectable; -var - Position: TCollectionPosition; -begin - Position := GetPosition(Item); - try - if Position.Found then - begin - Result := TrueGet(Position); - TrueRemove2(Position); - end - else - Result := nil; - finally - Position.Free; - end; -end; - -function TAbstractSet.TrueRemoveAll(const Item: ICollectable): ICollection; -var - ResultCollection: ICollection; - RemovedItem: ICollectable; -begin - ResultCollection := TPArrayBag.Create; - RemovedItem := TrueRemove(Item); - if RemovedItem <> nil then - ResultCollection.Add(RemovedItem); - Result := ResultCollection; -end; - -function TAbstractSet.GetDuplicates: Boolean; -begin - Result := false; -end; - -function TAbstractSet.GetNaturalItemIID: TGUID; -begin - Result := EquatableIID; -end; - -function TAbstractSet.GetType: TCollectionType; -begin - Result := ctSet; -end; - -function TAbstractSet.CloneAsSet: ISet; -begin - Result := (TAbstractSetClass(ClassType)).Create(Self); -end; - -function TAbstractSet.Complement(const Universe: ISet): ISet; -var - ResultSet: ISet; - Iterator: IIterator; - Item: ICollectable; -begin - // Return items in universe not found in self. - ResultSet := TAbstractSetClass(ClassType).Create(NaturalItemsOnly); - Iterator := Universe.GetIterator; - while not Iterator.EOF do - begin - Item := Iterator.CurrentItem; - if not Contains(Item) then - ResultSet.Add(Item); - Iterator.Next; - end; - Result := ResultSet; -end; - -function TAbstractSet.Intersect(const Set2: ISet): ISet; -var - ResultSet: ISet; - Iterator: IIterator; - Item: ICollectable; -begin - // Return items found in self and parameter. - ResultSet := TAbstractSetClass(ClassType).Create(NaturalItemsOnly); - Iterator := GetIterator; - while not Iterator.EOF do - begin - Item := Iterator.CurrentItem; - if Contains(Item) and Set2.Contains(Item) then - ResultSet.Add(Iterator.CurrentItem); - Iterator.Next; - end; - Result := ResultSet; -end; - -function TAbstractSet.IsNilAllowed: Boolean; -begin - Result := false; -end; - -function TAbstractSet.Union(const Set2: ISet): ISet; -var - ResultSet: ISet; - Iterator: IIterator; - Item: ICollectable; -begin - // Return items found in self or parameter. - ResultSet := CloneAsSet; - Iterator := Set2.GetIterator; - while not Iterator.EOF do - begin - Item := Iterator.CurrentItem; - if not Contains(Item) and Set2.Contains(Item) then - ResultSet.Add(Iterator.CurrentItem); - Iterator.Next; - end; - Result := ResultSet; -end; - -{ TAbstractList } -constructor TAbstractList.Create(NaturalItemsOnly: Boolean); -begin - inherited Create(NaturalItemsOnly); - FDuplicates := true; - FSorted := false; -end; - -procedure TAbstractList.InitFrom(const Collection: ICollection); -var - List: IList; -begin - inherited InitFrom(Collection); - if Collection.QueryInterface(IList, List) = S_OK then - begin - FDuplicates := List.GetDuplicates; - FSorted := List.GetSorted; - end; -end; - -function TAbstractList.TrueAdd(const Item: ICollectable): Boolean; -var - SearchResult: TSearchResult; -begin - Result := True; - if Sorted then - begin - // Insert in appropriate place to maintain sort order, unless duplicate - // not allowed. - SearchResult := BinarySearch(Item); - case SearchResult.ResultType of - srBeforeIndex: TrueInsert(SearchResult.Index, Item); - srFoundAtIndex: begin - if Duplicates then - TrueInsert(SearchResult.Index, Item) - else - begin - CollectionError(ceDuplicate); - Result := false; - end; - end; - srAfterEnd: TrueAppend(Item); - end; - end - else - begin - // Add to end, unless duplicate not allowed. - if not Duplicates and (SequentialSearch(Item, Comparator).ResultType = srFoundAtIndex) then - begin - CollectionError(ceDuplicate); - Result := false; - end - else - TrueAppend(Item); - end; -end; - -function TAbstractList.TrueContains(const Item: ICollectable): Boolean; -begin - if Sorted then - Result := BinarySearch(Item).ResultType = srFoundAtIndex - else - Result := SequentialSearch(Item, Comparator).ResultType = srFoundAtIndex -end; - -function TAbstractList.TrueItemCount(const Item: ICollectable): Integer; -var - SearchResult: TSearchResult; - Count: Integer; -begin - if Sorted then - begin - // If sorted, use binary search. - Count := 0; - SearchResult := BinarySearch(Item); - if SearchResult.ResultType = srFoundAtIndex then - begin - repeat - Inc(Count); - until not Comparator.Equals(Item, Items[SearchResult.Index]); - end; - Result := Count; - end - else - // Resort to sequential search for unsorted - Result := inherited TrueItemCount(Item); -end; - -function TAbstractList.TrueRemove(const Item: ICollectable): ICollectable; -var - SearchResult: TSearchResult; -begin - Result := nil; - if Sorted then - begin - SearchResult := BinarySearch(Item); - if SearchResult.ResultType = srFoundAtIndex then - begin - Result := TrueDelete(SearchResult.Index); - end; - end - else - begin - SearchResult := SequentialSearch(Item); - if SearchResult.ResultType = srFoundAtIndex then - Result := TrueDelete(SearchResult.Index); - end; -end; - -function TAbstractList.TrueRemoveAll(const Item: ICollectable): ICollection; -var - ResultCollection: ICollection; - SearchResult: TSearchResult; - I: Integer; -begin - ResultCollection := TPArrayBag.Create; - if Sorted then - begin - SearchResult := BinarySearch(Item); - if SearchResult.ResultType = srFoundAtIndex then - begin - repeat - ResultCollection.Add(TrueDelete(SearchResult.Index)); - until not Comparator.Equals(Item, Items[SearchResult.Index]); - end; - end - else - begin - I := 0; - while I < Size do - begin - if Comparator.Equals(Item, Items[I]) then - begin - ResultCollection.Add(TrueDelete(I)); - end - else - Inc(I); - end; - end; - Result := ResultCollection; -end; - -procedure TAbstractList.QuickSort(Lo, Hi: Integer; const Comparator: IComparator); -var - I, J, Mid: Integer; -begin - repeat - I := Lo; - J := Hi; - Mid := (Lo + Hi) div 2; - repeat - while Comparator.Compare(Items[I], Items[Mid]) < 0 do - Inc(I); - while Comparator.Compare(Items[J], Items[Mid]) > 0 do - Dec(J); - if I <= J then - begin - Exchange(I, J); - if Mid = I then - Mid := J - else if Mid = J then - Mid := I; - Inc(I); - Dec(J); - end; - until I > J; - if Lo < J then - QuickSort(Lo, J, Comparator); - Lo := I; - until I >= Hi; -end; - -procedure TAbstractList.QuickSort(Lo, Hi: Integer; CompareFunc: TCollectionCompareFunc); -var - I, J, Mid: Integer; -begin - repeat - I := Lo; - J := Hi; - Mid := (Lo + Hi) div 2; - repeat - while CompareFunc(Items[I], Items[Mid]) < 0 do - Inc(I); - while CompareFunc(Items[J], Items[Mid]) > 0 do - Dec(J); - if I <= J then - begin - Exchange(I, J); - if Mid = I then - Mid := J - else if Mid = J then - Mid := I; - Inc(I); - Dec(J); - end; - until I > J; - if Lo < J then - QuickSort(Lo, J, CompareFunc); - Lo := I; - until I >= Hi; -end; - -function TAbstractList.GetDuplicates: Boolean; -begin - Result := FDuplicates; -end; - -procedure TAbstractList.SetDuplicates(Value: Boolean); -var - Iterator: IIterator; - Failed: Boolean; -begin - Failed := false; - // If trying to set no duplicates, check there are no existing duplicates. - if not Value then - begin - Iterator := GetIterator; - while not Iterator.EOF and not Failed do - begin - Failed := (ItemCount(Iterator.CurrentItem) > 1); - Iterator.Next; - end; - if Failed then - CollectionError(ceDuplicate); - end; - if not Failed then - FDuplicates := Value; -end; - -function TAbstractList.GetItem(Index: Integer): ICollectable; -begin - if (Index < 0) or (Index >= Size) then - begin - CollectionError(ceOutOfRange); - Result := nil; - end - else - Result := TrueGetItem(Index); -end; - -procedure TAbstractList.SetItem(Index: Integer; const Item: ICollectable); -var - SearchResult: TSearchResult; -begin - if (Index < 0) or (Index >= Size) then - begin - CollectionError(ceOutOfRange) - end - else if not Duplicates then - begin - // Find any duplicates - if Sorted then - begin - SearchResult := BinarySearch(Item); - case SearchResult.ResultType of - srBeforeIndex, srAfterEnd: begin // If item is not present - FSorted := false; - TrueSetItem(Index, Item); - end; - srFoundAtIndex: begin // If item is already present - CollectionError(ceDuplicate); - end; - end; - end - else - begin - // If item is already present - if SequentialSearch(Item, Comparator).ResultType = srFoundAtIndex then - begin - CollectionError(ceDuplicate); - end - else - begin - TrueSetItem(Index, Item); - end; - end; - end - else - begin - FSorted := false; - TrueSetItem(Index, Item); - end; -end; - -function TAbstractList.GetIterator: IIterator; -begin - Result := TAbstractListIterator.Create(Self); -end; - -function TAbstractList.GetNaturalItemIID: TGUID; -begin - Result := ComparableIID; -end; - -function TAbstractList.GetSorted: Boolean; -begin - Result := FSorted; -end; - -procedure TAbstractList.SetSorted(Value: Boolean); -begin - if Value then - Sort; -end; - -function TAbstractList.GetType: TCollectionType; -begin - Result := ctList; -end; - -function TAbstractList.BinarySearch(const Item: ICollectable): TSearchResult; -var - Lo, Hi, Mid: Integer; - CompareResult: Integer; - Success: Boolean; -begin - if Size = 0 then - begin - Result.ResultType := srAfterEnd; - Exit; - end; - Lo := 0; - Hi := Size - 1; - Success := false; - repeat - Mid := (Lo + Hi) div 2; - CompareResult := Comparator.Compare(Item, Items[Mid]); - if CompareResult = 0 then - Success := true - else if CompareResult > 0 then - Lo := Mid + 1 - else - Hi := Mid - 1; - until (Lo > Hi) or Success; - if Success then - begin - // Move index back if in cluster of duplicates - while (Mid > 0) and Comparator.Equals(Item, Items[Mid - 1]) do - Dec(Mid); - Result.ResultType := srFoundAtIndex; - Result.Index := Mid; - end - else if CompareResult < 0 then - begin - Result.ResultType := srBeforeIndex; - Result.Index := Mid; - end - else if Hi < Size - 1 then - begin - Result.ResultType := srBeforeIndex; - Result.Index := Mid + 1; - end - else - Result.ResultType := srAfterEnd; -end; - -function TAbstractList.CloneAsList: IList; -begin - Result := (TAbstractListClass(ClassType)).Create(Self); -end; - -function TAbstractList.Delete(Index: Integer): ICollectable; -begin - if FixedSize then - begin - CollectionError(ceFixedSize); - Result := nil; - end - else if (Index < 0) or (Index >= Size) then - begin - CollectionError(ceOutOfRange); - Result := nil; - end - else - begin - Result := TrueDelete(Index); - end; -end; - -procedure TAbstractList.Exchange(Index1, Index2: Integer); -var - Item: ICollectable; -begin - if (Index1 < 0) or (Index1 >= Size) then - CollectionError(ceOutOfRange); - if (Index2 < 0) or (Index2 >= Size) then - CollectionError(ceOutOfRange); - FSorted := false; - Item := ICollectable(Items[Index1]); - Items[Index1] := Items[Index2]; - Items[Index2] := Item; -end; - -function TAbstractList.First: ICollectable; -begin - if Size > 0 then - Result := Items[0] - else - Result := nil; -end; - -function TAbstractList.IndexOf(const Item: ICollectable): Integer; -var - SearchResult: TSearchResult; -begin - if Sorted then - SearchResult := BinarySearch(Item) - else - SearchResult := SequentialSearch(Item, Comparator); - if SearchResult.ResultType = srFoundAtIndex then - Result := SearchResult.Index - else - Result := -1; -end; - -function TAbstractList.Insert(Index: Integer; const Item: ICollectable): Boolean; -var - ItemError: TCollectionError; -begin - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Result := false; - end - else if FixedSize then - begin - CollectionError(ceFixedSize); - Result := false; - end - else if (Index < 0) or (Index > Size) then - begin - CollectionError(ceOutOfRange); - Result := false; - end - else - begin - FSorted := false; - if Index = Size then - TrueAdd(Item) - else - TrueInsert(Index, Item); - Result := true; - end; -end; - -function TAbstractList.Insert(Index: Integer; const ItemArray: array of ICollectable): Integer; -var - Item: ICollectable; - ItemError: TCollectionError; - I, NewIndex, Count: Integer; - Success: Boolean; -begin - Count := 0; - if FixedSize then - begin - CollectionError(ceFixedSize); - end - else if (Index < 0) or (Index > Size) then - begin - CollectionError(ceOutOfRange); - end - else - begin - // Insert entire array in place in correct order - NewIndex := Index; - for I := Low(ItemArray) to High(ItemArray) do - begin - Item := ItemArray[I]; - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - end - else - begin - Success := Insert(NewIndex, Item); - if Success then - begin - Inc(NewIndex); - Inc(Count); - end; - end; - end; - end; - Result := Count; -end; - -function TAbstractList.Insert(Index: Integer; const Collection: ICollection): Integer; -var - Iterator: IIterator; - Item: ICollectable; - ItemError: TCollectionError; - NewIndex, Count: Integer; - Success: Boolean; -begin - Count := 0; - if FixedSize then - begin - CollectionError(ceFixedSize); - end - else if (Index < 0) or (Index > Size) then - begin - CollectionError(ceOutOfRange); - end - else - begin - // Insert entire collection in place in correct order - NewIndex := Index; - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Item := Iterator.CurrentItem; - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - end - else - begin - Success := Insert(NewIndex, Item); - if Success then - begin - Inc(NewIndex); - Inc(Count); - end; - end; - Iterator.Next; - end; - end; - Result := Count; -end; - -function TAbstractList.IsNilAllowed: Boolean; -begin - Result := true; -end; - -function TAbstractList.Last: ICollectable; -begin - if Size > 0 then - Result := Items[Size - 1] - else - Result := nil; -end; - -function TAbstractList.Search(const Item: ICollectable; const SearchComparator: IComparator = nil): TSearchResult; -begin - if Sorted and (SearchComparator = nil) then - Result := BinarySearch(Item) - else - Result := SequentialSearch(Item, SearchComparator); -end; - -function TAbstractList.SequentialSearch(const Item: ICollectable; const SearchComparator: IComparator): TSearchResult; -var - WorkingComparator: IComparator; - I: Integer; - Success: Boolean; -begin - if SearchComparator = nil then - WorkingComparator := Comparator - else - WorkingComparator := SearchComparator; - Result.ResultType := srNotFound; - I := 0; - Success := false; - while (I < Size) and not Success do - begin - if WorkingComparator.Equals(Item, Items[I]) then - begin - Result.ResultType := srFoundAtIndex; - Result.Index := I; - Success := true; - end - else - Inc(I); - end; -end; - -procedure TAbstractList.Sort(const SortComparator: IComparator); -begin - if SortComparator = nil then - begin - if Size > 0 then - QuickSort(0, Size - 1, Comparator); - FSorted := true; - end - else - begin - if Size > 0 then - QuickSort(0, Size - 1, SortComparator); - FSorted := false; - end; -end; - -procedure TAbstractList.Sort(CompareFunc: TCollectionCompareFunc); -begin - if Size > 0 then - QuickSort(0, Size - 1, CompareFunc); - FSorted := false; -end; - -{ TAbstractMap } -constructor TAbstractMap.Create; -begin - Create(false, true); -end; - -constructor TAbstractMap.Create(NaturalItemsOnly: Boolean); -begin - Create(NaturalItemsOnly, true); -end; - -constructor TAbstractMap.Create(NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); -begin - inherited Create(NaturalItemsOnly); - FNaturalKeysOnly := NaturalKeysOnly or GetAlwaysNaturalKeys; - FAssociationComparator := TAssociationComparator.Create(FNaturalKeysOnly); - if FNaturalKeysOnly then - FKeyComparator := TAbstractComparator.GetNaturalComparator - else - FKeyComparator := TAbstractComparator.GetDefaultComparator; -end; - -constructor TAbstractMap.Create(const ItemArray: array of ICollectable); -begin - Create(ItemArray, true, true); -end; - -constructor TAbstractMap.Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); -begin - Create(ItemArray, true, true); -end; - -constructor TAbstractMap.Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); -var - I: Integer; -begin - Create(true, NaturalKeysOnly); - if not FixedSize then - begin - Capacity := Length(ItemArray); - for I := Low(ItemArray) to High(ItemArray) do - begin - Add(ItemArray[I]); - end; - end; -end; - -constructor TAbstractMap.Create(const KeyArray, ItemArray: array of ICollectable); -begin - Create(KeyArray, ItemArray, false, true); -end; - -constructor TAbstractMap.Create(const KeyArray, ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); -begin - Create(KeyArray, ItemArray, NaturalItemsOnly, true); -end; - -constructor TAbstractMap.Create(const KeyArray, ItemArray: array of ICollectable; NaturalItemsOnly: Boolean; NaturalKeysOnly: Boolean); -var - I, Lo, Hi: Integer; -begin - Create(NaturalItemsOnly, NaturalKeysOnly); - if not FixedSize then - begin - Capacity := Min(Length(KeyArray), Length(ItemArray)); - Lo := Max(Low(KeyArray), Low(ItemArray)); - Hi := Min(High(KeyArray), High(ItemArray)); - for I := Lo to Hi do - begin - Put(KeyArray[I], ItemArray[I]); - end; - end; -end; - -constructor TAbstractMap.Create(const Map: IMap); -var - MapIterator: IMapIterator; -begin - Create(Map.GetNaturalItemsOnly, Map.GetNaturalKeysOnly); - InitFrom(Map); - if not FixedSize then - begin - Capacity := Map.GetSize; - MapIterator := Map.GetMapIterator; - while not MapIterator.EOF do - begin - Put(MapIterator.CurrentKey, MapIterator.CurrentItem); - MapIterator.Next; - end; - end; -end; - -destructor TAbstractMap.Destroy; -begin - FKeyComparator := nil; - FAssociationComparator := nil; - inherited Destroy; -end; - -procedure TAbstractMap.InitFrom(const Collection: ICollection); -var - Map: IMap; -begin - inherited InitFrom(Collection); - if Collection.QueryInterface(IMap, Map) = S_OK then - begin - FNaturalKeysOnly := Map.GetNaturalKeysOnly or GetAlwaysNaturalKeys; - KeyComparator := Map.GetKeyComparator; - end; -end; - -function TAbstractMap.TrueAdd(const Item: ICollectable): Boolean; -var - Position: TCollectionPosition; - Mappable: IMappable; -begin - if IsNaturalItem(Item) then - begin - Mappable := Item as IMappable; - Position := GetKeyPosition(Mappable.GetKey); - try - if Position.Found then - begin - CollectionError(ceDuplicateKey); - Result := false; - end - else - begin - TruePut(Position, TAssociation.Create(Mappable.GetKey, Item)); - Result := true; - end; - finally - Position.Free; - end; - end - else - begin - CollectionError(ceNotNaturalItem); - Result := false; - end; -end; - -function TAbstractMap.TrueContains(const Item: ICollectable): Boolean; -var - Item2: ICollectable; - Success: Boolean; - Iterator: IIterator; -begin - Iterator := GetIterator; - Success := false; - while not Iterator.EOF and not Success do - begin - Item2 := Iterator.CurrentItem; - if Comparator.Equals(Item, Item2) then - Success := true; - Iterator.Next; - end; - Result := Success; -end; - -function TAbstractMap.TrueRemove(const Item: ICollectable): ICollectable; -var - Item2: ICollectable; - Iterator: IMapIterator; - Found: Boolean; -begin - // Sequential search - Found := false; - Result := nil; - Iterator := GetAssociationIterator; - while not Iterator.EOF and not Found do - begin - Item2 := Iterator.CurrentItem; - if Comparator.Equals(Item, Item2) then - begin - Result := Item2; - Iterator.Remove; - Found := true; - end; - Iterator.Next; - end; -end; - -function TAbstractMap.TrueRemoveAll(const Item: ICollectable): ICollection; -var - ResultCollection: ICollection; - Item2: ICollectable; - Iterator: IMapIterator; -begin - // Sequential search - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := GetAssociationIterator; - while not Iterator.EOF do - begin - Item2 := Iterator.CurrentItem; - if Comparator.Equals(Item, Item2) then - begin - ResultCollection.Add(Item2); - Iterator.Remove; - end; - Iterator.Next; - end; - Result := ResultCollection; -end; - -class function TAbstractMap.GetAlwaysNaturalKeys: Boolean; -begin - Result := false; -end; - -function TAbstractMap.GetItem(const Key: ICollectable): ICollectable; -begin - Result := Get(Key); -end; - -procedure TAbstractMap.SetItem(const Key, Item: ICollectable); -begin - Put(Key, Item); -end; - -function TAbstractMap.GetIterator: IIterator; -begin - Result := GetAssociationIterator; -end; - -function TAbstractMap.GetKeyComparator: IComparator; -begin - Result := FKeyComparator; -end; - -procedure TAbstractMap.SetKeyComparator(const Value: IComparator); -begin - FKeyComparator := Value; - FAssociationComparator.KeyComparator := Value; -end; - -function TAbstractMap.GetKeyIterator: IIterator; -begin - Result := TAssociationKeyIterator.Create(GetAssociationIterator); -end; - -function TAbstractMap.GetKeys: ISet; -var - ResultCollection: TPArraySet; - KeyIterator: IIterator; -begin - ResultCollection := TPArraySet.Create(NaturalKeysOnly); - ResultCollection.SetComparator(GetKeyComparator); - KeyIterator := GetKeyIterator; - while not KeyIterator.EOF do - begin - ResultCollection.Add(KeyIterator.CurrentItem); - KeyIterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractMap.GetMapIterator: IMapIterator; -begin - Result := GetAssociationIterator; -end; - -function TAbstractMap.GetMapIteratorByKey(const Filter: IFilter): IMapIterator; -var - Iterator: IMapIterator; -begin - Iterator := GetMapIterator; - Result := TKeyFilterMapIterator.Create(Iterator, Filter, Iterator.GetAllowRemoval); -end; - -function TAbstractMap.GetMapIteratorByKey(FilterFunc: TCollectionFilterFunc): IMapIterator; -var - Iterator: IMapIterator; -begin - Iterator := GetMapIterator; - Result := TKeyFilterFuncMapIterator.Create(Iterator, FilterFunc, Iterator.GetAllowRemoval); -end; - -function TAbstractMap.GetNaturalItemIID: TGUID; -begin - Result := MappableIID; -end; - -function TAbstractMap.GetNaturalKeyIID: TGUID; -begin - Result := EquatableIID; -end; - -function TAbstractMap.GetNaturalKeysOnly: Boolean; -begin - Result := FNaturalKeysOnly; -end; - -function TAbstractMap.GetType: TCollectionType; -begin - Result := ctMap; -end; - -function TAbstractMap.GetValues: ICollection; -var - ResultCollection: ICollection; - ValueIterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - ValueIterator := GetIterator; - while not ValueIterator.EOF do - begin - ResultCollection.Add(ValueIterator.CurrentItem); - ValueIterator.Next; - end; - Result := ResultCollection; -end; - -// Overrides TAbstractCollection function, otherwise Create(ICollection) is -// called, which cannot access keys. -function TAbstractMap.Clone: ICollection; -begin - Result := (TAbstractMapClass(ClassType)).Create(Self); -end; - -function TAbstractMap.CloneAsMap: IMap; -begin - Result := (TAbstractMapClass(ClassType)).Create(Self); -end; - -function TAbstractMap.ContainsKey(const Key: ICollectable): Boolean; -var - Position: TCollectionPosition; -begin - Position := GetKeyPosition(Key); - try - Result := Position.Found; - finally - Position.Free; - end; -end; - -function TAbstractMap.ContainsKey(const KeyArray: array of ICollectable): Boolean; -var - I: Integer; - Success: Boolean; -begin - Success := true; - for I := Low(KeyArray) to High(KeyArray) do - begin - Success := Success and ContainsKey(KeyArray[I]); - if not Success then - break; - end; - Result := Success; -end; - -function TAbstractMap.ContainsKey(const Collection: ICollection): Boolean; -var - Iterator: IIterator; - Success: Boolean; -begin - Success := true; - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Success := Success and ContainsKey(Iterator.CurrentItem); - if not Success then - break; - Iterator.Next; - end; - Result := Success; -end; - -function TAbstractMap.Get(const Key: ICollectable): ICollectable; -var - KeyError: TCollectionError; - Position: TCollectionPosition; -begin - KeyError := KeyAllowed(Key); - if KeyError <> ceOK then - begin - CollectionError(KeyError); - Result := nil; - end - else - begin - Position := GetKeyPosition(Key); - try - if Position.Found then - Result := TrueGet(Position).GetValue - else - Result := nil; - finally - Position.Free; - end; - end; -end; - -function TAbstractMap.KeyAllowed(const Key: ICollectable): TCollectionError; -begin - if NaturalKeysOnly and not IsNaturalKey(Key) then - Result := ceNotNaturalItem - else if Key = nil then - Result := ceNilNotAllowed - else - Result := ceOK; -end; - -function TAbstractMap.IsNaturalKey(const Key: ICollectable): Boolean; -var - Temp: IUnknown; -begin - if Key.QueryInterface(NaturalKeyIID, Temp) <> E_NOINTERFACE then - Result := true - else - Result := false; -end; - -function TAbstractMap.IsNilAllowed: Boolean; -begin - Result := true; -end; - -function TAbstractMap.MatchingKey(const KeyArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(KeyArray) to High(KeyArray) do - begin - if ContainsKey(KeyArray[I]) then - ResultCollection.Add(KeyArray[I]); - end; - Result := ResultCollection; -end; - -function TAbstractMap.MatchingKey(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - Iterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - if ContainsKey(Iterator.CurrentItem) then - ResultCollection.Add(Iterator.CurrentItem); - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractMap.Put(const Item: ICollectable): ICollectable; -var - Mappable: IMappable; - OldAssociation, NewAssociation: IAssociation; - Position: TCollectionPosition; -begin - if not IsNaturalItem(Item) then - begin - CollectionError(ceNotNaturalItem); - Result := nil; - end - else - begin - Item.QueryInterface(IMappable, Mappable); - Position := GetKeyPosition(Mappable.GetKey); - try - NewAssociation := TAssociation.Create(Mappable.GetKey, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - Result := OldAssociation.GetValue - else - Result := nil; - finally - Position.Free; - end; - end; -end; - -function TAbstractMap.Put(const Key, Item: ICollectable): ICollectable; -var - OldAssociation, NewAssociation: IAssociation; - ItemError, KeyError: TCollectionError; - Position: TCollectionPosition; -begin - ItemError := ItemAllowed(Item); - KeyError := KeyAllowed(Key); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Result := nil; - end - else if KeyError <> ceOK then - begin - CollectionError(KeyError); - Result := nil; - end - else - begin - // Find appropriate place, then place key-item association there - Position := GetKeyPosition(Key); - try - NewAssociation := TAssociation.Create(Key, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - Result := OldAssociation.GetValue - else - Result := nil; - finally - Position.Free; - end; - end; -end; - -function TAbstractMap.Put(const ItemArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - Mappable: IMappable; - OldAssociation, NewAssociation: IAssociation; - Position: TCollectionPosition; - Item: ICollectable; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(ItemArray) to High(ItemArray) do - begin - Item := ItemArray[I]; - if not IsNaturalItem(Item) then - begin - CollectionError(ceNotNaturalItem); - end - else - begin - // Find appropriate place, then place key-item association there - Item.QueryInterface(IMappable, Mappable); - Position := GetKeyPosition(Mappable.GetKey); - try - NewAssociation := TAssociation.Create(Mappable.GetKey, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - ResultCollection.Add(OldAssociation.GetValue); - finally - Position.Free; - end; - end; - end; - Result := ResultCollection; -end; - -function TAbstractMap.Put(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - Mappable: IMappable; - OldAssociation, NewAssociation: IAssociation; - Position: TCollectionPosition; - Iterator: IIterator; - Item: ICollectable; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Item := Iterator.CurrentItem;; - if not IsNaturalItem(Item) then - begin - CollectionError(ceNotNaturalItem); - end - else - begin - // Find appropriate place, then place key-item association there - Item.QueryInterface(IMappable, Mappable); - Position := GetKeyPosition(Mappable.GetKey); - try - NewAssociation := TAssociation.Create(Mappable.GetKey, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - ResultCollection.Add(OldAssociation.GetValue); - finally - Position.Free; - end; - end; - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractMap.Put(const Map: IMap): ICollection; -var - ResultCollection: ICollection; - OldAssociation, NewAssociation: IAssociation; - ItemError, KeyError: TCollectionError; - Position: TCollectionPosition; - MapIterator: IMapIterator; - Key, Item: ICollectable; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - MapIterator := Map.GetMapIterator; - while not MapIterator.EOF do - begin - Key := MapIterator.CurrentKey; - Item := MapIterator.CurrentItem; - - ItemError := ItemAllowed(Item); - KeyError := KeyAllowed(Key); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - end - else if KeyError <> ceOK then - begin - CollectionError(KeyError); - end - else - begin - // Find appropriate place, then place key-item association there - Position := GetKeyPosition(Key); - try - NewAssociation := TAssociation.Create(Key, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - ResultCollection.Add(OldAssociation.GetValue); - finally - Position.Free; - end; - end; - MapIterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractMap.RemoveKey(const Key: ICollectable): ICollectable; -var - KeyError: TCollectionError; - Position: TCollectionPosition; - OldAssociation: IAssociation; -begin - KeyError := KeyAllowed(Key); - if KeyError <> ceOK then - begin - CollectionError(KeyError); - Result := nil; - end - else - begin - Position := GetKeyPosition(Key); - try - if Position.Found then - begin - OldAssociation := TrueRemove2(Position); - Result := OldAssociation.GetValue - end - else - Result := nil; - finally - Position.Free; - end; - end; -end; - -function TAbstractMap.RemoveKey(const KeyArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - OldAssociation: IAssociation; - KeyError: TCollectionError; - Position: TCollectionPosition; - Key: ICollectable; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(KeyArray) to High(KeyArray) do - begin - Key := KeyArray[I]; - KeyError := KeyAllowed(Key); - if KeyError <> ceOK then - begin - CollectionError(KeyError); - end - else - begin - Position := GetKeyPosition(Key); - try - if Position.Found then - begin - OldAssociation := TrueRemove2(Position); - ResultCollection.Add(OldAssociation.GetValue); - end; - finally - Position.Free; - end; - end; - end; - Result := ResultCollection; -end; - -function TAbstractMap.RemoveKey(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - OldAssociation: IAssociation; - KeyError: TCollectionError; - Position: TCollectionPosition; - Key: ICollectable; - Iterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Key := Iterator.CurrentItem; - KeyError := KeyAllowed(Key); - if KeyError <> ceOK then - begin - CollectionError(KeyError); - end - else - begin - Position := GetKeyPosition(Key); - try - if Position.Found then - begin - OldAssociation := TrueRemove2(Position); - ResultCollection.Add(OldAssociation.GetValue); - end; - finally - Position.Free; - end; - end; - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractMap.RetainKey(const KeyArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - MapIterator: IMapIterator; - I: Integer; - Found: Boolean; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - if FixedSize then - begin - CollectionError(ceFixedSize); - end - else - begin - MapIterator := GetMapIterator; - while not MapIterator.EOF do - begin - // Converting the array to a map would be faster but I don't want to - // couple base class code to a complex collection. - Found := false; - for I := Low(KeyArray) to High(KeyArray) do - begin - Found := KeyComparator.Equals(MapIterator.CurrentKey, KeyArray[I]); - if Found then - break; - end; - if not Found then - begin - ResultCollection.Add(MapIterator.CurrentItem); - MapIterator.Remove; - end; - MapIterator.Next; - end; - Result := ResultCollection; - end; -end; - -function TAbstractMap.RetainKey(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - MapIterator: IMapIterator; - Key: ICollectable; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - if FixedSize then - begin - CollectionError(ceFixedSize); - end - else - begin - MapIterator := GetMapIterator; - while not MapIterator.EOF do - begin - Key := MapIterator.CurrentKey; - if not Collection.Contains(Key) then - begin - ResultCollection.Add(MapIterator.CurrentItem); - MapIterator.Remove; - end; - MapIterator.Next; - end; - end; - Result := ResultCollection; -end; - - -{ TAbstractIntegerMap } -constructor TAbstractIntegerMap.Create(NaturalItemsOnly: Boolean); -begin - inherited Create(NaturalItemsOnly); - FAssociationComparator := TIntegerAssociationComparator.Create; -end; - -constructor TAbstractIntegerMap.Create(const ItemArray: array of ICollectable); -begin - Create(ItemArray, true); -end; - -constructor TAbstractIntegerMap.Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); -begin - inherited Create(ItemArray, true); -end; - -constructor TAbstractIntegerMap.Create(const KeyArray: array of Integer; const ItemArray: array of ICollectable); -begin - Create(KeyArray, ItemArray, false); -end; - -constructor TAbstractIntegerMap.Create(const KeyArray: array of Integer; const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); -var - I, Lo, Hi: Integer; -begin - Create(NaturalItemsOnly); - Capacity := Min(Length(KeyArray), Length(ItemArray)); - if not FixedSize then - begin - Lo := Max(Low(KeyArray), Low(ItemArray)); - Hi := Min(High(KeyArray), High(ItemArray)); - for I := Lo to Hi do - begin - Put(KeyArray[I], ItemArray[I]); - end; - end; -end; - -constructor TAbstractIntegerMap.Create(const Map: IIntegerMap); -var - MapIterator: IIntegerMapIterator; -begin - Create(Map.GetNaturalItemsOnly); - InitFrom(Map); - Capacity := Map.GetSize; - if not FixedSize then - begin - MapIterator := Map.GetMapIterator; - while not MapIterator.EOF do - begin - Put(MapIterator.CurrentKey, MapIterator.CurrentItem); - MapIterator.Next; - end; - end; -end; - -destructor TAbstractIntegerMap.Destroy; -begin - FAssociationComparator := nil; - inherited Destroy; -end; - -function TAbstractIntegerMap.TrueAdd(const Item: ICollectable): Boolean; -var - Position: TCollectionPosition; - Mappable: IIntegerMappable; -begin - if IsNaturalItem(Item) then - begin - Mappable := Item as IIntegerMappable; - Position := GetKeyPosition(Mappable.GetKey); - try - if Position.Found then - begin - CollectionError(ceDuplicateKey); - Result := false; - end - else - begin - TruePut(Position, TIntegerAssociation.Create(Mappable.GetKey, Item)); - Result := true; - end; - finally - Position.Free; - end; - end - else - begin - CollectionError(ceNotNaturalItem); - Result := false; - end; -end; - -function TAbstractIntegerMap.TrueContains(const Item: ICollectable): Boolean; -var - Item2: ICollectable; - Success: Boolean; - Iterator: IIterator; -begin - Iterator := GetIterator; - Success := false; - while not Iterator.EOF and not Success do - begin - Item2 := Iterator.CurrentItem; - if Comparator.Equals(Item, Item2) then - Success := true; - Iterator.Next; - end; - Result := Success; -end; - -function TAbstractIntegerMap.TrueRemove(const Item: ICollectable): ICollectable; -var - Item2: ICollectable; - Iterator: IIntegerMapIterator; - Found: Boolean; -begin - // Sequential search - Found := false; - Result := nil; - Iterator := GetAssociationIterator; - while not Iterator.EOF and not Found do - begin - Item2 := Iterator.CurrentItem; - if Comparator.Equals(Item, Item2) then - begin - Result := Item2; - Iterator.Remove; - Found := true; - end; - Iterator.Next; - end; -end; - -function TAbstractIntegerMap.TrueRemoveAll(const Item: ICollectable): ICollection; -var - ResultCollection: ICollection; - Item2: ICollectable; - Iterator: IIntegerMapIterator; -begin - // Sequential search - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := GetAssociationIterator; - while not Iterator.EOF do - begin - Item2 := Iterator.CurrentItem; - if Comparator.Equals(Item, Item2) then - begin - ResultCollection.Add(Item2); - Iterator.Remove; - end; - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractIntegerMap.GetItem(const Key: Integer): ICollectable; -begin - Result := Get(Key); -end; - -procedure TAbstractIntegerMap.SetItem(const Key: Integer; const Item: ICollectable); -begin - Put(Key, Item); -end; - -function TAbstractIntegerMap.GetIterator: IIterator; -begin - Result := GetAssociationIterator; -end; - -function TAbstractIntegerMap.GetKeys: ISet; -var - ResultCollection: TPArraySet; - MapIterator: IIntegerMapIterator; -begin - ResultCollection := TPArraySet.Create(true); - MapIterator := GetMapIterator; - while not MapIterator.EOF do - begin - ResultCollection.Add(TIntegerWrapper.Create(MapIterator.CurrentKey) as ICollectable); - MapIterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractIntegerMap.GetMapIterator: IIntegerMapIterator; -begin - Result := GetAssociationIterator; -end; - -function TAbstractIntegerMap.GetNaturalItemIID: TGUID; -begin - Result := IntegerMappableIID; -end; - -function TAbstractIntegerMap.GetType: TCollectionType; -begin - Result := ctIntegerMap; -end; - -function TAbstractIntegerMap.GetValues: ICollection; -var - ResultCollection: ICollection; - ValueIterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - ValueIterator := GetIterator; - while not ValueIterator.EOF do - begin - ResultCollection.Add(ValueIterator.CurrentItem); - ValueIterator.Next; - end; - Result := ResultCollection; -end; - -// Overrides TAbstractCollection function, otherwise Create(ICollection) is -// called, which cannot access keys. -function TAbstractIntegerMap.Clone: ICollection; -begin - Result := (TAbstractIntegerMapClass(ClassType)).Create(Self); -end; - -function TAbstractIntegerMap.CloneAsIntegerMap: IIntegerMap; -begin - Result := (TAbstractIntegerMapClass(ClassType)).Create(Self); -end; - -function TAbstractIntegerMap.ContainsKey(const Key: Integer): Boolean; -var - Position: TCollectionPosition; -begin - Position := GetKeyPosition(Key); - try - Result := Position.Found; - finally - Position.Free; - end; -end; - -function TAbstractIntegerMap.ContainsKey(const KeyArray: array of Integer): Boolean; -var - I: Integer; - Success: Boolean; -begin - Success := true; - for I := Low(KeyArray) to High(KeyArray) do - begin - Success := Success and ContainsKey(KeyArray[I]); - if not Success then - break; - end; - Result := Success; -end; - -function TAbstractIntegerMap.Get(const Key: Integer): ICollectable; -var - Position: TCollectionPosition; -begin - Position := GetKeyPosition(Key); - try - if Position.Found then - Result := TrueGet(Position).GetValue - else - Result := nil; - finally - Position.Free; - end; -end; - -function TAbstractIntegerMap.IsNilAllowed: Boolean; -begin - Result := true; -end; - -function TAbstractIntegerMap.Put(const Item: ICollectable): ICollectable; -var - Mappable: IIntegerMappable; - OldAssociation, NewAssociation: IIntegerAssociation; - Position: TCollectionPosition; -begin - if not IsNaturalItem(Item) then - begin - CollectionError(ceNotNaturalItem); - Result := nil; - end - else - begin - Item.QueryInterface(IIntegerMappable, Mappable); - Position := GetKeyPosition(Mappable.GetKey); - try - NewAssociation := TIntegerAssociation.Create(Mappable.GetKey, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - Result := OldAssociation.GetValue - else - Result := nil; - finally - Position.Free; - end; - end; -end; - -function TAbstractIntegerMap.Put(const Key: Integer; const Item: ICollectable): ICollectable; -var - OldAssociation, NewAssociation: IIntegerAssociation; - ItemError: TCollectionError; - Position: TCollectionPosition; -begin - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Result := nil; - end - else - begin - Position := GetKeyPosition(Key); - try - NewAssociation := TIntegerAssociation.Create(Key, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - Result := OldAssociation.GetValue - else - Result := nil; - finally - Position.Free; - end; - end; -end; - -function TAbstractIntegerMap.Put(const ItemArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - Mappable: IIntegerMappable; - OldAssociation, NewAssociation: IIntegerAssociation; - Position: TCollectionPosition; - Item: ICollectable; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(ItemArray) to High(ItemArray) do - begin - Item := ItemArray[I]; - if not IsNaturalItem(Item) then - begin - CollectionError(ceNotNaturalItem); - end - else - begin - Item.QueryInterface(IIntegerMappable, Mappable); - Position := GetKeyPosition(Mappable.GetKey); - try - NewAssociation := TIntegerAssociation.Create(Mappable.GetKey, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - ResultCollection.Add(OldAssociation.GetValue); - finally - Position.Free; - end; - end; - end; - Result := ResultCollection; -end; - -function TAbstractIntegerMap.Put(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - Mappable: IIntegerMappable; - OldAssociation, NewAssociation: IIntegerAssociation; - Position: TCollectionPosition; - Iterator: IIterator; - Item: ICollectable; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Item := Iterator.CurrentItem;; - if not IsNaturalItem(Item) then - begin - CollectionError(ceNotNaturalItem); - end - else - begin - Item.QueryInterface(IIntegerMappable, Mappable); - Position := GetKeyPosition(Mappable.GetKey); - try - NewAssociation := TIntegerAssociation.Create(Mappable.GetKey, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - ResultCollection.Add(OldAssociation.GetValue); - finally - Position.Free; - end; - end; - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractIntegerMap.Put(const Map: IIntegerMap): ICollection; -var - ResultCollection: ICollection; - OldAssociation, NewAssociation: IIntegerAssociation; - ItemError: TCollectionError; - Position: TCollectionPosition; - MapIterator: IIntegerMapIterator; - Item: ICollectable; - Key: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - MapIterator := Map.GetMapIterator; - while not MapIterator.EOF do - begin - Key := MapIterator.CurrentKey; - Item := MapIterator.CurrentItem; - - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - end - else - begin - Position := GetKeyPosition(Key); - try - NewAssociation := TIntegerAssociation.Create(Key, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - ResultCollection.Add(OldAssociation.GetValue); - finally - Position.Free; - end; - end; - MapIterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractIntegerMap.RemoveKey(const Key: Integer): ICollectable; -var - Position: TCollectionPosition; - OldAssociation: IIntegerAssociation; -begin - Position := GetKeyPosition(Key); - try - if Position.Found then - begin - OldAssociation := TrueRemove2(Position); - Result := OldAssociation.GetValue - end - else - Result := nil; - finally - Position.Free; - end; -end; - -function TAbstractIntegerMap.RemoveKey(const KeyArray: array of Integer): ICollection; -var - ResultCollection: ICollection; - OldAssociation: IIntegerAssociation; - Position: TCollectionPosition; - Key: Integer; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(KeyArray) to High(KeyArray) do - begin - Key := KeyArray[I]; - Position := GetKeyPosition(Key); - try - if Position.Found then - begin - OldAssociation := TrueRemove2(Position); - ResultCollection.Add(OldAssociation.GetValue); - end; - finally - Position.Free; - end; - end; - Result := ResultCollection; -end; - -function TAbstractIntegerMap.RetainKey(const KeyArray: array of Integer): ICollection; -var - ResultCollection: ICollection; - MapIterator: IIntegerMapIterator; - I: Integer; - Found: Boolean; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - if FixedSize then - begin - CollectionError(ceFixedSize); - end - else - begin - MapIterator := GetMapIterator; - while not MapIterator.EOF do - begin - // Converting the array to a map would be faster but I don't want to - // couple base class code to a complex collection. - Found := false; - for I := Low(KeyArray) to High(KeyArray) do - begin - Found := (MapIterator.CurrentKey = KeyArray[I]); - if Found then - break; - end; - if not Found then - begin - ResultCollection.Add(MapIterator.CurrentItem); - MapIterator.Remove; - end; - MapIterator.Next; - end; - Result := ResultCollection; - end; -end; - - -{ TAbstractStringMap } -constructor TAbstractStringMap.Create(NaturalItemsOnly: Boolean); -begin - inherited Create(NaturalItemsOnly); - FAssociationComparator := TStringAssociationComparator.Create; -end; - -constructor TAbstractStringMap.Create(const ItemArray: array of ICollectable); -begin - Create(ItemArray, true); -end; - -constructor TAbstractStringMap.Create(const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); -begin - inherited Create(ItemArray, true); -end; - -constructor TAbstractStringMap.Create(const KeyArray: array of String; const ItemArray: array of ICollectable); -begin - Create(KeyArray, ItemArray, false); -end; - -constructor TAbstractStringMap.Create(const KeyArray: array of String; const ItemArray: array of ICollectable; NaturalItemsOnly: Boolean); -var - I, Lo, Hi: Integer; -begin - Create(NaturalItemsOnly); - Capacity := Min(Length(KeyArray), Length(ItemArray)); - if not FixedSize then - begin - Lo := Max(Low(KeyArray), Low(ItemArray)); - Hi := Min(High(KeyArray), High(ItemArray)); - for I := Lo to Hi do - begin - Put(KeyArray[I], ItemArray[I]); - end; - end; -end; - -constructor TAbstractStringMap.Create(const Map: IStringMap); -var - MapIterator: IStringMapIterator; -begin - Create(Map.GetNaturalItemsOnly); - InitFrom(Map); - Capacity := Map.GetSize; - if not FixedSize then - begin - MapIterator := Map.GetMapIterator; - while not MapIterator.EOF do - begin - Put(MapIterator.CurrentKey, MapIterator.CurrentItem); - MapIterator.Next; - end; - end; -end; - -destructor TAbstractStringMap.Destroy; -begin - FAssociationComparator := nil; - inherited Destroy; -end; - -function TAbstractStringMap.TrueAdd(const Item: ICollectable): Boolean; -var - Position: TCollectionPosition; - Mappable: IStringMappable; -begin - if IsNaturalItem(Item) then - begin - Mappable := Item as IStringMappable; - Position := GetKeyPosition(Mappable.GetKey); - try - if Position.Found then - begin - CollectionError(ceDuplicateKey); - Result := false; - end - else - begin - TruePut(Position, TStringAssociation.Create(Mappable.GetKey, Item)); - Result := true; - end; - finally - Position.Free; - end; - end - else - begin - CollectionError(ceNotNaturalItem); - Result := false; - end; -end; - -function TAbstractStringMap.TrueContains(const Item: ICollectable): Boolean; -var - Item2: ICollectable; - Success: Boolean; - Iterator: IIterator; -begin - Iterator := GetIterator; - Success := false; - while not Iterator.EOF and not Success do - begin - Item2 := Iterator.CurrentItem; - if Comparator.Equals(Item, Item2) then - Success := true; - Iterator.Next; - end; - Result := Success; -end; - -function TAbstractStringMap.TrueRemove(const Item: ICollectable): ICollectable; -var - Item2: ICollectable; - Iterator: IStringMapIterator; - Found: Boolean; -begin - // Sequential search - Found := false; - Result := nil; - Iterator := GetAssociationIterator; - while not Iterator.EOF and not Found do - begin - Item2 := Iterator.CurrentItem; - if Comparator.Equals(Item, Item2) then - begin - Result := Item2; - Iterator.Remove; - Found := true; - end; - Iterator.Next; - end; -end; - -function TAbstractStringMap.TrueRemoveAll(const Item: ICollectable): ICollection; -var - ResultCollection: ICollection; - Item2: ICollectable; - Iterator: IIterator; -begin - // Sequential search - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := GetAssociationIterator; - while not Iterator.EOF do - begin - Item2 := Iterator.CurrentItem; - if Comparator.Equals(Item, Item2) then - begin - ResultCollection.Add(Item2); - Iterator.Remove; - end; - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractStringMap.GetItem(const Key: String): ICollectable; -begin - Result := Get(Key); -end; - -procedure TAbstractStringMap.SetItem(const Key: String; const Item: ICollectable); -begin - Put(Key, Item); -end; - -function TAbstractStringMap.GetIterator: IIterator; -begin - Result := GetAssociationIterator; -end; - -function TAbstractStringMap.GetKeys: ISet; -var - ResultCollection: TPArraySet; - MapIterator: IStringMapIterator; -begin - ResultCollection := TPArraySet.Create(true); - MapIterator := GetMapIterator; - while not MapIterator.EOF do - begin - ResultCollection.Add(TStringWrapper.Create(MapIterator.CurrentKey) as ICollectable); - MapIterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractStringMap.GetMapIterator: IStringMapIterator; -begin - Result := GetAssociationIterator; -end; - -function TAbstractStringMap.GetNaturalItemIID: TGUID; -begin - Result := StringMappableIID; -end; - -function TAbstractStringMap.GetType: TCollectionType; -begin - Result := ctStringMap; -end; - -function TAbstractStringMap.GetValues: ICollection; -var - ResultCollection: ICollection; - ValueIterator: IIterator; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - ValueIterator := GetIterator; - while not ValueIterator.EOF do - begin - ResultCollection.Add(ValueIterator.CurrentItem); - ValueIterator.Next; - end; - Result := ResultCollection; -end; - -// Overrides TAbstractCollection function, otherwise Create(ICollection) is -// called, which cannot access keys. -function TAbstractStringMap.Clone: ICollection; -begin - Result := (TAbstractStringMapClass(ClassType)).Create(Self); -end; - -function TAbstractStringMap.CloneAsStringMap: IStringMap; -begin - Result := (TAbstractStringMapClass(ClassType)).Create(Self); -end; - -function TAbstractStringMap.ContainsKey(const Key: String): Boolean; -var - Position: TCollectionPosition; -begin - Position := GetKeyPosition(Key); - try - Result := Position.Found; - finally - Position.Free; - end; -end; - -function TAbstractStringMap.ContainsKey(const KeyArray: array of String): Boolean; -var - I: Integer; - Success: Boolean; -begin - Success := true; - for I := Low(KeyArray) to High(KeyArray) do - begin - Success := Success and ContainsKey(KeyArray[I]); - if not Success then - break; - end; - Result := Success; -end; - -function TAbstractStringMap.Get(const Key: String): ICollectable; -var - Position: TCollectionPosition; -begin - Position := GetKeyPosition(Key); - try - if Position.Found then - Result := TrueGet(Position).GetValue - else - Result := nil; - finally - Position.Free; - end; -end; - -function TAbstractStringMap.IsNilAllowed: Boolean; -begin - Result := true; -end; - -function TAbstractStringMap.Put(const Item: ICollectable): ICollectable; -var - Mappable: IStringMappable; - OldAssociation, NewAssociation: IStringAssociation; - Position: TCollectionPosition; -begin - if not IsNaturalItem(Item) then - begin - CollectionError(ceNotNaturalItem); - Result := nil; - end - else - begin - Item.QueryInterface(IStringMappable, Mappable); - Position := GetKeyPosition(Mappable.GetKey); - try - NewAssociation := TStringAssociation.Create(Mappable.GetKey, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - Result := OldAssociation.GetValue - else - Result := nil; - finally - Position.Free; - end; - end; -end; - -function TAbstractStringMap.Put(const Key: String; const Item: ICollectable): ICollectable; -var - OldAssociation, NewAssociation: IStringAssociation; - ItemError: TCollectionError; - Position: TCollectionPosition; -begin - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - Result := nil; - end - else - begin - Position := GetKeyPosition(Key); - try - NewAssociation := TStringAssociation.Create(Key, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - Result := OldAssociation.GetValue - else - Result := nil; - finally - Position.Free; - end; - end; -end; - -function TAbstractStringMap.Put(const ItemArray: array of ICollectable): ICollection; -var - ResultCollection: ICollection; - Mappable: IStringMappable; - OldAssociation, NewAssociation: IStringAssociation; - Position: TCollectionPosition; - Item: ICollectable; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(ItemArray) to High(ItemArray) do - begin - Item := ItemArray[I]; - if not IsNaturalItem(Item) then - begin - CollectionError(ceNotNaturalItem); - end - else - begin - Item.QueryInterface(IStringMappable, Mappable); - Position := GetKeyPosition(Mappable.GetKey); - try - NewAssociation := TStringAssociation.Create(Mappable.GetKey, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - ResultCollection.Add(OldAssociation.GetValue); - finally - Position.Free; - end; - end; - end; - Result := ResultCollection; -end; - -function TAbstractStringMap.Put(const Collection: ICollection): ICollection; -var - ResultCollection: ICollection; - Mappable: IStringMappable; - OldAssociation, NewAssociation: IStringAssociation; - Position: TCollectionPosition; - Iterator: IIterator; - Item: ICollectable; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - Iterator := Collection.GetIterator; - while not Iterator.EOF do - begin - Item := Iterator.CurrentItem;; - if not IsNaturalItem(Item) then - begin - CollectionError(ceNotNaturalItem); - end - else - begin - Item.QueryInterface(IStringMappable, Mappable); - Position := GetKeyPosition(Mappable.GetKey); - try - NewAssociation := TStringAssociation.Create(Mappable.GetKey, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - ResultCollection.Add(OldAssociation.GetValue); - finally - Position.Free; - end; - end; - Iterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractStringMap.Put(const Map: IStringMap): ICollection; -var - ResultCollection: ICollection; - OldAssociation, NewAssociation: IStringAssociation; - ItemError: TCollectionError; - Position: TCollectionPosition; - MapIterator: IStringMapIterator; - Item: ICollectable; - Key: String; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - MapIterator := Map.GetMapIterator; - while not MapIterator.EOF do - begin - Key := MapIterator.CurrentKey; - Item := MapIterator.CurrentItem; - - ItemError := ItemAllowed(Item); - if ItemError <> ceOK then - begin - CollectionError(ItemError); - end - else - begin - Position := GetKeyPosition(Key); - try - NewAssociation := TStringAssociation.Create(Key, Item); - OldAssociation := TruePut(Position, NewAssociation); - if OldAssociation <> nil then - ResultCollection.Add(OldAssociation.GetValue); - finally - Position.Free; - end; - end; - MapIterator.Next; - end; - Result := ResultCollection; -end; - -function TAbstractStringMap.RemoveKey(const Key: String): ICollectable; -var - Position: TCollectionPosition; - OldAssociation: IStringAssociation; -begin - Position := GetKeyPosition(Key); - try - if Position.Found then - begin - OldAssociation := TrueRemove2(Position); - Result := OldAssociation.GetValue - end - else - Result := nil; - finally - Position.Free; - end; -end; - -function TAbstractStringMap.RemoveKey(const KeyArray: array of String): ICollection; -var - ResultCollection: ICollection; - OldAssociation: IStringAssociation; - Position: TCollectionPosition; - Key: String; - I: Integer; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - for I := Low(KeyArray) to High(KeyArray) do - begin - Key := KeyArray[I]; - Position := GetKeyPosition(Key); - try - if Position.Found then - begin - OldAssociation := TrueRemove2(Position); - ResultCollection.Add(OldAssociation.GetValue); - end; - finally - Position.Free; - end; - end; - Result := ResultCollection; -end; - -function TAbstractStringMap.RetainKey(const KeyArray: array of String): ICollection; -var - ResultCollection: ICollection; - MapIterator: IStringMapIterator; - I: Integer; - Found: Boolean; -begin - ResultCollection := TPArrayBag.Create(NaturalItemsOnly); - if FixedSize then - begin - CollectionError(ceFixedSize); - end - else - begin - MapIterator := GetMapIterator; - while not MapIterator.EOF do - begin - // Converting the array to a map would be faster but I don't want to - // couple base class code to a complex collection. - Found := false; - for I := Low(KeyArray) to High(KeyArray) do - begin - Found := (MapIterator.CurrentKey = KeyArray[I]); - if Found then - break; - end; - if not Found then - begin - ResultCollection.Add(MapIterator.CurrentItem); - MapIterator.Remove; - end; - MapIterator.Next; - end; - Result := ResultCollection; - end; -end; - - -{ ECollectionError } -constructor ECollectionError.Create(const Msg: String; const Collection: ICollection; ErrorType: TCollectionError); -begin - inherited Create(Msg); - FCollection := Collection; - FErrorType := ErrorType; -end; - -{ TAbstractListIterator } -constructor TAbstractListIterator.Create(Collection: TAbstractList); -begin - inherited Create(true); - FCollection := Collection; - First; -end; - -function TAbstractListIterator.TrueFirst: ICollectable; -begin - FIndex := 0; - if FIndex < FCollection.GetSize then - Result := FCollection.GetItem(FIndex) - else - Result := nil; -end; - -function TAbstractListIterator.TrueNext: ICollectable; -begin - Inc(FIndex); - if FIndex < FCollection.GetSize then - Result := FCollection.GetItem(FIndex) - else - Result := nil; -end; - -procedure TAbstractListIterator.TrueRemove; -begin - FCollection.Delete(FIndex); - Dec(FIndex); -end; - -end. diff --git a/src/lib/collections/readme.txt b/src/lib/collections/readme.txt deleted file mode 100644 index 1f6477de..00000000 --- a/src/lib/collections/readme.txt +++ /dev/null @@ -1,14 +0,0 @@ -Delphi Collections by Matthew Greet -http://www.warmachine.u-net.com/delphi_collections/ - -Help files (MS .hlp format) at -http://www.warmachine.u-net.com/downloads/delphi_collections_1_0_help.zip - -Changes -===================== -2008-11-06 FPC compatibility fixes by UltraStar Deluxe Team -2005-03-14 Maintenance release v1.0.5 - bug fix for sorted lists and functional tests checks unsorted and sorted lists. -2004-10-14 Maintenance release v1.0.4 - memory leak fixed. -2004-06-12 Maintenance release v1.0.3 - memory leak fixed, memory leak test, new Capacity property. -2004-02-13 Maintenance release v1.0.2 - expanded introduction and quick start sections in help file. -2003-10-25 Maintenance release v1.0.1 - packages and test harness no longer list unused packages. \ No newline at end of file diff --git a/src/lib/ffmpeg-0.10/How to update the ffmpeg files.txt b/src/lib/ffmpeg-0.10/How to update the ffmpeg files.txt deleted file mode 100644 index 976d0eff..00000000 --- a/src/lib/ffmpeg-0.10/How to update the ffmpeg files.txt +++ /dev/null @@ -1,12 +0,0 @@ -how to update the ffmpeg files: - -1) rational.pas - error.pas -2) mathematics.pas - dict.pas - opt.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-0.10/ToDo.txt b/src/lib/ffmpeg-0.10/ToDo.txt deleted file mode 100644 index de773c78..00000000 --- a/src/lib/ffmpeg-0.10/ToDo.txt +++ /dev/null @@ -1,6 +0,0 @@ -1) opt.pas -PAVClass - -2) avutil.pas -inline function av_x_if_null -inline function av_size_mult diff --git a/src/lib/ffmpeg-0.10/avcodec.pas b/src/lib/ffmpeg-0.10/avcodec.pas deleted file mode 100644 index bfc2c3ba..00000000 --- a/src/lib/ffmpeg-0.10/avcodec.pas +++ /dev/null @@ -1,5205 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 52.122.0 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 53; - LIBAVCODEC_MAX_VERSION_MINOR = 61; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 52; - LIBAVCODEC_MIN_VERSION_MINOR = 122; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const -{$ifndef FF_API_PALETTE_CONTROL} - FF_API_PALETTE_CONTROL = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_SAMPLE_FMT} - FF_API_OLD_SAMPLE_FMT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_AUDIOCONVERT} - FF_API_OLD_AUDIOCONVERT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ANTIALIAS_ALGO} - FF_API_ANTIALIAS_ALGO = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_REQUEST_CHANNELS} - FF_API_REQUEST_CHANNELS = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OPT_H} - FF_API_OPT_H = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_THREAD_INIT} - FF_API_THREAD_INIT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_FF_PICT_TYPES} - FF_API_OLD_FF_PICT_TYPES = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FLAC_GLOBAL_OPTS} - FF_API_FLAC_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_GET_PIX_FMT_NAME} - FF_API_GET_PIX_FMT_NAME = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ALLOC_CONTEXT} - FF_API_ALLOC_CONTEXT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_AVCODEC_OPEN} - FF_API_AVCODEC_OPEN = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_DRC_SCALE} - FF_API_DRC_SCALE = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ER} - FF_API_ER = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_AVCODEC_INIT} - FF_API_AVCODEC_INIT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_X264_GLOBAL_OPTS} - FF_API_X264_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_MPEGVIDEO_GLOBAL_OPTS} -// FF_API_MPEGVIDEO_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_LAME_GLOBAL_OPTS} -// FF_API_LAME_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_SNOW_GLOBAL_OPTS} -// FF_API_SNOW_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_MJPEG_GLOBAL_OPTS} -// FF_API_MJPEG_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_GET_ALPHA_INFO} - FF_API_GET_ALPHA_INFO = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_PARSE_FRAME} - FF_API_PARSE_FRAME = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_INTERNAL_CONTEXT} - FF_API_INTERNAL_CONTEXT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_TIFFENC_COMPLEVEL} - FF_API_TIFFENC_COMPLEVEL = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_DATA_POINTERS} - FF_API_DATA_POINTERS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} - FF_API_OLD_DECODE_AUDIO = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OLD_TIMECODE} - FF_API_OLD_TIMECODE = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} - -{$ifndef FF_API_AVFRAME_AGE} - FF_API_AVFRAME_AGE = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_ENCODE_AUDIO} - FF_API_OLD_ENCODE_AUDIO = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. it is as close as possible to similar codecs. - *) -type - TCodecID = ( - CODEC_ID_NONE, - - //* video codecs */ - CODEC_ID_MPEG1VIDEO, - CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - CODEC_ID_MPEG2VIDEO_XVMC, - CODEC_ID_H261, - CODEC_ID_H263, - CODEC_ID_RV10, - CODEC_ID_RV20, - CODEC_ID_MJPEG, - CODEC_ID_MJPEGB, - CODEC_ID_LJPEG, - CODEC_ID_SP5X, - CODEC_ID_JPEGLS, - CODEC_ID_MPEG4, - CODEC_ID_RAWVIDEO, - CODEC_ID_MSMPEG4V1, - CODEC_ID_MSMPEG4V2, - CODEC_ID_MSMPEG4V3, - CODEC_ID_WMV1, - CODEC_ID_WMV2, - CODEC_ID_H263P, - CODEC_ID_H263I, - CODEC_ID_FLV1, - CODEC_ID_SVQ1, - CODEC_ID_SVQ3, - CODEC_ID_DVVIDEO, - CODEC_ID_HUFFYUV, - CODEC_ID_CYUV, - CODEC_ID_H264, - CODEC_ID_INDEO3, - CODEC_ID_VP3, - CODEC_ID_THEORA, - CODEC_ID_ASV1, - CODEC_ID_ASV2, - CODEC_ID_FFV1, - CODEC_ID_4XM, - CODEC_ID_VCR1, - CODEC_ID_CLJR, - CODEC_ID_MDEC, - CODEC_ID_ROQ, - CODEC_ID_INTERPLAY_VIDEO, - CODEC_ID_XAN_WC3, - CODEC_ID_XAN_WC4, - CODEC_ID_RPZA, - CODEC_ID_CINEPAK, - CODEC_ID_WS_VQA, - CODEC_ID_MSRLE, - CODEC_ID_MSVIDEO1, - CODEC_ID_IDCIN, - CODEC_ID_8BPS, - CODEC_ID_SMC, - CODEC_ID_FLIC, - CODEC_ID_TRUEMOTION1, - CODEC_ID_VMDVIDEO, - CODEC_ID_MSZH, - CODEC_ID_ZLIB, - CODEC_ID_QTRLE, - CODEC_ID_SNOW, - CODEC_ID_TSCC, - CODEC_ID_ULTI, - CODEC_ID_QDRAW, - CODEC_ID_VIXL, - CODEC_ID_QPEG, - CODEC_ID_PNG, - CODEC_ID_PPM, - CODEC_ID_PBM, - CODEC_ID_PGM, - CODEC_ID_PGMYUV, - CODEC_ID_PAM, - CODEC_ID_FFVHUFF, - CODEC_ID_RV30, - CODEC_ID_RV40, - CODEC_ID_VC1, - CODEC_ID_WMV3, - CODEC_ID_LOCO, - CODEC_ID_WNV1, - CODEC_ID_AASC, - CODEC_ID_INDEO2, - CODEC_ID_FRAPS, - CODEC_ID_TRUEMOTION2, - CODEC_ID_BMP, - CODEC_ID_CSCD, - CODEC_ID_MMVIDEO, - CODEC_ID_ZMBV, - CODEC_ID_AVS, - CODEC_ID_SMACKVIDEO, - CODEC_ID_NUV, - CODEC_ID_KMVC, - CODEC_ID_FLASHSV, - CODEC_ID_CAVS, - CODEC_ID_JPEG2000, - CODEC_ID_VMNC, - CODEC_ID_VP5, - CODEC_ID_VP6, - CODEC_ID_VP6F, - CODEC_ID_TARGA, - CODEC_ID_DSICINVIDEO, - CODEC_ID_TIERTEXSEQVIDEO, - CODEC_ID_TIFF, - CODEC_ID_GIF, -{$IF LIBAVCODEC_VERSION_MAJOR = 53} - CODEC_ID_FFH264, -{$IFEND} - CODEC_ID_DXA, - CODEC_ID_DNXHD, - CODEC_ID_THP, - CODEC_ID_SGI, - CODEC_ID_C93, - CODEC_ID_BETHSOFTVID, - CODEC_ID_PTX, - CODEC_ID_TXD, - CODEC_ID_VP6A, - CODEC_ID_AMV, - CODEC_ID_VB, - CODEC_ID_PCX, - CODEC_ID_SUNRAST, - CODEC_ID_INDEO4, - CODEC_ID_INDEO5, - CODEC_ID_MIMIC, - CODEC_ID_RL2, -{$IF LIBAVCODEC_VERSION_MAJOR = 53} - CODEC_ID_8SVX_EXP, - CODEC_ID_8SVX_FIB, -{$IFEND} - CODEC_ID_ESCAPE124, - CODEC_ID_DIRAC, - CODEC_ID_BFI, - CODEC_ID_CMV, - CODEC_ID_MOTIONPIXELS, - CODEC_ID_TGV, - CODEC_ID_TGQ, - CODEC_ID_TQI, - CODEC_ID_AURA, - CODEC_ID_AURA2, - CODEC_ID_V210X, - CODEC_ID_TMV, - CODEC_ID_V210, - CODEC_ID_DPX, - CODEC_ID_MAD, - CODEC_ID_FRWU, - CODEC_ID_FLASHSV2, - CODEC_ID_CDGRAPHICS, - CODEC_ID_R210, - CODEC_ID_ANM, - CODEC_ID_BINKVIDEO, - CODEC_ID_IFF_ILBM, - CODEC_ID_IFF_BYTERUN1, - CODEC_ID_KGV1, - CODEC_ID_YOP, - CODEC_ID_VP8, - CODEC_ID_PICTOR, - CODEC_ID_ANSI, - CODEC_ID_A64_MULTI, - CODEC_ID_A64_MULTI5, - CODEC_ID_R10K, - CODEC_ID_MXPEG, - CODEC_ID_LAGARITH, - CODEC_ID_PRORES, - CODEC_ID_JV, - CODEC_ID_DFA, - CODEC_ID_WMV3IMAGE, - CODEC_ID_VC1IMAGE, -{$IF LIBAVCODEC_VERSION_MAJOR = 53} - CODEC_ID_G723_1_DEPRECATED, - CODEC_ID_G729_DEPRECATED, -{$IFEND} - CODEC_ID_UTVIDEO_DEPRECATED, - CODEC_ID_BMV_VIDEO, - CODEC_ID_VBLE, - CODEC_ID_DXTORY, - CODEC_ID_V410, - CODEC_ID_XWD, - CODEC_ID_UTVIDEO = $0800, - - //* various PCM "codecs" */ - CODEC_ID_PCM_S16LE = $10000, - CODEC_ID_PCM_S16BE, - CODEC_ID_PCM_U16LE, - CODEC_ID_PCM_U16BE, - CODEC_ID_PCM_S8, - CODEC_ID_PCM_U8, - CODEC_ID_PCM_MULAW, - CODEC_ID_PCM_ALAW, - CODEC_ID_PCM_S32LE, - CODEC_ID_PCM_S32BE, - CODEC_ID_PCM_U32LE, - CODEC_ID_PCM_U32BE, - CODEC_ID_PCM_S24LE, - CODEC_ID_PCM_S24BE, - CODEC_ID_PCM_U24LE, - CODEC_ID_PCM_U24BE, - CODEC_ID_PCM_S24DAUD, - CODEC_ID_PCM_ZORK, - CODEC_ID_PCM_S16LE_PLANAR, - CODEC_ID_PCM_DVD, - CODEC_ID_PCM_F32BE, - CODEC_ID_PCM_F32LE, - CODEC_ID_PCM_F64BE, - CODEC_ID_PCM_F64LE, - CODEC_ID_PCM_BLURAY, - CODEC_ID_PCM_LXF, - CODEC_ID_S302M, - CODEC_ID_PCM_S8_PLANAR, - - //* various ADPCM codecs */ - CODEC_ID_ADPCM_IMA_QT = $11000, - CODEC_ID_ADPCM_IMA_WAV, - CODEC_ID_ADPCM_IMA_DK3, - CODEC_ID_ADPCM_IMA_DK4, - CODEC_ID_ADPCM_IMA_WS, - CODEC_ID_ADPCM_IMA_SMJPEG, - CODEC_ID_ADPCM_MS, - CODEC_ID_ADPCM_4XM, - CODEC_ID_ADPCM_XA, - CODEC_ID_ADPCM_ADX, - CODEC_ID_ADPCM_EA, - CODEC_ID_ADPCM_G726, - CODEC_ID_ADPCM_CT, - CODEC_ID_ADPCM_SWF, - CODEC_ID_ADPCM_YAMAHA, - CODEC_ID_ADPCM_SBPRO_4, - CODEC_ID_ADPCM_SBPRO_3, - CODEC_ID_ADPCM_SBPRO_2, - CODEC_ID_ADPCM_THP, - CODEC_ID_ADPCM_IMA_AMV, - CODEC_ID_ADPCM_EA_R1, - CODEC_ID_ADPCM_EA_R3, - CODEC_ID_ADPCM_EA_R2, - CODEC_ID_ADPCM_IMA_EA_SEAD, - CODEC_ID_ADPCM_IMA_EA_EACS, - CODEC_ID_ADPCM_EA_XAS, - CODEC_ID_ADPCM_EA_MAXIS_XA, - CODEC_ID_ADPCM_IMA_ISS, - CODEC_ID_ADPCM_G722, - CODEC_ID_ADPCM_IMA_APC, - - //* AMR */ - CODEC_ID_AMR_NB = $12000, - CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - CODEC_ID_RA_144 = $13000, - CODEC_ID_RA_288, - - //* various DPCM codecs */ - CODEC_ID_ROQ_DPCM = $14000, - CODEC_ID_INTERPLAY_DPCM, - CODEC_ID_XAN_DPCM, - CODEC_ID_SOL_DPCM, - - //* audio codecs */ - CODEC_ID_MP2 = $15000, - CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - CODEC_ID_AAC, - CODEC_ID_AC3, - CODEC_ID_DTS, - CODEC_ID_VORBIS, - CODEC_ID_DVAUDIO, - CODEC_ID_WMAV1, - CODEC_ID_WMAV2, - CODEC_ID_MACE3, - CODEC_ID_MACE6, - CODEC_ID_VMDAUDIO, -{$IF LIBAVCODEC_VERSION_MAJOR = 53} - CODEC_ID_SONIC, - CODEC_ID_SONIC_LS, -{$IFEND} - CODEC_ID_FLAC, - CODEC_ID_MP3ADU, - CODEC_ID_MP3ON4, - CODEC_ID_SHORTEN, - CODEC_ID_ALAC, - CODEC_ID_WESTWOOD_SND1, - CODEC_ID_GSM, ///< as in Berlin toast format - CODEC_ID_QDM2, - CODEC_ID_COOK, - CODEC_ID_TRUESPEECH, - CODEC_ID_TTA, - CODEC_ID_SMACKAUDIO, - CODEC_ID_QCELP, - CODEC_ID_WAVPACK, - CODEC_ID_DSICINAUDIO, - CODEC_ID_IMC, - CODEC_ID_MUSEPACK7, - CODEC_ID_MLP, - CODEC_ID_GSM_MS, { as found in WAV } - CODEC_ID_ATRAC3, - CODEC_ID_VOXWARE, - CODEC_ID_APE, - CODEC_ID_NELLYMOSER, - CODEC_ID_MUSEPACK8, - CODEC_ID_SPEEX, - CODEC_ID_WMAVOICE, - CODEC_ID_WMAPRO, - CODEC_ID_WMALOSSLESS, - CODEC_ID_ATRAC3P, - CODEC_ID_EAC3, - CODEC_ID_SIPR, - CODEC_ID_MP1, - CODEC_ID_TWINVQ, - CODEC_ID_TRUEHD, - CODEC_ID_MP4ALS, - CODEC_ID_ATRAC1, - CODEC_ID_BINKAUDIO_RDFT, - CODEC_ID_BINKAUDIO_DCT, - CODEC_ID_AAC_LATM, - CODEC_ID_QDMC, - CODEC_ID_CELT, -//{$IF LIBAVCODEC_VERSION_MAJOR > 53} -// CODEC_ID_G723_1_DEPRECATED, -// CODEC_ID_G729_DEPRECATED, -// CODEC_ID_8SVX_EXP, -// CODEC_ID_8SVX_FIB, -//{$IFEND} - CODEC_ID_BMV_AUDIO, - CODEC_ID_G729 = $15800, - CODEC_ID_G723_1= $15801, - - //* subtitle codecs */ - CODEC_ID_DVD_SUBTITLE = $17000, - CODEC_ID_DVB_SUBTITLE, - CODEC_ID_TEXT, ///< raw UTF-8 text - CODEC_ID_XSUB, - CODEC_ID_SSA, - CODEC_ID_MOV_TEXT, - CODEC_ID_HDMV_PGS_SUBTITLE, - CODEC_ID_DVB_TELETEXT, - CODEC_ID_SRT, - - //* other specific kind of codecs (generally used for attachments) */ - CODEC_ID_TTF = $18000, - - CODEC_ID_PROBE = $19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it - - CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - - CODEC_ID_G2M = $0047324D, - CODEC_ID_IDF = $00494446, - CODEC_ID_8SVX_RAW = $38535658, - CODEC_ID_AVRP = $41565250, - CODEC_ID_BINTEXT = $42545854, - CODEC_ID_ESCAPE130 = $45313330, - CODEC_ID_FFWAVESYNTH = $46465753, - CODEC_ID_V308 = $56333038, - CODEC_ID_XBIN = $5842494E, - CODEC_ID_Y41P = $59343150, - CODEC_ID_YUV4 = $59555634, - CODEC_ID_MICRODVD = $6D445644 - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -{$IF FF_API_OLD_AUDIOCONVERT} - -{$I libavcodec/audioconvert.pas} - -const - {* Audio channel masks *} - CH_FRONT_LEFT = AV_CH_FRONT_LEFT; - CH_FRONT_RIGHT = AV_CH_FRONT_RIGHT; - CH_FRONT_CENTER = AV_CH_FRONT_CENTER; - CH_LOW_FREQUENCY = AV_CH_LOW_FREQUENCY; - CH_BACK_LEFT = AV_CH_BACK_LEFT; - CH_BACK_RIGHT = AV_CH_BACK_RIGHT; - CH_FRONT_LEFT_OF_CENTER = AV_CH_FRONT_LEFT_OF_CENTER; - CH_FRONT_RIGHT_OF_CENTER = AV_CH_FRONT_RIGHT_OF_CENTER; - CH_BACK_CENTER = AV_CH_BACK_CENTER; - CH_SIDE_LEFT = AV_CH_SIDE_LEFT; - CH_SIDE_RIGHT = AV_CH_SIDE_RIGHT; - CH_TOP_CENTER = AV_CH_TOP_CENTER; - CH_TOP_FRONT_LEFT = AV_CH_TOP_FRONT_LEFT; - CH_TOP_FRONT_CENTER = AV_CH_TOP_FRONT_CENTER; - CH_TOP_FRONT_RIGHT = AV_CH_TOP_FRONT_RIGHT; - CH_TOP_BACK_LEFT = AV_CH_TOP_BACK_LEFT; - CH_TOP_BACK_CENTER = AV_CH_TOP_BACK_CENTER; - CH_TOP_BACK_RIGHT = AV_CH_TOP_BACK_RIGHT; - CH_STEREO_LEFT = AV_CH_STEREO_LEFT; - CH_STEREO_RIGHT = AV_CH_STEREO_RIGHT; - -{** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *} - CH_LAYOUT_NATIVE = AV_CH_LAYOUT_NATIVE; - - {* Audio channel convenience macros *} - CH_LAYOUT_MONO = AV_CH_LAYOUT_MONO; - CH_LAYOUT_STEREO = AV_CH_LAYOUT_STEREO; - CH_LAYOUT_2_1 = AV_CH_LAYOUT_2_1; - CH_LAYOUT_SURROUND = AV_CH_LAYOUT_SURROUND; - CH_LAYOUT_4POINT0 = AV_CH_LAYOUT_4POINT0; - CH_LAYOUT_2_2 = AV_CH_LAYOUT_2_2; - CH_LAYOUT_QUAD = AV_CH_LAYOUT_QUAD; - CH_LAYOUT_5POINT0 = AV_CH_LAYOUT_5POINT0; - CH_LAYOUT_5POINT1 = AV_CH_LAYOUT_5POINT1; - CH_LAYOUT_5POINT0_BACK = AV_CH_LAYOUT_5POINT0_BACK; - CH_LAYOUT_5POINT1_BACK = AV_CH_LAYOUT_5POINT1_BACK; - CH_LAYOUT_7POINT0 = AV_CH_LAYOUT_7POINT0; - CH_LAYOUT_7POINT1 = AV_CH_LAYOUT_7POINT1; - CH_LAYOUT_7POINT1_WIDE = AV_CH_LAYOUT_7POINT1_WIDE; - CH_LAYOUT_STEREO_DOWNMIX = AV_CH_LAYOUT_STEREO_DOWNMIX; -{$IFEND} - -{$IF FF_API_OLD_DECODE_AUDIO} -{* in bytes *} - AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio -{$IFEND} - -{** - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *} - FF_INPUT_BUFFER_PADDING_SIZE = 16; - -{** - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *} - FF_MIN_BUFFER_SIZE = 16384; - -type -{* - * motion estimation type. - *} - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - - TAVDiscard = ( - {* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *} - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_SPC_SMPTE240M = 7, - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - -{$IF FF_API_FLAC_GLOBAL_OPTS} -(** - * LPC analysis type - *) - TAVLPCType = ( - AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type - AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients - AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients - AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion - AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization - AV_LPC_TYPE_NB ///< Not part of ABI - ); -{$IFEND} - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -{* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*} - - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - {** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *} - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - {* Fx : Flag for h263+ extra options *} - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_H263P_UMV = $02000000; ///< Unlimited motion vector - CODEC_FLAG_CBP_RD = $04000000; ///< use rate distortion optimization for cbp - CODEC_FLAG_QP_RD = $08000000; ///< use rate distortion optimization for qp selectioon - CODEC_FLAG_H263P_AIV = $00000008; ///< H263 Alternative inter vlc - CODEC_FLAG_OBMC = $00000001; ///< OBMC - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_H263P_SLICE_STRUCT = $10000000; - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_SVCD_SCAN_OFFSET = $40000000; ///< will reserve space for SVCD scan offset user data - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_STRICT_GOP = $00000002; ///< strictly enforce GOP size - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_SKIP_RD = $00004000; ///< RD optimal MB level residual skipping - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe -(** - * @defgroup deprecated_flags Deprecated codec flags - * Use corresponding private codec options instead. - * @{ - *) -{$IFDEF FF_API_MPEGVIDEO_GLOBAL_OPTS} - CODEC_FLAG_OBMC = $00000001; ///< OBMC - CODEC_FLAG_H263P_AIV = $00000008; ///< H.263 alternative inter VLC - CODEC_FLAG_PART = $0080; ///< Use data partitioning. - CODEC_FLAG_ALT_SCAN = $00100000; ///< Use alternate scan. - CODEC_FLAG_H263P_UMV = $02000000; ///< unlimited motion vector - CODEC_FLAG_H263P_SLICE_STRUCT = $10000000; - CODEC_FLAG_SVCD_SCAN_OFFSET = $40000000; ///< Will reserve space for SVCD scan offset user data. - CODEC_FLAG2_INTRA_VLC = $00000800; ///< Use MPEG-2 intra VLC table. - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. - CODEC_FLAG2_NON_LINEAR_QUANT = $00010000; ///< Use MPEG-2 nonlinear quantizer. -{$ENDIF} -{$IFDEF FF_API_MJPEG_GLOBAL_OPTS} - CODEC_FLAG_EXTERN_HUFF = $1000; ///< Use external Huffman table (for MJPEG). -{$ENDIF} -{$IF FF_API_X264_GLOBAL_OPTS} - CODEC_FLAG2_BPYRAMID = $00000010; ///< H.264 allow b-frames to be used as references - CODEC_FLAG2_WPRED = $00000020; ///< H.264 weighted biprediction for b-frames - CODEC_FLAG2_MIXED_REFS = $00000040; ///< H.264 multiple references per partition - CODEC_FLAG2_8X8DCT = $00000080; ///< H.264 high profile 8x8 transform - CODEC_FLAG2_FASTPSKIP = $00000100; ///< H.264 fast pskip - CODEC_FLAG2_AUD = $00000200; ///< H.264 access unit delimiters - CODEC_FLAG2_BRDO = $00000400; ///< b-frame rate-distortion optimization - CODEC_FLAG2_MBTREE = $00040000; ///< Use macroblock tree ratecontrol (x264 only) - CODEC_FLAG2_PSY = $00080000; ///< Use psycho visual optimizations. - CODEC_FLAG2_SSIM = $00100000; ///< Compute SSIM during encoding, error[] values are undefined. - CODEC_FLAG2_INTRA_REFRESH = $00200000; ///< Use periodic insertion of intra blocks instead of keyframes. -{$IFEND} -{$IFDEF FF_API_SNOW_GLOBAL_OPTS} - CODEC_FLAG2_MEMC_ONLY = $00001000; ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC). -{$ENDIF} -{$IFDEF FF_API_LAME_GLOBAL_OPTS} - CODEC_FLAG2_BIT_RESERVOIR = $00020000; ///< Use a bit reservoir when encoding if possible -{$ENDIF} -(** - * @} - *) - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - - (** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; -{$IF FF_API_PARSE_FRAME} - (* if 'parse_only' field is true, then avcodec_parse_frame() can be used *) - CODEC_CAP_PARSE_ONLY = $0004; -{$IFEND} - CODEC_CAP_TRUNCATED = $0008; - - (* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - - (** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - - (** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - - (** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - - (** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - - (** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - - (** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - - (** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - - (** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - - (** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - (** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - (** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - (** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - -{$IF FF_API_OLD_FF_PICT_TYPES} -(* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values *) - FF_I_TYPE = 1; ///< Intra - FF_P_TYPE = 2; ///< Predicted - FF_B_TYPE = 3; ///< Bi-dir predicted - FF_S_TYPE = 4; ///< S(GMC)-VOP MPEG4 - FF_SI_TYPE = 5; ///< Switching Intra - FF_SP_TYPE = 6; ///< Switching Predicted - FF_BI_TYPE = 7; -{$IFEND} - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - //FF_BUG_FAKE_SCALABILITY = 16 //Autodetection should work 100%. - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_ER_CAREFUL = 1; - FF_ER_COMPLIANT = 2; - FF_ER_AGGRESSIVE = 3; - FF_ER_VERY_AGGRESSIVE = 4; - FF_ER_EXPLODE = 5; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_LIBMPEG2MMX = 4; - FF_IDCT_PS2 = 5; - FF_IDCT_MLIB = 6; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_H264 = 11; - FF_IDCT_VP3 = 12; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_CAVS = 15; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_WMV2 = 19; - FF_IDCT_FAAN = 20; - FF_IDCT_EA = 21; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - FF_IDCT_BINK = 24; - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - -{$IF FF_API_ANTIALIAS_ALGO} - FF_AA_AUTO = 0; - FF_AA_FASTINT = 1; //not implemented yet - FF_AA_INT = 2; - FF_AA_FLOAT = 3; -{$IFEND} - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_LEVEL_UNKNOWN = -99; - - X264_PART_I4X4 = $001; (* Analyse i4x4 *) - X264_PART_I8X8 = $002; (* Analyse i8x8 (requires 8x8 transform) *) - X264_PART_P8X8 = $010; (* Analyse p16x8, p8x16 and p8x8 *) - X264_PART_P4X4 = $020; (* Analyse p8x4, p4x8, p4x4 *) - X264_PART_B8X8 = $100; (* Analyse b16x8, b8x16 and b8x8 *) - - FF_COMPRESSION_DEFAULT = -1; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; - AV_EF_BUFFER = 4; - AV_EF_EXPLODE = 8; - - AV_EF_CAREFUL = 65536; - AV_EF_COMPLIANT = 131072; - AV_EF_AGGRESSIVE = 262144; - - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type - AVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - AV_PKT_DATA_PARAM_CHANGE - ); - - TAVPacketSideDataType = record - data: PByte; - size: cint; - type_: AVPacketSideDataType; - end; - PAVPacketSideDataType = ^TAVPacketSideDataType; - - PAVPacket = ^TAVPacket; - TAVPacket = record -(* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; -(* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideDataType; - side_data_elems: cint; -(* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; - pos: cint64; // byte position in stream, -1 if unknown - -(* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - -{$IF FF_API_DATA_POINTERS} - AV_NUM_DATA_POINTERS = 4; -{$ELSE} - AV_NUM_DATA_POINTERS = 8; -{$IFEND} - -(** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - *) - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -type - PAVCodecContext = ^TAVCodecContext; - - (** - * Audio Video Frame. - * New fields can be added to the end of AVFRAME with minor version - * bumps. Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - * Removal, reordering and changes in the remaining cases require - * a major version bump. - * sizeof(AVFrame) must not be used outside libavcodec. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user (video only) - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - -{$IF FF_API_AVFRAME_AGE} - (** - * @deprecated unused - *) - age: cint; -{$IFEND} - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: byte; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * - *) - qscale_type: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * reordered pts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: unused - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: unused - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: PPointer; - - (** - * reordered sample aspect ratio for the video frame, 0/1 if unknown\unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * format of the frame, -1 if unknown or unset - * It should be cast to the corresponding enum (enum PixelFormat - * for video, enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - end; {TAVFrame} - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - -{$IF FF_API_PALETTE_CONTROL} -(** - * AVPaletteControl - * This structure defines a method for communicating palette changes - * between and demuxer and a decoder. - * - * @deprecated Use AVPacket to send palette changes instead. - * This is totally broken. - *) - PAVPaletteControl = ^TAVPaletteControl; - TAVPaletteControl = record - (* demuxer sets this to 1 to indicate the palette has changed; - * decoder resets to 0 *) - palette_changed: cint; - - (* 4-byte ARGB palette entries, stored in native byte order; note that - * the individual palette components should be on a 8-bit scale; if - * the palette data comes from a IBM VGA native format, the component - * data is probably 6 bits in size and needs to be scaled *) - palette: array [0..AVPALETTE_COUNT - 1] of cuint; - end; {deprecated;} -{$IFEND} - - AVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - - (** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * Some codecs need additional format info. It is stored here. - * If any muxer uses this then ALL demuxers/parsers AND encoders for the - * specific codec MUST set it correctly otherwise stream copy breaks. - * In general use of this field by muxers is not recommended. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. (FIXME: Is this OK?) - *) - sub_id: cint; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid prolems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - * Note: For compatibility it is possible to set this instead of - * coded_width/height before decoding. - *) - width, height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overriden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Samples per packet, initialized when calling 'init'. - *) - frame_size: cint; - frame_number: cint; ///< audio or video frame number - - (** - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - codec: PAVCodec; - - priv_data: pointer; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - codec_name: array [0..31] of AnsiChar; - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec_id: TCodecID; (* see CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - luma_elim_threshold: cint; - - (** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - chroma_elim_threshold: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - -{$IF FF_API_ER} - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; {deprecated} -{$IFEND} - - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - -{$IF FF_API_PARSE_FRAME} - (** - * If true, only parsing is done. The frame data is returned. - * Only MPEG audio decoders support this now. - * - encoding: unused - * - decoding: Set by user - *) - parse_only: cint; {deprecated} -{$IFEND} - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override: PRcOverride; - rc_override_count: cint; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - rc_buffer_aggressivity: cfloat; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * dsp_mask could be add used to disable unwanted CPU features - * CPU features (i.e. MMX, SSE. ...) - * - * With the FORCE flag you may instead enable given CPU features. - * (Dangerous: Usable in case of misdetection, improper usage however will - * result into program crash.) - *) - dsp_mask: cuint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - *) - color_table_id: cint; - -{$IF FF_API_INTERNAL_CONTEXT} - (** - * internal_buffer count - * Don't touch, used by libavcodec default_get_buffer(). - * @deprecated this field was moved to an internal context - *) - internal_buffer_count: cint; {deprecated} - - (** - * internal_buffers - * Don't touch, used by libavcodec default_get_buffer(). - * @deprecated this field was moved to an internal context - *) - internal_buffer: pointer; {deprecated} -{$IFEND} - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) -// realloc: function (s: PAVCodecContext; buf: Pbyte; buf_size: cint): Pbyte; cdecl; - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - -{$IF FF_API_PALETTE_CONTROL} - (** - * palette control structure - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by user. - *) - palctrl: PAVPaletteControl; -{$IFEND} - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - inter_threshold: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - -{$IF FF_API_ANTIALIAS_ALGO} - (** - * MP3 antialias algorithm, see FF_AA_* below. - * - encoding: unused - * - decoding: Set by user. - *) - antialias_algo: cint; {deprecated} -{$IFEND} - - (** - * quantizer noise shaping - * - encoding: Set by user. - * - decoding: unused - *) - quantizer_noise_shaping: cint; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; - - (** - * Bitstream width / height, may be different from width/height if lowres enabled. - * - encoding: unused - * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. - *) - coded_width, coded_height: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - -{$IF FF_API_X264_GLOBAL_OPTS} - (** - * constant rate factor - quality-based VBR - values ~correspond to qps - * - encoding: Set by user. - * - decoding: unused - * @deprecated use 'crf' libx264 private option - *) - crf: cfloat; {deprecated} - - (** - * constant quantization parameter rate control method - * - encoding: Set by user. - * - decoding: unused - * @deprecated use 'cqp' libx264 private option - *) - cqp: cint; {deprecated} -{$IFEND} - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - -{$IF FF_API_X264_GLOBAL_OPTS} - (** - * Influences how often B-frames are used. - * - encoding: Set by user. - * - decoding: unused - *) - bframebias: cint; {deprecated} -{$IFEND} - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - -{$IF FF_API_X264_GLOBAL_OPTS} - (** - * Reduce fluctuations in qp (before curve compression). - * - encoding: Set by user. - * - decoding: unused - *) - complexityblur: cfloat; {deprecated} - - (** - * in-loop deblocking filter alphac0 parameter - * alpha is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockalpha: cint; {deprecated} - - (** - * in-loop deblocking filter beta parameter - * beta is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockbeta: cint; {deprecated} - - (** - * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4 - * - encoding: Set by user. - * - decoding: unused - *) - partitions: cint; {deprecated} - - (** - * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto) - * - encoding: Set by user. - * - decoding: unused - *) - directpred: cint; {deprecated} -{$IFEND} - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - -{$IF FF_API_FLAC_GLOBAL_OPTS} - (** - * @name FLAC options - * @deprecated Use FLAC encoder private options instead. - * @{ - *) - - (** - * LPC coefficient precision - used by FLAC encoder - * - encoding: Set by user. - * - decoding: unused - *) - lpc_coeff_precision: cint; {deprecated} - - (** - * search method for selecting prediction order - * - encoding: Set by user. - * - decoding: unused - *) - prediction_order_method: cint; {deprecated} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_partition_order: cint; {deprecated} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_partition_order: cint; {deprecated} -{$IFEND} - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - -{$IF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - -{$IF FF_API_DRC_SCALE} - (** - * Percentage of dynamic range compression to be applied by the decoder. - * The default value is 1.0, corresponding to full compression. - * - encoding: unused - * - decoding: Set by user. - * @deprecated use AC3 decoder private option instead. - *) - drc_scale: cfloat; {deprecated} -{$IFEND} - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - -{$IF FF_API_X264_GLOBAL_OPTS} - (** - * explicit P-frame weighted prediction analysis method - * 0: off - * 1: fast blind weighting (one reference duplicate with -1 offset) - * 2: smart weighting (full fade detection analysis) - * - encoding: Set by user. - * - decoding: unused - *) - weighted_p_pred: cint; {deprecated} - - (** - * AQ mode - * 0: Disabled - * 1: Variance AQ (complexity mask) - * 2: Auto-variance AQ (experimental) - * - encoding: Set by user - * - decoding: unused - *) - aq_mode: cint; {deprecated} - - (** - * AQ strength - * Reduces blocking and blurring in flat and textured areas. - * - encoding: Set by user - * - decoding: unused - *) - aq_strength: cfloat; {deprecated} - - (** - * PSY RD - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_rd: cfloat; {deprecated} - - (** - * PSY trellis - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_trellis: cfloat; {deprecated} - - (** - * RC lookahead - * Number of frames for frametype and ratecontrol lookahead - * - encoding: Set by user - * - decoding: unused - *) - rc_lookahead: cint; {deprecated} - - (** - * Constant rate factor maximum - * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse - * than crf_max, even if doing so would violate VBV restrictions. - * - encoding: Set by user. - * - decoding: unused - *) - crf_max: cfloat; {deprecated} -{$IFEND} - - log_level_offset: cint; - -{$IF FF_API_FLAC_GLOBAL_OPTS} - (** - * Determine which LPC analysis algorithm to use. - * - encoding: Set by user - * - decoding: unused - *) - lpc_type: TAVLPCType; {deprecated} - - (** - * Number of passes to use for Cholesky factorization during LPC analysis - * - encoding: Set by user - * - decoding: unused - *) - lpc_passes: cint; {deprecated} -{$IFEND} - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - -{$IF FF_API_INTERNAL_CONTEXT} - (** - * Whether this is a copy of the context which had init() called on it. - * This is used by multithreading - shared tables and picture pointers - * should be freed from the original context only. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - * - * @deprecated this field has been moved to an internal context - *) - is_copy: cint; {deprecated} -{$IFEND} - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: pointer; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by libavcodec - *) - field_order: AVFieldOrder; - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - -(** - * AVCodec. - *) - TAVCodec = record - name: PAnsiChar; - type_: TAVMediaType; - id: TCodecID; - priv_data_size: cint; - init: function (avctx: PAVCodecContext): cint; cdecl; - encode: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; data: pointer): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - next: PAVCodec; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See CODEC_ID_xxx - *) - id: TCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The pressentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(* packet functions *) - -(** - * @deprecated use NULL instead - *) -procedure av_destruct_packet_nofree(pkt: PAVPacket); - cdecl; external av__codec; deprecated; - -(* - * Default packet destructor. - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(* resample.c *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields. - * The fields of the given AVPicture are filled in by using the 'ptr' address - * which points to the image data buffer. Depending on the specified picture - * format, one or multiple image data pointers and line sizes will be set. - * If a planar format is specified, several pointers will be set pointing to - * the different picture planes and the line sizes of the different planes - * will be stored in the lines_sizes array. - * Call with ptr == NULL to get the required size for the ptr buffer. - * - * @param picture AVPicture whose fields are to be filled in - * @param ptr Buffer which will contain or contains the actual image data - * @param pix_fmt The format in which the picture data is stored. - * @param width the width of the image in pixels - * @param height the height of the image in pixels - * @return size of the image data in bytes - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer. - * The data is stored compactly, without any gaps for alignment or padding - * which may be applied by avpicture_fill(). - * - * @see avpicture_get_size() - * - * @param[in] src AVPicture containing image data - * @param[in] pix_fmt The format in which the picture data is stored. - * @param[in] width the width of the image in pixels. - * @param[in] height the height of the image in pixels. - * @param[out] dest A buffer into which picture data will be copied. - * @param[in] dest_size The size of 'dest'. - * @return The number of bytes written to dest, or a negative value (error code) on error. - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Note that this returns the size of a compact representation as generated - * by avpicture_layout, which can be smaller than the size required for e.g. - * avpicture_fill. - * - * @param pix_fmt the given picture format - * @param width the width of the image - * @param height the height of the image - * @return Image data size in bytes or -1 on error (e.g. too large dimensions). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TCodecID): PAnsiChar; - cdecl; external av__codec; - -{$IF FF_API_GET_PIX_FMT_NAME} -(** - * Return the short name for a pixel format. - * - * \see av_get_pix_fmt(), av_get_pix_fmt_string(). - * @deprecated Deprecated in favor of av_get_pix_fmt_name(). - *) -function avcodec_get_pix_fmt_name(pix_fmt: TAVPixelFormat): PAnsiChar; - cdecl; external av__codec; deprecated; -{$IFEND} - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; {**< loss due to resolution change *} - FF_LOSS_DEPTH = $0002; {**< loss due to color depth change *} - FF_LOSS_COLORSPACE = $0004; {**< loss due to color space conversion *} - FF_LOSS_ALPHA = $0008; {**< loss of alpha bits *} - FF_LOSS_COLORQUANT = $0010; {**< loss due to color quantization *} - FF_LOSS_CHROMA = $0020; {**< loss of chroma (e.g. RGB to gray conversion) *} - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur - * (maximum loss for an invalid dst_pix_fmt). - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_mask parameter. - * - * Note, only the first 64 pixel formats will fit in pix_fmt_mask. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << PIX_FMT_YUV422P) | (1 << PIX_FMT_RGB24); - * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint64; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): TAVPixelFormat; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} -(** - * @deprecated Use av_get_pix_fmt_string() instead. - *) -procedure avcodec_pix_fmt_string (buf: PAnsiChar; buf_size: cint; pix_fmt: TAVPixelFormat); - cdecl; external av__codec; deprecated; -{$IFEND} - -{$IF FF_API_GET_ALPHA_INFO} -const - FF_ALPHA_TRANSP = $0001; {* image has some totally transparent pixels *} - FF_ALPHA_SEMI_TRANSP = $0002; {* image has some transparent pixels *} - -(** - * Tell if an image really has transparent alpha values. - * @return ored mask of FF_ALPHA_xxx constants - *) -function img_get_alpha_info (src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; {deprecated} - cdecl; external av__codec; -{$IFEND} - -(* deinterlace a picture *) -(* deinterlace - if not supported return -1 *) -function avpicture_deinterlace (dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; - cdecl; external av__codec; - -(* external high level API *) - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -{$IF FF_API_AVCODEC_INIT} -(** - * @deprecated this function is called automatically from avcodec_register() - * and avcodec_register_all(), there is no need to call it manually - *) -procedure avcodec_init(); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id CodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -{$IF FF_API_ALLOC_CONTEXT} -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - * @deprecated use avcodec_get_context_defaults3 - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: PAVCodec); - cdecl; external av__codec; - -{$IF FF_API_ALLOC_CONTEXT} -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - * - * @deprecated use avcodec_alloc_context3() - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param pic The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults (pic: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct can be deallocated by simply calling av_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -{$IF FF_API_THREAD_INIT} -(** - * @deprecated Set s->thread_count before calling avcodec_open2() instead of calling this. - *) -function avcodec_thread_init(s: PAVCodecContext; thread_count: cint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -{$IF FF_API_AVCODEC_OPEN} -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close - * - * @deprecated use avcodec_open2 - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -{$IF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The - * decoder may, however, only utilize part of the buffer by - * setting AVFrame.nb_samples to a smaller value in the - * output frame. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_SUBTITLE_OLD} -(* Decode a subtitle message. Return -1 if error, otherwise return the - * number of bytes used. If no subtitle could be decompressed, - * got_sub_ptr is zero. Otherwise, the subtitle is stored in*sub. - *) -function avcodec_decode_subtitle(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - buf: {const} PByteArray; buf_size: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -{$IF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * There are 2 codec capabilities that affect the allowed - * values of frame->nb_samples. - * If CODEC_CAP_SMALL_LAST_FRAME is set, then only the final - * frame may be smaller than avctx->frame_size, and all other - * frames must be equal to avctx->frame_size. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If neither is set, frame->nb_samples must be equal to - * avctx->frame_size for all frames. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -(** - * Fill audio frame data and linesize. - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return 0 on success, negative error code on failure - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -procedure avcodec_default_free_buffers(s: PAVCodecContext); - cdecl; external av__codec; - -(* misc useful functions *) - -{$IF FF_API_OLD_FF_PICT_TYPES} -(** - * Return a single letter to describe the given picture type pict_type. - * - * @param[in] pict_type the picture type - * @return A single character representing the picture type. - * @deprecated Use av_get_picture_type_char() instead. - *) -function av_get_pict_type_char(pict_type: cint): AnsiChar; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TCodecID): cint; - cdecl; external av__codec; - -{$IF FF_API_OLD_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_format(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Copy image src to dst. Wraps av_picture_data_copy() above. - *) -procedure av_picture_copy(dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - top_band: cint; - left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; - src: {const} PAVPicture; - height: cint; - width: cint; - pix_fmt: TAVPixelFormat; - padtop: cint; - padbottom: cint; - padleft: cint; - padright: - cint; - color: PCint): cint; - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.10/avformat.pas b/src/lib/ffmpeg-0.10/avformat.pas deleted file mode 100644 index e2b464d3..00000000 --- a/src/lib/ffmpeg-0.10/avformat.pas +++ /dev/null @@ -1,2382 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 0.10 libavformat/avformat.h - * Min. version: 53.31.100 - * Max. version: 53.32.100 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 0.10x - * This file has been created with the previous ffmpeg headers as a basis - * by removing all unneeded conditionals. - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 53; - LIBAVFORMAT_MAX_VERSION_MINOR = 32; - LIBAVFORMAT_MAX_VERSION_RELEASE = 100; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 53; - LIBAVFORMAT_MIN_VERSION_MINOR = 31; - LIBAVFORMAT_MIN_VERSION_RELEASE = 100; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const -{$ifndef FF_API_OLD_METADATA2} - FF_API_OLD_METADATA2 = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_AVIO} - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_DUMP_FORMAT} - FF_API_DUMP_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_PARSE_DATE} - FF_API_PARSE_DATE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FIND_INFO_TAG} - FF_API_FIND_INFO_TAG = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_PKT_DUMP} - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_GUESS_IMG2_CODEC} - FF_API_GUESS_IMG2_CODEC = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_SDP_CREATE} - FF_API_SDP_CREATE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FLAG_RTP_HINT} - FF_API_FLAG_RTP_HINT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_AVSTREAM_QUALITY} - FF_API_AVSTREAM_QUALITY = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_LOOP_INPUT} - FF_API_LOOP_INPUT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_LOOP_OUTPUT} - FF_API_LOOP_OUTPUT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_TIMESTAMP} - FF_API_TIMESTAMP = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FILESIZE} - FF_API_FILESIZE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_MUXRATE} - FF_API_MUXRATE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_RTSP_URL_OPTIONS} - FF_API_RTSP_URL_OPTIONS = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_NEW_STREAM} - FF_API_NEW_STREAM = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_PRELOAD} - FF_API_PRELOAD = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_STREAM_COPY} - FF_API_STREAM_COPY = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_SEEK_PUBLIC} - FF_API_SEEK_PUBLIC = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_REORDER_PRIVATE} - FF_API_REORDER_PRIVATE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_INTERRUPT_CB} - FF_API_OLD_INTERRUPT_CB = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_SET_PTS_INFO} - FF_API_SET_PTS_INFO = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} - FF_API_CLOSE_INPUT_FILE = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @{ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libav structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @defgroup lavf_decoding Demuxing - * @{ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more frames which belong a single - * elementary stream. In lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * - * @section lavf_decoding_seek Seeking - * @} - * - * @defgroup lavf_encoding Muxing - * @{ - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -type - PAVFile = Pointer; - -(* - * @defgroup metadata_api Public Metadata API - * @{ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @} - *) - -{$IF FF_API_OLD_METADATA2} -(** - * @defgroup old_metadata Old metadata API - * The following functions are deprecated, use - * their equivalents from libavutil/dict.h instead. - * @ - *) - -const -{ - AV_METADATA_MATCH_CASE = 1; - AV_METADATA_IGNORE_SUFFIX = 2; - AV_METADATA_DONT_STRDUP_KEY = 4; - AV_METADATA_DONT_STRDUP_VAL = 8; - AV_METADATA_DONT_OVERWRITE = 16; -} - AV_METADATA_MATCH_CASE = AV_DICT_MATCH_CASE; - AV_METADATA_IGNORE_SUFFIX = AV_DICT_IGNORE_SUFFIX; - AV_METADATA_DONT_STRDUP_KEY = AV_DICT_DONT_STRDUP_KEY; - AV_METADATA_DONT_STRDUP_VAL = AV_DICT_DONT_STRDUP_VAL; - AV_METADATA_DONT_OVERWRITE = AV_DICT_DONT_OVERWRITE; - -type - PAVMetadataTag = ^TAVMetadataTag; - TAVMetadataTag = record - key: PAnsiChar; - value: PAnsiChar; - end; - - PAVMetadata = Pointer; - PAVDictionary = PAVMetadata; - PAVDictionaryEntry = PAVMetadata; - -(** - * Get a metadata element with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found tag or NULL, changing key or value leads to undefined behavior. - *) -function av_metadata_get(m: PAVDictionary; key: {const} PAnsiChar; - prev: {const} PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__format; - -(** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped depending on flags) - * @param value tag value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_metadata_set2(var pm: PAVDictionary; key: {const} PAnsiChar; value: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; - -(** - * Copy metadata from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting metadata in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_metadata_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__format; deprecated; - -(** - * Free all the memory allocated for an AVDictionary struct. - *) -procedure av_metadata_free(var m: PAVDictionary); - cdecl; external av__format; deprecated; -(** - * @} - *) -{$IFEND} - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fallback to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fallback to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_TS_NONSTRICT = $8000000; (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - - AVFMT_NOOUTPUTLOOP = -1; - AVFMT_INFINITEOUTPUTLOOP = 0; - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_RTP_HINT = $0040; ///< Add RTP hinting to the output file - - MAX_STD_TIMEBASES = (60*12+5); - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVFormatParameters = ^TAVFormatParameters; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - TAVFormatParameters = record - time_base: TAVRational; - sample_rate: cint; - channels: cint; - width: cint; - height: cint; - pix_fmt: TAVPixelFormat; - channel: cint; (**< Used to select DV channel. *) - standard: PAnsiChar; (**< TV standard, NTSC, PAL, SECAM *) - { Delphi does not support bit fields -> use bf_flags instead - unsigned int mpeg2ts_raw:1; (**< Force raw MPEG-2 transport stream output, if possible. *) - unsigned int mpeg2ts_compute_pcr:1; (**< Compute exact PCR for each transport - stream packet (only meaningful if - mpeg2ts_raw is TRUE). *) - unsigned int initial_pause:1; (**< Do not begin to play the stream - immediately (RTSP only). *) - unsigned int prealloced_context:1; - } - bf_flags: byte; // 0:mpeg2ts_raw/1:mpeg2ts_compute_pcr/2:initial_pause/3:prealloced_context - end; - -(** - * @addtogroup lavf_encoding - * @{ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - (* output support *) - audio_codec: TCodecID; (**< default audio codec *) - video_codec: TCodecID; (**< default video codec *) - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH - *) - flags: cint; - - dummy: pointer; - - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - subtitle_codec: TCodecID; (**< default subtitle codec *) - -{$IF FF_API_OLD_METADATA2} - {const} metadata_conv: PAVMetadataConv; -{$IFEND} - - {const} priv_class: PAVClass; ///< AVClass for the private context - - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - *) - query_codec: function (id: TCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (* private fields *) - next: PAVOutputFormat; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @{ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. 'ap' if non-NULL contains - * additional parameters. Only used in raw format right - * now. 'av_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'av_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - (** - * General purpose read-only value that the format can use. - *) - value: cint; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - codec_tag: {const} PPAVCodecTag; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - {const} metadata_conv: PAVMetadataConv; - - (* private fields *) - next: PAVInputFormat; - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - duration_error: array[0..1] of array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - codec_info_duration: cint64; - nb_decoded_frames: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - id: cint; (**< format-specific stream ID *) - codec: PAVCodecContext; (**< codec context *) - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - *) - r_frame_rate: TAVRational; - priv_data: pointer; - -{$IF FF_API_REORDER_PRIVATE} - (* internal data used in av_find_stream_info() *) - first_dts: cint64; -{$IFEND} - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * time base should be 1/framerate and timestamp increments should be 1. - * decoding: set by libavformat - * encoding: set by libavformat in av_write_header - *) - time_base: TAVRational; -{$IF FF_API_REORDER_PRIVATE} - pts_wrap_bits: cint; (* number of bits in pts (used for wrapping control) *) -{$IFEND} -{$IF FF_API_STREAM_COPY} - (* ffmpeg.c private use *) - stream_copy: cint; (**< If set, just copy stream. *) {deprecated} -{$IFEND} - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. -{$IF FF_API_AVSTREAM_QUALITY} - //FIXME move stuff to a flags field? - (** - * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. - * MN:dunno if thats the right place, for it - *) - quality: cfloat; {deprecated} -{$IFEND} - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - -{$IF FF_API_REORDER_PRIVATE} - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - cur_dts: cint64; - last_IP_duration: cint; - last_IP_pts: cint64; - (* av_seek_frame() support *) - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; -{$IFEND} - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - -{$IF FF_API_REORDER_PRIVATE} - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; -{$IFEND} - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - -{$IF FF_API_REORDER_PRIVATE} - {* Intended mostly for av_read_frame() support. Not supposed to be used by *} - {* external applications; try to use something else if at all possible. *} - cur_ptr: {const} PCuint8; - cur_len: cint; - cur_pkt: TAVPacket; - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - - (** - * Number of packets to buffer for codec probing - * NOT PART OF PUBLIC API - *) - probe_packets: cint; - - (** - * last packet in packet_buffer for this stream when muxing. - * Used internally, NOT PART OF PUBLIC API, do not read or - * write from outside of libav* - *) - last_in_packet_buffer: PAVPacketList; -{$IFEND} - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - (** - * flag to indicate that probing is requested - * NOT PART OF PUBLIC API - *) - request_probe: cint; -{$IF NOT FF_API_REORDER_PRIVATE} - {const} cur_ptr: PByte; - cur_len: cint; - cur_pkt: TAVPacket; - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - first_dts: cint64; - cur_dts: cint64; - last_IP_duration: cint; - last_IP_pts: cint64; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) -{$IFEND} - end; - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and AVOptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * Can only be iformat or oformat, not both at the same time. - * - * decoding: set by avformat_open_input(). - * encoding: set by the user. - *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - *) - priv_data: pointer; - - (* - * I/O context. - * - * decoding: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * encoding: set by the user. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PByteIOContext; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * decoding: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * encoding: streams are created by the user before avformat_write_header(). - *) - nb_streams: cuint; - streams: PPAVStream; - - filename: array [0..1023] of AnsiChar; (* input or output filename *) - (* stream info *) -{$IF FF_API_TIMESTAMP} - (** - * @deprecated use 'creation_time' metadata tag instead - *) - timestamp: cint64; {deprecated} -{$IFEND} - - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) -{$IF FF_API_REORDER_PRIVATE} - (* private data for pts handling (do not modify directly). *) - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; -{$IFEND} - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - -{$IF FF_API_FILESIZE} - (** - * decoding: total file size, 0 if unknown - *) - file_size: cint64; -{$IFEND} - - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - -{$IF FF_API_REORDER_PRIVATE} - (* av_read_frame() support *) - cur_st: PAVStream; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) -{$IFEND} - -{$IF FF_API_MUXRATE} - (** - * use mpeg muxer private options instead - *) - mux_rate: cint; {deprecated} -{$IFEND} - packet_size: cuint; -{$IF FF_API_PRELOAD} - preload: cint; {deprecated} -{$IFEND} - max_delay: cint; - -{$IF FF_API_LOOP_OUTPUT} - (** - * number of times to loop output in formats that support it - * - * @deprecated use the 'loop' private option in the gif muxer. - *) - loop_output: cint; -{$IFEND} - - flags: cint; -{$IF FF_API_LOOP_INPUT} - (** - * @deprecated, use the 'loop' img2 demuxer private option. - *) - loop_input: cint; {deprecated} -{$IFEND} - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * decoding: maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in avformat_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen : cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Flags to enable debugging. - *) - debug: cint; - -{$IF FF_API_REORDER_PRIVATE} - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer: PAVPacketList; - raw_packet_buffer_end: PAVPacketList; - - packet_buffer_end: PAVPacketList; -{$IFEND} - - metadata: PAVDictionary; - -{$IF FF_API_REORDER_PRIVATE} - (** - * Remaining size available for raw_packet_buffer, in bytes. - * NOT PART OF PUBLIC API - *) - raw_packet_buffer_remaining_size: cint; -{$IFEND} - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - (** - * decoding: number of frames used to probe fps - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * decoding: set by the user before avformat_open_input(). - * encoding: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) -{$IF NOT FF_API_REORDER_PRIVATE} - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_read_frame() support *) - cur_st: PAVStream; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) -{$IFEND} - end; - - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - -(** - * This function is provided for compatibility reason and currently does nothing. - *) -procedure av_metadata_conv(ctx: PAVFormatContext; {const} d_conv: PAVMetadataConv; {const} s_conv: PAVMetadataConv); - cdecl; external av__format; deprecated; - - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @{ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: PAVCodec): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IF FF_API_GUESS_IMG2_CODEC} -function av_guess_image2_codec(filename: {const} PAnsiChar): TCodecID; - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @{ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -{$IF FF_API_FORMAT_PARAMETERS} -(** - * Allocate all the structures needed to read an input stream. - * This does not open the needed codecs for decoding the stream[s]. - *) -function av_open_input_stream(var ic_ptr: PAVFormatContext; - pb: PByteIOContext; filename: PAnsiChar; - fmt: PAVInputFormat; ap: PAVFormatParameters): cint; - cdecl; external av__format; deprecated; - -(** - * Open a media file as input. The codecs are not opened. Only the file - * header (if present) is read. - * - * @param ic_ptr The opened media file handle is put here. - * @param filename filename to open - * @param fmt If non-NULL, force the file format to use. - * @param buf_size optional buffer size (zero if default is OK) - * @param ap Additional parameters needed when opening the file - * (NULL if default). - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_open_input_file(var ic_ptr: PAVFormatContext; filename: PAnsiChar; - fmt: PAVInputFormat; buf_size: cint; - ap: PAVFormatParameters): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; {const} filename: PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext; ap: TAVFormatParameters): cint; - cdecl; external av__format; - -{$IF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * The returned packet is valid - * until the next av_read_frame() or until av_close_input_file() and - * must be freed with av_free_packet. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of - * frames if each frame has a known fixed size (e.g. PCM or ADPCM - * data). If the audio frames have a variable size (e.g. MPEG audio), - * then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IF FF_API_FORMAT_PARAMETERS} -(** - * Free a AVFormatContext allocated by av_open_input_stream. - * @param s context to free - * @deprecated use av_close_input_file() - *) -procedure av_close_input_stream(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -{$IF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; -{$IFEND} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -{$IF FF_API_SEEK_PUBLIC} -function av_seek_frame_binary(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; flags: cint): cint; - cdecl; external av__format; deprecated; -procedure av_update_cur_dts(s: PAVFormatContext; ref_st: PAVStream; - timestamp: cint64); - cdecl; external av__format; deprecated; - -type - TReadTimestampFunc = function (pavfc: PAVFormatContext; - arg2: cint; arg3: Pint64; arg4: cint64): cint64; cdecl; {deprecated} - -function av_gen_search(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; pos_min: cint64; - pos_max: cint64; pos_limit: cint64; - ts_min: cint64; ts_max: cint64; - flags: cint; ts_ret: Pint64; - read_timestamp: TReadTimestampFunc): cint64; - cdecl; external av__format; deprecated; -{$IFEND} - -{$IF FF_API_FORMAT_PARAMETERS} -(** - * media file output - *) -function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; - cdecl; external av__format; -{$IFEND} - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already openened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Allocate the stream private data and write the stream header to an - * output media file. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -{$IF FF_API_FORMAT_PARAMETERS} -(** - * Allocate the stream private data and write the stream header to an - * output media file. - * @note: this sets stream time-bases, if possible to stream->codec->time_base - * but for some formats it might also be some other time base - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - * - * @deprecated use avformat_write_header. - *) -function av_write_header(s: PAVFormatContext): cint; {deprecated} - cdecl; external av__format; -{$IFEND} - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Libavformat takes - * ownership of the data and will free it when it sees fit using the packet's - * @ref AVPacket.destruct "destruct" field. The caller must not access the data - * after this function returns, as it may already be freed. - * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the - * index of the corresponding stream in @ref AVFormatContext.streams - * "s.streams". - * It is very strongly recommended that timing information (@ref AVPacket.pts - * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Interleave a packet per dts in an output media file. - * - * Packets with pkt->destruct == av_destruct_packet will be freed inside this - * function, so they cannot be used after it. Note that calling av_free_packet() - * on them is still safe. - * - * @param s media file handle - * @param out the interleaved packet will be output here - * @param pkt the input packet - * @param flush 1 if no further packets are available as input and all - * remaining packets should be output - * @return 1 if a packet was output, 0 if no packet could be output, - * < 0 if an error occurred - *) -function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; - pkt: PAVPacket; flush: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to av_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param dts[out] DTS of the last packet output for the stream, in stream - * time_base units - * @param wall[out] absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @{ - * - * Miscelaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: PAVPacket; dump_payload: cint; st: PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: PAVPacket; dump_payload: cint; - st: PAVStream); - cdecl; external av__format; - -(** - * Get the CodecID for the given codec tag tag. - * If no codec id is found returns CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -{$IF FF_API_DUMP_FORMAT} -(** - * @deprecated Deprecated in favor of av_dump_format(). - *) -procedure dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar; - is_output: cint); - cdecl; external av__format; deprecated; -{$IFEND} - -procedure av_dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -{$IF FF_API_PARSE_DATE} -(** - * Parse datestr and return a corresponding number of microseconds. - * - * @param datestr String representing a date or a duration. - * See av_parse_time() for the syntax of the provided string. - * @deprecated in favor of av_parse_time() - *) -function parse_date(datestr: PAnsiChar; duration: cint): cint64; {deprecated} - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Get the current time in microseconds. - *) -function av_gettime(): cint64; - cdecl; external av__format; - -{$IF FF_API_FIND_INFO_TAG} -(** - * @deprecated use av_find_info_tag in libavutil instead. - *) -function find_info_tag(arg: PAnsiChar; arg_size: cint; tag1: PAnsiChar; info: PAnsiChar): cint; - cdecl; external av__format; -{$IFEND} - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -{$IF FF_API_SDP_CREATE} -function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PByteArray; size: cint): cint; - cdecl; external av__format; -{$IFEND} - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: PAVOutputFormat; codec_id: TCodecID; std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @{ - * Get the tables mapping RIFF FourCCs to libavcodec CodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum CodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec CodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to CodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @} - *) - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-0.10/avio.pas b/src/lib/ffmpeg-0.10/avio.pas deleted file mode 100644 index 616e723a..00000000 --- a/src/lib/ffmpeg-0.10/avio.pas +++ /dev/null @@ -1,928 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 52.110.0 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_MAX_STREAMS = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA2 = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - FF_API_URL_RESETBUF = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_REGISTER_PROTOCOL = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_GUESS_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_UDP_GET_FILE = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_URL_SPLIT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_ALLOC_FORMAT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARSE_FRAME_PARAM = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_READ_SEEK = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_LAVF_UNUSED = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARAMETERS_CODEC_ID = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_FIRST_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_SYMVER = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_INDEX_BUILT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_DUMP_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PARSE_DATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FIND_INFO_TAG = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_GUESS_IMG2_CODEC = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_SDP_CREATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FLAG_RTP_HINT = (LIBAVFORMAT_VERSION_MAJOR < 54); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - URL_PROTOCOL_FLAG_NESTED_SCHEME = 1; (*< The protocol name can be the first part of a nested protocol scheme *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PAVIOContext = ^TAVIOContext; - TAVIOContext = record -{$IFNDEF FF_API_OLD_AVIO} - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: PAVClass; -{$ENDIF} - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) -{$IF FF_API_OLD_AVIO} - is_streamed: cint; { deprecated } -{$IFEND} - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - end; - -(* unbuffered I/O *) - -{$IF FF_API_OLD_AVIO} - PURLProtocol = ^TURLProtocol; - -(** - * URL Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(URLContext) must not be used outside libav*. - * @deprecated This struct will be made private - *) - PPURLContext = ^PURLContext; - PURLContext = ^TURLContext; - TURLContext = record - av_class: {const} PAVClass; ///< information for av_log(). Set by url_open(). - prot: PURLProtocol; - flags: cint; - is_streamed: cint; (**< true if streamed (no seek possible), default = false *) - max_packet_size: cint; (**< if non zero, the stream is packetized with this max packet size *) - priv_data: pointer; - filename: PAnsiChar; (**< specified URL *) - is_connected: cint; - interrupt_callback: TAVIOInterruptCB; - end; - -(** - * @deprecated This struct is to be made private. Use the higher-level - * AVIOContext-based API instead. - *) - TURLProtocol = record - name: PAnsiChar; - url_open: function (h: PURLContext; url: {const} PAnsiChar; flags: cint): cint; cdecl; - url_read: function (h: PURLContext; buf: PByteArray; size: cint): cint; cdecl; - url_write: function (h: PURLContext; {const} buf: PByteArray; size: cint): cint; cdecl; - url_seek: function (h: PURLContext; pos: cint64; whence: cint): cint64; cdecl; - url_close: function (h: PURLContext): cint; cdecl; - next: PURLProtocol; - url_read_pause: function (h: PURLContext; pause: cint): cint; cdecl; - url_read_seek: function (h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - url_get_file_handle: function (h: PURLContext): cint; cdecl; - priv_data_size: cint; - {const} priv_data_class: PAVClass; - flags: cint; - url_check: function (h: PURLContext; mask: cint): cint; - end; - - PURLPollEntry = ^TURLPollEntry; - TURLPollEntry = record - handle: PURLContext; - events: cint; - revents: cint; - end; - -(* not implemented *) -function url_poll(poll_table: PURLPollEntry; n: cint; timeout: cint): cint; - cdecl; external av__format; deprecated; - -const -(** - * @name URL open modes - * The flags argument to url_open and cosins must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) - URL_RDONLY = 1; (**< read-only *) - URL_WRONLY = 2; (**< write-only *) - URL_RDWR = {(URL_RDONLY|URL_WRONLY)} 3; (**< read-write *) -(** - * @ - *) - -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - URL_FLAG_NONBLOCK = 8; - -type - PURLInterruptCB = ^TURLInterruptCB; - TURLInterruptCB = function (): cint; cdecl; - -{ -var - url_interrupt_cb: PURLInterruptCB; cvar; external: av__format; -} - -(** - * @defgroup old_url_funcs Old url_* functions - * @eprecated. Use the buffered API based on AVIOContext instead. - * @ - * @ingroup lavf_io - *) -function url_open_protocol(puc: PPURLContext; up: PURLProtocol; - url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_alloc(h: PPURLContext; {const} url: PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_connect(h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_open(h: PPointer; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_read (h: PURLContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_read_complete (h: PURLContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_write (h: PURLContext; {const} buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_seek (h: PURLContext; pos: cint64; whence: cint): cint64; - cdecl; external av__format; deprecated; -function url_close (h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_filesize (h: PURLContext): cint64; - cdecl; external av__format; deprecated; -function url_get_file_handle(h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_get_max_packet_size(h: PURLContext): cint; - cdecl; external av__format; deprecated; -procedure url_get_filename(h: PURLContext; buf: PAnsiChar; buf_size: cint); - cdecl; external av__format; deprecated; -function av_url_read_pause(h: PURLContext; pause: cint): cint; - cdecl; external av__format; deprecated; -function av_url_read_seek(h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; deprecated; -procedure url_set_interrupt_cb (interrupt_cb: TURLInterruptCB); - cdecl; external av__format; deprecated; - -(** - * returns the next registered protocol after the given protocol (the first if - * NULL is given), or NULL if protocol is the last one. - *) -function av_protocol_next(p: PURLProtocol): PURLProtocol; - cdecl; external av__format; - -(** - * Register the URLProtocol protocol. - * - * @param size the size of the URLProtocol struct referenced - *) -function av_register_protocol2(protocol: PURLProtocol; size: cint): cint; - cdecl; external av__format; deprecated; -(** - * @ - *) - -type - PByteIOContext = PAVIOContext; { deprecated } - TByteIOContext = TAVIOContext; { deprecated } - -function init_put_byte(s: PAVIOContext; - buffer: PByteArray; - buffer_size: cint; - write_flag: cint; - opaque: pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): cint; - cdecl; external av__format; deprecated; -function av_alloc_put_byte( - buffer: PByteArray; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; deprecated; - -(** - * @defgroup old_avio_funcs Old put_/get_*() functions - * The following functions are deprecated. Use the "avio_"-prefixed functions instead. - * @ - *) -function get_buffer(s: PAVIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function get_partial_buffer(s: PAVIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function get_byte(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function get_le16(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le24(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le32(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le64(s: PAVIOContext): cuint64; - cdecl; external av__format; deprecated; -function get_be16(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be24(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be32(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be64(s: PAVIOContext): cuint64; - cdecl; external av__format; deprecated; - -procedure put_byte(s: PAVIOContext; b: cint); - cdecl; external av__format; deprecated; -procedure put_nbyte(s: PAVIOContext; b: cint; count: cint); - cdecl; external av__format; deprecated; -procedure put_buffer (s: PAVIOContext; buf: {const} PByteArray; size: cint); - cdecl; external av__format; deprecated; -procedure put_le64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; deprecated; -procedure put_be64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; deprecated; -procedure put_le32(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be32(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_le24(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be24(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_le16(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be16(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_tag(s: PAVIOContext; tag: {const} PAnsiChar); - cdecl; external av__format; deprecated; -(** - * @ - *) - -function av_url_read_fpause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; deprecated; -function av_url_read_fseek(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; deprecated; - -(** - * @defgroup old_url_f_funcs Old url_f* functions - * @deprecated, use the "avio_"-prefixed functions instead. - * @ - *) -function url_fopen(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_fclose(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_fseek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; deprecated; -function url_fskip(s: PAVIOContext; offset: cint64): cint; - cdecl; external av__format; deprecated; -function url_ftell(s: PAVIOContext): cint64; - cdecl; external av__format; deprecated; -function url_fsize(s: PAVIOContext): cint64; - cdecl; external av__format; deprecated; -const - URL_EOF = -1; -(** @note return URL_EOF (-1) if EOF *) -function url_fgetc(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_setbufsize (s: PAVIOContext; buf_size: cint): cint; - cdecl; external av__format; deprecated; -function url_fprintf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; deprecated; -procedure put_flush_packet (s: PAVIOContext); - cdecl; external av__format; deprecated; -function url_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_open_dyn_packet_buf(var s: PAVIOContext; max_packet_size: cint): cint; - cdecl; external av__format; deprecated; -function url_close_dyn_buf(s: PAVIOContext; pbuffer:PPointer): cint; - cdecl; external av__format; deprecated; -function url_fdopen (var s: PAVIOContext; h: PURLContext): cint; - cdecl; external av__format; deprecated; -(** - * @ - *) - -function url_ferror(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -function udp_set_remote_url(h: PURLContext; uri: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; -function udp_get_local_port(h: PURLContext): cint; - cdecl; external av__format; deprecated; - -type - Tupdate_checksum = function (c: culong; p: Pcuint8; len: cuint): culong; cdecl; -procedure init_checksum(s: PAVIOContext; - update_checksum: Tupdate_checksum; - checksum: culong); - cdecl; external av__format; deprecated; -function get_checksum(s: PAVIOContext): culong; - cdecl; external av__format; deprecated; -procedure put_strz(s: PAVIOContext; buf: {const} PAnsiChar); - cdecl; external av__format; deprecated; -(** @note unlike fgets, the EOL character is not returned and a whole - line is parsed. return NULL if first char read was EOF *) -function url_fgets(s: PAVIOContext; buf: PAnsiChar; buf_size: cint): PAnsiChar; - cdecl; external av__format; deprecated; -(** - * @deprecated use avio_get_str instead - *) -function get_strz(s: PAVIOContext; buf: PAnsiChar; maxlen: cint): PAnsiChar; - cdecl; external av__format; deprecated; -(** - * @deprecated Use AVIOContext.seekable field directly. - *) -function url_is_streamed(s: PAVIOContext): cint; {$IFDEF HasInline}inline;{$ENDIF} deprecated; - -function url_fileno(s: PAVIOContext): PURLContext; - cdecl; external av__format; deprecated; - -(** - * @deprecated use AVIOContext.max_packet_size directly. - *) -function url_fget_max_packet_size (s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -function url_open_buf(var s: PAVIOContext; buf: PAnsiChar; buf_size: cint; flags: cint): cint; - cdecl; external av__format; deprecated; - -(** return the written or read size *) -function url_close_buf(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -(** - * Return a non-zero value if the resource indicated by url - * exists, 0 otherwise. - * @deprecated Use avio_check instead. - *) -function url_exist(url: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; -{$IFEND} // FF_API_OLD_AVIO - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_OLD_INTERRUPT_CB} -(** - * The callback is called in blocking functions to test regulary if - * asynchronous interruption is needed. AVERROR_EXIT is returned - * in this case by the interrupted function. 'NULL' means no interrupt - * callback is given. - * @deprecated Use interrupt_callback in AVFormatContext/avio_open2 - * instead. - *) -procedure avio_set_interrupt_cb(interrupt_cb: Pointer); - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const - (** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - - (** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonble - * means that can be extreemly slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) -const - AVIO_FLAG_NONBLOCK = 8; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: {PPAVIOContext} pointer; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * @return 0 on success, an AVERROR < 0 on error. - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * @note it is recommanded to use av_protocol_next() instead of this - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -{$IF (LIBAVFORMAT_VERSION_MAJOR < 54)} -function url_is_streamed(s: PAVIOContext): cint; -begin - Result := s^.is_streamed; -end; -{$IFEND} - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-0.10/avutil.pas b/src/lib/ffmpeg-0.10/avutil.pas deleted file mode 100644 index 23899794..00000000 --- a/src/lib/ffmpeg-0.10/avutil.pas +++ /dev/null @@ -1,261 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 51.34.101 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 51; - LIBAVUTIL_MAX_VERSION_MINOR = 35; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 51; - LIBAVUTIL_MIN_VERSION_MINOR = 34; - LIBAVUTIL_MIN_VERSION_RELEASE = 101; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @{ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -end. diff --git a/src/lib/ffmpeg-0.10/libavcodec/audioconvert.pas b/src/lib/ffmpeg-0.10/libavcodec/audioconvert.pas deleted file mode 100644 index 9b2877d1..00000000 --- a/src/lib/ffmpeg-0.10/libavcodec/audioconvert.pas +++ /dev/null @@ -1,140 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/audioconvert.h - * avutil version 50.43.0 - * - *) - -(** - * @file - * audio conversion routines - *) - -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT: cuint64 = $0000000080000000; - AV_CH_WIDE_RIGHT: cuint64 = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT: cuint64 = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT: cuint64 = $0000000400000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -(** - * Return a channel layout id that matches name, 0 if no match. - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionnally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - + Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-0.10/libavutil/cpu.pas b/src/lib/ffmpeg-0.10/libavutil/cpu.pas deleted file mode 100644 index c28441bf..00000000 --- a/src/lib/ffmpeg-0.10/libavutil/cpu.pas +++ /dev/null @@ -1,73 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 51.34.101 - * - *) - -(** - * @file - * CPU specific - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - AV_CPU_FLAG_IWMMXT = $0100; ///< XScale IWMMXT - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - -(** - * Return the flags which specify extensions supported by the CPU. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(* The following CPU-specific functions shall not be called directly. *) -function ff_get_cpu_flags_arm(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_ppc(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_x86(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.10/libavutil/dict.pas b/src/lib/ffmpeg-0.10/libavutil/dict.pas deleted file mode 100644 index aa52861e..00000000 --- a/src/lib/ffmpeg-0.10/libavutil/dict.pas +++ /dev/null @@ -1,93 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 51.34.101 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() and children. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() and chilren. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.10/libavutil/error.pas b/src/lib/ffmpeg-0.10/libavutil/error.pas deleted file mode 100644 index d7a7354c..00000000 --- a/src/lib/ffmpeg-0.10/libavutil/error.pas +++ /dev/null @@ -1,133 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 51.34.101 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @{ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) - -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * @} - *) diff --git a/src/lib/ffmpeg-0.10/libavutil/log.pas b/src/lib/ffmpeg-0.10/libavutil/log.pas deleted file mode 100644 index ecde0b87..00000000 --- a/src/lib/ffmpeg-0.10/libavutil/log.pas +++ /dev/null @@ -1,203 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 51.34.101 - * - *) - -(** - * @file - * log - *) - -type -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for loging is stored. - * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such - * parent context. And a av_log() implementation could then display the parent context - * can be NULL of course - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - -end; - -const - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; dummy: va_list); - cdecl; external av__util; -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -function av_default_item_name (ctx: pointer): PAnsiChar; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.10/libavutil/mathematics.pas b/src/lib/ffmpeg-0.10/libavutil/mathematics.pas deleted file mode 100644 index 3859311b..00000000 --- a/src/lib/ffmpeg-0.10/libavutil/mathematics.pas +++ /dev/null @@ -1,103 +0,0 @@ -(* - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 51.34.101 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = 0.0/0.0; - INFINITY = 1.0/0.0; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5 ///< Round to nearest and halfway cases away from zero. - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.10/libavutil/mem.pas b/src/lib/ffmpeg-0.10/libavutil/mem.pas deleted file mode 100644 index 90355f0b..00000000 --- a/src/lib/ffmpeg-0.10/libavutil/mem.pas +++ /dev/null @@ -1,154 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 51.34.101 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * @param tab_ptr Pointer to the array. - * @param nb_ptr Pointer to the number of elements in the array. - * @param elem Element to be added. - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: PCint; elem: pointer); - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-0.10/libavutil/opt.pas b/src/lib/ffmpeg-0.10/libavutil/opt.pas deleted file mode 100644 index f2c258de..00000000 --- a/src/lib/ffmpeg-0.10/libavutil/opt.pas +++ /dev/null @@ -1,271 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 51.34.101 - * - *) - -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128 -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (dbl: cdouble); - 1: (str: PAnsiChar); - (* TODO those are unused now *) - 2: (i64: cint64); - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR(ENOENT) if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; -function av_set_q(obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; -function av_set_int(obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; -function av_get_double(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.10/libavutil/pixfmt.pas b/src/lib/ffmpeg-0.10/libavutil/pixfmt.pas deleted file mode 100644 index 5e8a547d..00000000 --- a/src/lib/ffmpeg-0.10/libavutil/pixfmt.pas +++ /dev/null @@ -1,258 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 51.34.101 - * - *) - -(** - * @file - * Pixel format - *) - -type -(** - * Pixel format. Notes: - * - * @note - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - PIX_FMT_NONE= -1, - PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - PIX_FMT_GRAY8, ///< Y , 8bpp - PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - PIX_FMT_XVMC_MPEG2_IDCT, - PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus - //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored seperately - //is better - PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian - PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian - PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian - PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian - PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian - PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - - PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - PIX_FMT_Y400A = PIX_FMT_GRAY8A; - PIX_FMT_GBR24P = PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - PIX_FMT_RGB32 = PIX_FMT_ARGB; - PIX_FMT_RGB32_1 = PIX_FMT_RGBA; - PIX_FMT_BGR32 = PIX_FMT_ABGR; - PIX_FMT_BGR32_1 = PIX_FMT_BGRA; - PIX_FMT_0RGB32 = PIX_FMT_0RGB; - PIX_FMT_0BGR32 = PIX_FMT_0BGR; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16BE; - PIX_FMT_RGB48 = PIX_FMT_RGB48BE; - PIX_FMT_RGB565 = PIX_FMT_RGB565BE; - PIX_FMT_RGB555 = PIX_FMT_RGB555BE; - PIX_FMT_RGB444 = PIX_FMT_RGB444BE; - PIX_FMT_BGR48 = PIX_FMT_BGR48BE; - PIX_FMT_BGR565 = PIX_FMT_BGR565BE; - PIX_FMT_BGR555 = PIX_FMT_BGR555BE; - PIX_FMT_BGR444 = PIX_FMT_BGR444BE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9BE; - PIX_FMT_YUV422P9 = PIX_FMT_YUV422P9BE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9BE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10BE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10BE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10BE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16BE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16BE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16BE; - - PIX_FMT_RGBA64 = PIX_FMT_RGBA64BE; - PIX_FMT_BGRA64 = PIX_FMT_BGRA64BE; - PIX_FMT_GBRP9 = PIX_FMT_GBRP9BE; - PIX_FMT_GBRP10 = PIX_FMT_GBRP10BE; - PIX_FMT_GBRP16 = PIX_FMT_GBRP16BE; -{$ELSE} - PIX_FMT_RGB32 = PIX_FMT_BGRA; - PIX_FMT_RGB32_1 = PIX_FMT_ABGR; - PIX_FMT_BGR32 = PIX_FMT_RGBA; - PIX_FMT_BGR32_1 = PIX_FMT_ARGB; - PIX_FMT_0RGB32 = PIX_FMT_BGR0; - PIX_FMT_0BGR32 = PIX_FMT_RGB0; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16LE; - PIX_FMT_RGB48 = PIX_FMT_RGB48LE; - PIX_FMT_RGB565 = PIX_FMT_RGB565LE; - PIX_FMT_RGB555 = PIX_FMT_RGB555LE; - PIX_FMT_RGB444 = PIX_FMT_RGB444LE; - PIX_FMT_BGR48 = PIX_FMT_BGR48LE; - PIX_FMT_BGR565 = PIX_FMT_BGR565LE; - PIX_FMT_BGR555 = PIX_FMT_BGR555LE; - PIX_FMT_BGR444 = PIX_FMT_BGR444LE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9LE; - PIX_FMT_YUV422P9 = PIX_FMT_YUV422P9LE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9LE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10LE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10LE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10LE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16LE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16LE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16LE; - - PIX_FMT_RGBA64 = PIX_FMT_RGBA64LE; - PIX_FMT_BGRA64 = PIX_FMT_BGRA64LE; - PIX_FMT_GBRP9 = PIX_FMT_GBRP9LE; - PIX_FMT_GBRP10 = PIX_FMT_GBRP10LE; - PIX_FMT_GBRP16 = PIX_FMT_GBRP16LE; -{$ENDIF} diff --git a/src/lib/ffmpeg-0.10/libavutil/samplefmt.pas b/src/lib/ffmpeg-0.10/libavutil/samplefmt.pas deleted file mode 100644 index 80cdd71b..00000000 --- a/src/lib/ffmpeg-0.10/libavutil/samplefmt.pas +++ /dev/null @@ -1,173 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 51.34.101 - * - *) - -type -(** - * all in native-endian format - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; deprecated; - cdecl; external av__util; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Fill channel data pointers and linesizes for samples with sample - * format sample_fmt. - * - * The pointers array is filled with the pointers to the samples data: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The linesize array is filled with the aligned size of each channel's data - * buffer for planar layout, or the aligned size of the buffer for all channels - * for packed layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (1 = no alignment required) - * @return 0 on success or a negative error code on failure - *) -function av_samples_fill_arrays(audio_data: pointer; linesize: Pcint; - buf: Pcuint8; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s) - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (1 = no alignment required) - * @return 0 on success or a negative error code on failure - * @see av_samples_fill_arrays() - *) -function av_samples_alloc(audio_data: pointer; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.10/rational.pas b/src/lib/ffmpeg-0.10/rational.pas deleted file mode 100644 index 63c47c9d..00000000 --- a/src/lib/ffmpeg-0.10/rational.pas +++ /dev/null @@ -1,193 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 51.34.101 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - (* - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b and -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -end. diff --git a/src/lib/ffmpeg-0.10/swresample.pas b/src/lib/ffmpeg-0.10/swresample.pas deleted file mode 100644 index 10b510a0..00000000 --- a/src/lib/ffmpeg-0.10/swresample.pas +++ /dev/null @@ -1,183 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libswresample/swresample.h: - * version: 0.6.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - SWR_CH_MAX = 16; (* < Maximum number of channels *) - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s Swr context, can be NULL - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - {const} var in_: PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Activate resampling compensation. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param s allocated Swr context, not yet initialized - * @param channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Return the LIBSWRESAMPLE_VERSION_INT constant. - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - *) -function swresample_configuration(): cuchar; - cdecl; external sw__resample; - -(** - * Return the swr license. - *) -function swresample_license(): cuchar; - cdecl; external sw__resample; - -(** - * @ - *) - -implementation - -end. - diff --git a/src/lib/ffmpeg-0.10/swscale.pas b/src/lib/ffmpeg-0.10/swscale.pas deleted file mode 100644 index a918aa09..00000000 --- a/src/lib/ffmpeg-0.10/swscale.pas +++ /dev/null @@ -1,465 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.1.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 100; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -const -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IF FF_API_SWS_GETCONTEXT} -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - * @deprecated Use sws_getCachedContext() instead. - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.11/How to update the ffmpeg files.txt b/src/lib/ffmpeg-0.11/How to update the ffmpeg files.txt deleted file mode 100644 index 976d0eff..00000000 --- a/src/lib/ffmpeg-0.11/How to update the ffmpeg files.txt +++ /dev/null @@ -1,12 +0,0 @@ -how to update the ffmpeg files: - -1) rational.pas - error.pas -2) mathematics.pas - dict.pas - opt.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-0.11/ToDo.txt b/src/lib/ffmpeg-0.11/ToDo.txt deleted file mode 100644 index de773c78..00000000 --- a/src/lib/ffmpeg-0.11/ToDo.txt +++ /dev/null @@ -1,6 +0,0 @@ -1) opt.pas -PAVClass - -2) avutil.pas -inline function av_x_if_null -inline function av_size_mult diff --git a/src/lib/ffmpeg-0.11/avcodec.pas b/src/lib/ffmpeg-0.11/avcodec.pas deleted file mode 100644 index 7c6d1a19..00000000 --- a/src/lib/ffmpeg-0.11/avcodec.pas +++ /dev/null @@ -1,5053 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 54.23.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 54; - LIBAVCODEC_MAX_VERSION_MINOR = 23; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 54; - LIBAVCODEC_MIN_VERSION_MINOR = 23; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const -{$ifndef FF_API_PALETTE_CONTROL} - FF_API_PALETTE_CONTROL = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_SAMPLE_FMT} - FF_API_OLD_SAMPLE_FMT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_AUDIOCONVERT} - FF_API_OLD_AUDIOCONVERT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ANTIALIAS_ALGO} - FF_API_ANTIALIAS_ALGO = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_REQUEST_CHANNELS} - FF_API_REQUEST_CHANNELS = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OPT_H} - FF_API_OPT_H = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_THREAD_INIT} - FF_API_THREAD_INIT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_FF_PICT_TYPES} - FF_API_OLD_FF_PICT_TYPES = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FLAC_GLOBAL_OPTS} - FF_API_FLAC_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_GET_PIX_FMT_NAME} - FF_API_GET_PIX_FMT_NAME = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ALLOC_CONTEXT} - FF_API_ALLOC_CONTEXT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_AVCODEC_OPEN} - FF_API_AVCODEC_OPEN = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_DRC_SCALE} - FF_API_DRC_SCALE = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ER} - FF_API_ER = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_AVCODEC_INIT} - FF_API_AVCODEC_INIT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_X264_GLOBAL_OPTS} - FF_API_X264_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_MPEGVIDEO_GLOBAL_OPTS} -// FF_API_MPEGVIDEO_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_LAME_GLOBAL_OPTS} -// FF_API_LAME_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_SNOW_GLOBAL_OPTS} -// FF_API_SNOW_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_MJPEG_GLOBAL_OPTS} -// FF_API_MJPEG_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_GET_ALPHA_INFO} - FF_API_GET_ALPHA_INFO = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_PARSE_FRAME} - FF_API_PARSE_FRAME = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_INTERNAL_CONTEXT} - FF_API_INTERNAL_CONTEXT = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_TIFFENC_COMPLEVEL} - FF_API_TIFFENC_COMPLEVEL = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_DATA_POINTERS} - FF_API_DATA_POINTERS = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} - FF_API_OLD_DECODE_AUDIO = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OLD_TIMECODE} - FF_API_OLD_TIMECODE = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} - -{$ifndef FF_API_AVFRAME_AGE} - FF_API_AVFRAME_AGE = (LIBAVCODEC_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_ENCODE_AUDIO} - FF_API_OLD_ENCODE_AUDIO = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @{ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add CodecIDs without producing conflicts. - *) -type - TCodecID = ( - CODEC_ID_NONE, - - //* video codecs */ - CODEC_ID_MPEG1VIDEO, - CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - CODEC_ID_MPEG2VIDEO_XVMC, - CODEC_ID_H261, - CODEC_ID_H263, - CODEC_ID_RV10, - CODEC_ID_RV20, - CODEC_ID_MJPEG, - CODEC_ID_MJPEGB, - CODEC_ID_LJPEG, - CODEC_ID_SP5X, - CODEC_ID_JPEGLS, - CODEC_ID_MPEG4, - CODEC_ID_RAWVIDEO, - CODEC_ID_MSMPEG4V1, - CODEC_ID_MSMPEG4V2, - CODEC_ID_MSMPEG4V3, - CODEC_ID_WMV1, - CODEC_ID_WMV2, - CODEC_ID_H263P, - CODEC_ID_H263I, - CODEC_ID_FLV1, - CODEC_ID_SVQ1, - CODEC_ID_SVQ3, - CODEC_ID_DVVIDEO, - CODEC_ID_HUFFYUV, - CODEC_ID_CYUV, - CODEC_ID_H264, - CODEC_ID_INDEO3, - CODEC_ID_VP3, - CODEC_ID_THEORA, - CODEC_ID_ASV1, - CODEC_ID_ASV2, - CODEC_ID_FFV1, - CODEC_ID_4XM, - CODEC_ID_VCR1, - CODEC_ID_CLJR, - CODEC_ID_MDEC, - CODEC_ID_ROQ, - CODEC_ID_INTERPLAY_VIDEO, - CODEC_ID_XAN_WC3, - CODEC_ID_XAN_WC4, - CODEC_ID_RPZA, - CODEC_ID_CINEPAK, - CODEC_ID_WS_VQA, - CODEC_ID_MSRLE, - CODEC_ID_MSVIDEO1, - CODEC_ID_IDCIN, - CODEC_ID_8BPS, - CODEC_ID_SMC, - CODEC_ID_FLIC, - CODEC_ID_TRUEMOTION1, - CODEC_ID_VMDVIDEO, - CODEC_ID_MSZH, - CODEC_ID_ZLIB, - CODEC_ID_QTRLE, - CODEC_ID_SNOW, - CODEC_ID_TSCC, - CODEC_ID_ULTI, - CODEC_ID_QDRAW, - CODEC_ID_VIXL, - CODEC_ID_QPEG, - CODEC_ID_PNG, - CODEC_ID_PPM, - CODEC_ID_PBM, - CODEC_ID_PGM, - CODEC_ID_PGMYUV, - CODEC_ID_PAM, - CODEC_ID_FFVHUFF, - CODEC_ID_RV30, - CODEC_ID_RV40, - CODEC_ID_VC1, - CODEC_ID_WMV3, - CODEC_ID_LOCO, - CODEC_ID_WNV1, - CODEC_ID_AASC, - CODEC_ID_INDEO2, - CODEC_ID_FRAPS, - CODEC_ID_TRUEMOTION2, - CODEC_ID_BMP, - CODEC_ID_CSCD, - CODEC_ID_MMVIDEO, - CODEC_ID_ZMBV, - CODEC_ID_AVS, - CODEC_ID_SMACKVIDEO, - CODEC_ID_NUV, - CODEC_ID_KMVC, - CODEC_ID_FLASHSV, - CODEC_ID_CAVS, - CODEC_ID_JPEG2000, - CODEC_ID_VMNC, - CODEC_ID_VP5, - CODEC_ID_VP6, - CODEC_ID_VP6F, - CODEC_ID_TARGA, - CODEC_ID_DSICINVIDEO, - CODEC_ID_TIERTEXSEQVIDEO, - CODEC_ID_TIFF, - CODEC_ID_GIF, - CODEC_ID_DXA, - CODEC_ID_DNXHD, - CODEC_ID_THP, - CODEC_ID_SGI, - CODEC_ID_C93, - CODEC_ID_BETHSOFTVID, - CODEC_ID_PTX, - CODEC_ID_TXD, - CODEC_ID_VP6A, - CODEC_ID_AMV, - CODEC_ID_VB, - CODEC_ID_PCX, - CODEC_ID_SUNRAST, - CODEC_ID_INDEO4, - CODEC_ID_INDEO5, - CODEC_ID_MIMIC, - CODEC_ID_RL2, - CODEC_ID_ESCAPE124, - CODEC_ID_DIRAC, - CODEC_ID_BFI, - CODEC_ID_CMV, - CODEC_ID_MOTIONPIXELS, - CODEC_ID_TGV, - CODEC_ID_TGQ, - CODEC_ID_TQI, - CODEC_ID_AURA, - CODEC_ID_AURA2, - CODEC_ID_V210X, - CODEC_ID_TMV, - CODEC_ID_V210, - CODEC_ID_DPX, - CODEC_ID_MAD, - CODEC_ID_FRWU, - CODEC_ID_FLASHSV2, - CODEC_ID_CDGRAPHICS, - CODEC_ID_R210, - CODEC_ID_ANM, - CODEC_ID_BINKVIDEO, - CODEC_ID_IFF_ILBM, - CODEC_ID_IFF_BYTERUN1, - CODEC_ID_KGV1, - CODEC_ID_YOP, - CODEC_ID_VP8, - CODEC_ID_PICTOR, - CODEC_ID_ANSI, - CODEC_ID_A64_MULTI, - CODEC_ID_A64_MULTI5, - CODEC_ID_R10K, - CODEC_ID_MXPEG, - CODEC_ID_LAGARITH, - CODEC_ID_PRORES, - CODEC_ID_JV, - CODEC_ID_DFA, - CODEC_ID_WMV3IMAGE, - CODEC_ID_VC1IMAGE, - CODEC_ID_UTVIDEO, - CODEC_ID_BMV_VIDEO, - CODEC_ID_VBLE, - CODEC_ID_DXTORY, - CODEC_ID_V410, - CODEC_ID_XWD, - CODEC_ID_CDXL, - CODEC_ID_XBM, - CODEC_ID_ZEROCODEC, -(** see below. they need to be hard coded. - CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - CODEC_ID_EXR = MKBETAG('0','E','X','R'), - CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - CODEC_ID_V308 = MKBETAG('V','3','0','8'), - CODEC_ID_V408 = MKBETAG('V','4','0','8'), - CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - *) - //* various PCM "codecs" */ - CODEC_ID_PCM_S16LE = $10000, - CODEC_ID_PCM_S16BE, - CODEC_ID_PCM_U16LE, - CODEC_ID_PCM_U16BE, - CODEC_ID_PCM_S8, - CODEC_ID_PCM_U8, - CODEC_ID_PCM_MULAW, - CODEC_ID_PCM_ALAW, - CODEC_ID_PCM_S32LE, - CODEC_ID_PCM_S32BE, - CODEC_ID_PCM_U32LE, - CODEC_ID_PCM_U32BE, - CODEC_ID_PCM_S24LE, - CODEC_ID_PCM_S24BE, - CODEC_ID_PCM_U24LE, - CODEC_ID_PCM_U24BE, - CODEC_ID_PCM_S24DAUD, - CODEC_ID_PCM_ZORK, - CODEC_ID_PCM_S16LE_PLANAR, - CODEC_ID_PCM_DVD, - CODEC_ID_PCM_F32BE, - CODEC_ID_PCM_F32LE, - CODEC_ID_PCM_F64BE, - CODEC_ID_PCM_F64LE, - CODEC_ID_PCM_BLURAY, - CODEC_ID_PCM_LXF, - CODEC_ID_S302M, - CODEC_ID_PCM_S8_PLANAR, - - //* various ADPCM codecs */ - CODEC_ID_ADPCM_IMA_QT = $11000, - CODEC_ID_ADPCM_IMA_WAV, - CODEC_ID_ADPCM_IMA_DK3, - CODEC_ID_ADPCM_IMA_DK4, - CODEC_ID_ADPCM_IMA_WS, - CODEC_ID_ADPCM_IMA_SMJPEG, - CODEC_ID_ADPCM_MS, - CODEC_ID_ADPCM_4XM, - CODEC_ID_ADPCM_XA, - CODEC_ID_ADPCM_ADX, - CODEC_ID_ADPCM_EA, - CODEC_ID_ADPCM_G726, - CODEC_ID_ADPCM_CT, - CODEC_ID_ADPCM_SWF, - CODEC_ID_ADPCM_YAMAHA, - CODEC_ID_ADPCM_SBPRO_4, - CODEC_ID_ADPCM_SBPRO_3, - CODEC_ID_ADPCM_SBPRO_2, - CODEC_ID_ADPCM_THP, - CODEC_ID_ADPCM_IMA_AMV, - CODEC_ID_ADPCM_EA_R1, - CODEC_ID_ADPCM_EA_R3, - CODEC_ID_ADPCM_EA_R2, - CODEC_ID_ADPCM_IMA_EA_SEAD, - CODEC_ID_ADPCM_IMA_EA_EACS, - CODEC_ID_ADPCM_EA_XAS, - CODEC_ID_ADPCM_EA_MAXIS_XA, - CODEC_ID_ADPCM_IMA_ISS, - CODEC_ID_ADPCM_G722, - CODEC_ID_ADPCM_IMA_APC, - - //* AMR */ - CODEC_ID_AMR_NB = $12000, - CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - CODEC_ID_RA_144 = $13000, - CODEC_ID_RA_288, - - //* various DPCM codecs */ - CODEC_ID_ROQ_DPCM = $14000, - CODEC_ID_INTERPLAY_DPCM, - CODEC_ID_XAN_DPCM, - CODEC_ID_SOL_DPCM, - - //* audio codecs */ - CODEC_ID_MP2 = $15000, - CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - CODEC_ID_AAC, - CODEC_ID_AC3, - CODEC_ID_DTS, - CODEC_ID_VORBIS, - CODEC_ID_DVAUDIO, - CODEC_ID_WMAV1, - CODEC_ID_WMAV2, - CODEC_ID_MACE3, - CODEC_ID_MACE6, - CODEC_ID_VMDAUDIO, - CODEC_ID_FLAC, - CODEC_ID_MP3ADU, - CODEC_ID_MP3ON4, - CODEC_ID_SHORTEN, - CODEC_ID_ALAC, - CODEC_ID_WESTWOOD_SND1, - CODEC_ID_GSM, ///< as in Berlin toast format - CODEC_ID_QDM2, - CODEC_ID_COOK, - CODEC_ID_TRUESPEECH, - CODEC_ID_TTA, - CODEC_ID_SMACKAUDIO, - CODEC_ID_QCELP, - CODEC_ID_WAVPACK, - CODEC_ID_DSICINAUDIO, - CODEC_ID_IMC, - CODEC_ID_MUSEPACK7, - CODEC_ID_MLP, - CODEC_ID_GSM_MS, { as found in WAV } - CODEC_ID_ATRAC3, - CODEC_ID_VOXWARE, - CODEC_ID_APE, - CODEC_ID_NELLYMOSER, - CODEC_ID_MUSEPACK8, - CODEC_ID_SPEEX, - CODEC_ID_WMAVOICE, - CODEC_ID_WMAPRO, - CODEC_ID_WMALOSSLESS, - CODEC_ID_ATRAC3P, - CODEC_ID_EAC3, - CODEC_ID_SIPR, - CODEC_ID_MP1, - CODEC_ID_TWINVQ, - CODEC_ID_TRUEHD, - CODEC_ID_MP4ALS, - CODEC_ID_ATRAC1, - CODEC_ID_BINKAUDIO_RDFT, - CODEC_ID_BINKAUDIO_DCT, - CODEC_ID_AAC_LATM, - CODEC_ID_QDMC, - CODEC_ID_CELT, - CODEC_ID_G723_1, - CODEC_ID_G729, - CODEC_ID_8SVX_EXP, - CODEC_ID_8SVX_FIB, - CODEC_ID_BMV_AUDIO, - CODEC_ID_RALF, -(** see below. they need to be hard coded. - CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), - CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - *) - - //* subtitle codecs */ - CODEC_ID_DVD_SUBTITLE = $17000, - CODEC_ID_DVB_SUBTITLE, - CODEC_ID_TEXT, ///< raw UTF-8 text - CODEC_ID_XSUB, - CODEC_ID_SSA, - CODEC_ID_MOV_TEXT, - CODEC_ID_HDMV_PGS_SUBTITLE, - CODEC_ID_DVB_TELETEXT, - CODEC_ID_SRT, -(** see below. they need to be hard coded. - CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - *) - - //* other specific kind of codecs (generally used for attachments) */ - CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - *) - - CODEC_ID_PROBE = $19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it - - CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M') - CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F') - CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R') - CODEC_ID_8SVX_RAW = $38535658, // MKBETAG('8','S','V','X') - CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P') - CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I') - CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T') - CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0') - CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S') - CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8') - CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N') - CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P') - CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4') - CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - CODEC_ID_MICRODVD = $6D445644 // MKBETAG('m','D','V','D') - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -{$IF FF_API_OLD_DECODE_AUDIO} -(* in bytes *) - AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio -{$IFEND} - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 16; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_SPC_SMPTE240M = 7, - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - (** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - CODEC_FLAG_CBP_RD = $04000000; ///< use rate distortion optimization for cbp - CODEC_FLAG_QP_RD = $08000000; ///< use rate distortion optimization for qp selectioon - CODEC_FLAG2_STRICT_GOP = $00000002; ///< strictly enforce GOP size - CODEC_FLAG2_SKIP_RD = $00004000; ///< RD optimal MB level residual skipping -{$ENDIF} - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; - -(* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -(** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) - - FF_COMPRESSION_DEFAULT = -1; - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; - AV_EF_BUFFER = 4; - AV_EF_EXPLODE = 8; - - AV_EF_CAREFUL = 65536; - AV_EF_COMPLIANT = 131072; - AV_EF_AGGRESSIVE = 262144; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_LIBMPEG2MMX = 4; - FF_IDCT_PS2 = 5; - FF_IDCT_MLIB = 6; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_H264 = 11; - FF_IDCT_VP3 = 12; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_CAVS = 15; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_WMV2 = 19; - FF_IDCT_FAAN = 20; - FF_IDCT_EA = 21; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - FF_IDCT_BINK = 24; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_LEVEL_UNKNOWN = -99; - -type - AVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO - ); - - TAVPacketSideDataType = record - data: PByte; - size: cint; - type_: AVPacketSideDataType; - end; - PAVPacketSideDataType = ^TAVPacketSideDataType; - - PAVPacket = ^TAVPacket; - TAVPacket = record - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideDataType; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -type - PAVCodecContext = ^TAVCodecContext; - -(** - * Audio Video Frame. - * New fields can be added to the end of AVFRAME with minor version - * bumps. Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - * Removal, reordering and changes in the remaining cases require - * a major version bump. - * sizeof(AVFrame) must not be used outside libavcodec. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: unused - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum PixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * reordered pts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -procedure av_frame_set_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -procedure av_frame_set_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; - -type - TAVCodecInternal = record - end; - PAVCodecInternal = ^TAVCodecInternal; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - AVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; - codec_name: array [0..31] of AnsiChar; - codec_id: TCodecID; (* see CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - -{$IF FF_API_SUB_ID} - (** - * @deprecated this field is unused - *) - sub_id: cint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid prolems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * Number of "priming" samples added to the beginning of the stream - * during encoding. The decoded output will be delayed by this many - * samples relative to the input to the encoder. Note that this field is - * purely informational and does not directly affect the pts output by - * the encoder, which should always be based on the actual presentation - * time, including any delay. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - * Note: For compatibility it is possible to set this instead of - * coded_width/height before decoding. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height if lowres enabled. - * - encoding: unused - * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overriden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - (** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - luma_elim_threshold: cint; {deprecated} - - (** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - chroma_elim_threshold: cint; {deprecated} -{$ENDIF} - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - -{$IFDEF FF_API_COLOR_TABLE_ID} - (** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - *) - color_table_id: cint; {deprecated} -{$ENDIF} - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - -{$IFDEF FF_API_INTER_THRESHOLD} - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - inter_threshold: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - (** - * quantizer noise shaping - * - encoding: Set by user. - * - decoding: unused - *) - quantizer_noise_shaping: cint; {deprecated} -{$ENDIF} - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by libavcodec - *) - field_order: AVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Samples per packet, initialized when calling 'init'. - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - rc_buffer_aggressivity: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - -{$IF FF_API_DSP_MASK} - (** - * Unused. - * @deprecated use av_set_cpu_flags_mask() instead. - *) - dsp_mask: cuint; {deprecated} -{$IFEND} - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; data: pointer): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See CODEC_ID_xxx - *) - id: TCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -(** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - -/** - * @} - */ - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The pressentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - (** - * 1 indicates this subtitle is a forced subtitle. - * A forced subtitle should be displayed even when subtitles are hidden. - *( - iforced: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -{$IF FF_API_ALLOC_CONTEXT} -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - * - * @deprecated use avcodec_alloc_context3() - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - * @deprecated use avcodec_get_context_defaults3 - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct can be deallocated by simply calling av_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param pic The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults (pic: PAVFrame); - cdecl; external av__codec; - -{$IF FF_API_AVCODEC_OPEN} -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close - * - * @deprecated use avcodec_open2 - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -(** - * @deprecated use NULL instead - *) -procedure av_destruct_packet_nofree(pkt: PAVPacket); - cdecl; external av__codec; deprecated; - -(* - * Default packet destructor. - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -/** - * @} - */ - -/** - * @addtogroup lavc_decoding - * @{ - */ - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The - * decoder may, however, only utilize part of the buffer by - * setting AVFrame.nb_samples to a smaller value in the - * output frame. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -/** - * @defgroup lavc_parsing Frame parsing - * @{ - */ - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id CodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * There are 2 codec capabilities that affect the allowed - * values of frame->nb_samples. - * If CODEC_CAP_SMALL_LAST_FRAME is set, then only the final - * frame may be smaller than avctx->frame_size, and all other - * frames must be equal to avctx->frame_size. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If neither is set, frame->nb_samples must be equal to - * avctx->frame_size for all frames. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields. - * The fields of the given AVPicture are filled in by using the 'ptr' address - * which points to the image data buffer. Depending on the specified picture - * format, one or multiple image data pointers and line sizes will be set. - * If a planar format is specified, several pointers will be set pointing to - * the different picture planes and the line sizes of the different planes - * will be stored in the lines_sizes array. - * Call with ptr == NULL to get the required size for the ptr buffer. - * - * @param picture AVPicture whose fields are to be filled in - * @param ptr Buffer which will contain or contains the actual image data - * @param pix_fmt The format in which the picture data is stored. - * @param width the width of the image in pixels - * @param height the height of the image in pixels - * @return size of the image data in bytes - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer. - * The data is stored compactly, without any gaps for alignment or padding - * which may be applied by avpicture_fill(). - * - * @see avpicture_get_size() - * - * @param[in] src AVPicture containing image data - * @param[in] pix_fmt The format in which the picture data is stored. - * @param[in] width the width of the image in pixels. - * @param[in] height the height of the image in pixels. - * @param[out] dest A buffer into which picture data will be copied. - * @param[in] dest_size The size of 'dest'. - * @return The number of bytes written to dest, or a negative value (error code) on error. - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Note that this returns the size of a compact representation as generated - * by avpicture_layout, which can be smaller than the size required for e.g. - * avpicture_fill. - * - * @param pix_fmt the given picture format - * @param width the width of the image - * @param height the height of the image - * @return Image data size in bytes or -1 on error (e.g. too large dimensions). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * deinterlace - if not supported return -1 *) - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy image src to dst. Wraps av_picture_data_copy() above. - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @{ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @{ - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; (**< loss due to resolution change *) - FF_LOSS_DEPTH = $0002; (**< loss due to color depth change *) - FF_LOSS_COLORSPACE = $0004; (**< loss due to color space conversion *) - FF_LOSS_ALPHA = $0008; (**< loss of alpha bits *) - FF_LOSS_COLORQUANT = $0010; (**< loss due to color quantization *) - FF_LOSS_CHROMA = $0020; (**< loss of chroma (e.g. RGB to gray conversion) *) - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur - * (maximum loss for an invalid dst_pix_fmt). - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_mask parameter. - * - * Note, only the first 64 pixel formats will fit in pix_fmt_mask. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << PIX_FMT_YUV422P) | (1 << PIX_FMT_RGB24); - * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint64; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format and a selection of two destination pixel formats. When converting from - * one pixel format to another, information loss may occur. For example, when converting - * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when - * converting from some formats to other formats. avcodec_find_best_pix_fmt2() selects which of - * the given pixel formats should be used to suffer the least amount of loss. - * - * If one of the destination formats is PIX_FMT_NONE the other pixel format (if valid) will be - * returned. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * dst_pix_fmt1= PIX_FMT_RGB24; - * dst_pix_fmt2= PIX_FMT_GRAY8; - * dst_pix_fmt3= PIX_FMT_RGB8; - * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. - * dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); - * dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from - * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from - * @param[in] src_pix_fmt Source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. - * NULL or value of zero means we care about all losses. Out: the loss - * that occurs when converting from src to selected dst pixel format. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: Pcint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill audio frame data and linesize. - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return 0 on success, negative error code on failure - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -procedure avcodec_default_free_buffers(s: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return CODEC_ID_PCM_* or CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext, frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: PAVCodec): cint; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-0.11/avformat.pas b/src/lib/ffmpeg-0.11/avformat.pas deleted file mode 100644 index 19459646..00000000 --- a/src/lib/ffmpeg-0.11/avformat.pas +++ /dev/null @@ -1,2161 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 0.11 libavformat/avformat.h - * Min. version: 54.6.1 - * Max. version: 54.6.100 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 0.11.x - * This file has been created with the 0.10.* ffmpeg headers as a basis - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 54; - LIBAVFORMAT_MAX_VERSION_MINOR = 6; - LIBAVFORMAT_MAX_VERSION_RELEASE = 100; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 54; - LIBAVFORMAT_MIN_VERSION_MINOR = 6; - LIBAVFORMAT_MIN_VERSION_RELEASE = 1; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const -{$ifndef FF_API_OLD_METADATA2} - FF_API_OLD_METADATA2 = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_AVIO} - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_DUMP_FORMAT} - FF_API_DUMP_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_PARSE_DATE} - FF_API_PARSE_DATE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FIND_INFO_TAG} - FF_API_FIND_INFO_TAG = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_PKT_DUMP} - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_GUESS_IMG2_CODEC} - FF_API_GUESS_IMG2_CODEC = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_SDP_CREATE} - FF_API_SDP_CREATE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FLAG_RTP_HINT} - FF_API_FLAG_RTP_HINT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_AVSTREAM_QUALITY} - FF_API_AVSTREAM_QUALITY = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_LOOP_INPUT} - FF_API_LOOP_INPUT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_LOOP_OUTPUT} - FF_API_LOOP_OUTPUT = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_TIMESTAMP} - FF_API_TIMESTAMP = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_FILESIZE} - FF_API_FILESIZE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_MUXRATE} - FF_API_MUXRATE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_RTSP_URL_OPTIONS} - FF_API_RTSP_URL_OPTIONS = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_NEW_STREAM} - FF_API_NEW_STREAM = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_PRELOAD} - FF_API_PRELOAD = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_STREAM_COPY} - FF_API_STREAM_COPY = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_SEEK_PUBLIC} - FF_API_SEEK_PUBLIC = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_REORDER_PRIVATE} - FF_API_REORDER_PRIVATE = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_OLD_INTERRUPT_CB} - FF_API_OLD_INTERRUPT_CB = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_SET_PTS_INFO} - FF_API_SET_PTS_INFO = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} - FF_API_CLOSE_INPUT_FILE = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @{ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @{ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * The packet data belongs to the demuxer and is invalid after the next call to - * av_read_frame(). The user must free the packet with av_free_packet() before - * calling av_read_frame() again or closing the file. - * - * @section lavf_decoding_seek Seeking - * @} - * - * @defgroup lavf_encoding Muxing - * @{ - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -type - PAVFile = Pointer; - -(* - * @defgroup metadata_api Public Metadata API - * @{ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @} - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fallback to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fallback to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - - AVFMT_SEEK_TO_PTS = $4000000 (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - - AVFMT_NOOUTPUTLOOP = -1; - AVFMT_INFINITEOUTPUTLOOP = 0; - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Dont merge side data but keep it separate. - - MAX_STD_TIMEBASES = (60*12+5); - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; /**< stream for hearing impaired audiences */ - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; /**< stream for visual impaired audiences */ - AV_DISPOSITION_CLEAN_EFFECTS = $0200; /**< stream without voice */ -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - -(** - * @addtogroup lavf_encoding - * @{ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TCodecID; (**< default audio codec *) - video_codec: TCodecID; (**< default video codec *) - subtitle_codec: TCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - *) - query_codec: function (id: TCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @{ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230; // MKTAG(0,'R','A','W'), /**< full parsing and repack with timestamp generation for raw */ - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - duration_error: array[0..1] of array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - codec_info_duration: cint64; - nb_decoded_frames: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - *) - r_frame_rate: TAVRational; - priv_data: pointer; - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: set by libavformat in av_write_header. The muxer may use the - * user-provided value of @ref AVCodecContext.time_base "codec->time_base" - * as a hint. - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * flag to indicate that probing is requested - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - end; - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and AVOptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * Can only be iformat or oformat, not both at the same time. - * - * decoding: set by avformat_open_input(). - * encoding: set by the user. - *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - *) - priv_data: pointer; - - (* - * I/O context. - * - * decoding: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * encoding: set by the user. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PByteIOContext; - - (* stream info *) - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * decoding: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * encoding: streams are created by the user before avformat_write_header(). - *) - nb_streams: cuint; - streams: PPAVStream; - - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - flags: cint; - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * decoding: maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in avformat_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - (** - * decoding: number of frames used to probe fps - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * decoding: set by the user before avformat_open_input(). - * encoding: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Packets split by the parser get queued here. - *) - parse_queue: PAVPacketList; - parse_queue_end: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - avio_flags: cint; - end; - - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - -(** - * This function is provided for compatibility reason and currently does nothing. - *) -procedure av_metadata_conv(ctx: PAVFormatContext; {const} d_conv: PAVMetadataConv; {const} s_conv: PAVMetadataConv); - cdecl; external av__format; deprecated; - - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @{ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: PAVCodec): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @{ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint); - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -{$IF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - * - * @deprecated use avformat_find_stream_info. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * The returned packet is valid - * until the next av_read_frame() or until av_close_input_file() and - * must be freed with av_free_packet. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of - * frames if each frame has a known fixed size (e.g. PCM or ADPCM - * data). If the audio frames have a variable size (e.g. MPEG audio), - * then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -{$IF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; -{$IFEND} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already openened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Libavformat takes - * ownership of the data and will free it when it sees fit using the packet's - * This can be NULL (at any time, not just at the end), to flush the - * interleaving queues. - * @ref AVPacket.destruct "destruct" field. The caller must not access the data - * after this function returns, as it may already be freed. - * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the - * index of the corresponding stream in @ref AVFormatContext.streams - * "s.streams". - * It is very strongly recommended that timing information (@ref AVPacket.pts - * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -{$IF FF_API_INTERLEAVE_PACKET} -(** - * @deprecated this function was never meant to be called by the user - * programs. - *) -function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; - pkt: PAVPacket; flush: cint): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to av_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param dts[out] DTS of the last packet output for the stream, in stream - * time_base units - * @param wall[out] absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @{ - * - * Miscelaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: PAVPacket; dump_payload: cint; st: PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: PAVPacket; dump_payload: cint; - st: PAVStream); - cdecl; external av__format; - -(** - * Get the CodecID for the given codec tag tag. - * If no codec id is found returns CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Get the current time in microseconds. - *) -function av_gettime(): cint64; - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: PAVOutputFormat; codec_id: TCodecID; std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @{ - * Get the tables mapping RIFF FourCCs to libavcodec CodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum CodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec CodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to CodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guesses the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * @} - *) - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-0.11/avio.pas b/src/lib/ffmpeg-0.11/avio.pas deleted file mode 100644 index 72fa93a3..00000000 --- a/src/lib/ffmpeg-0.11/avio.pas +++ /dev/null @@ -1,588 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 54.6.100 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_MAX_STREAMS = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA2 = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - FF_API_URL_RESETBUF = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_REGISTER_PROTOCOL = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_GUESS_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_UDP_GET_FILE = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_URL_SPLIT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_ALLOC_FORMAT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARSE_FRAME_PARAM = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_READ_SEEK = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_LAVF_UNUSED = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARAMETERS_CODEC_ID = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_FIRST_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_SYMVER = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_INDEX_BUILT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_DUMP_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PARSE_DATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FIND_INFO_TAG = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_GUESS_IMG2_CODEC = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_SDP_CREATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FLAG_RTP_HINT = (LIBAVFORMAT_VERSION_MAJOR < 54); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const - (** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - - (** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonble - * means that can be extreemly slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: {PPAVIOContext} pointer; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * @return 0 on success, an AVERROR < 0 on error. - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * @note it is recommended to use av_protocol_next() instead of this - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -{$IF (LIBAVFORMAT_VERSION_MAJOR < 54)} -function url_is_streamed(s: PAVIOContext): cint; -begin - Result := s^.is_streamed; -end; -{$IFEND} - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-0.11/avutil.pas b/src/lib/ffmpeg-0.11/avutil.pas deleted file mode 100644 index 9643a591..00000000 --- a/src/lib/ffmpeg-0.11/avutil.pas +++ /dev/null @@ -1,261 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 51.54.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 51; - LIBAVUTIL_MAX_VERSION_MINOR = 54; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 51; - LIBAVUTIL_MIN_VERSION_MINOR = 54; - LIBAVUTIL_MIN_VERSION_RELEASE = 0; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @{ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -end. diff --git a/src/lib/ffmpeg-0.11/libavcodec/audioconvert.pas b/src/lib/ffmpeg-0.11/libavcodec/audioconvert.pas deleted file mode 100644 index 41c8ca29..00000000 --- a/src/lib/ffmpeg-0.11/libavcodec/audioconvert.pas +++ /dev/null @@ -1,142 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/audioconvert.h - * avutil version 51.54.100 - * - *) - -(** - * @file - * audio conversion routines - *) - -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT: cuint64 = $0000000080000000; - AV_CH_WIDE_RIGHT: cuint64 = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT: cuint64 = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT: cuint64 = $0000000400000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-0.11/libavutil/cpu.pas b/src/lib/ffmpeg-0.11/libavutil/cpu.pas deleted file mode 100644 index 5495e421..00000000 --- a/src/lib/ffmpeg-0.11/libavutil/cpu.pas +++ /dev/null @@ -1,111 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 51.54.100 - * - *) - -(** - * @file - * CPU specific - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_CMOV = $1000000; ///< supports cmov instruction - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - -(** - * Return the flags which specify extensions supported by the CPU. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(* The following CPU-specific functions shall not be called directly. *) -function ff_get_cpu_flags_arm(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_ppc(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_x86(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.11/libavutil/dict.pas b/src/lib/ffmpeg-0.11/libavutil/dict.pas deleted file mode 100644 index d141becb..00000000 --- a/src/lib/ffmpeg-0.11/libavutil/dict.pas +++ /dev/null @@ -1,93 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 51.54.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() and children. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() and chilren. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.11/libavutil/error.pas b/src/lib/ffmpeg-0.11/libavutil/error.pas deleted file mode 100644 index 44ade13c..00000000 --- a/src/lib/ffmpeg-0.11/libavutil/error.pas +++ /dev/null @@ -1,133 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 51.54.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @{ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) - -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * @} - *) diff --git a/src/lib/ffmpeg-0.11/libavutil/log.pas b/src/lib/ffmpeg-0.11/libavutil/log.pas deleted file mode 100644 index e61f8f03..00000000 --- a/src/lib/ffmpeg-0.11/libavutil/log.pas +++ /dev/null @@ -1,205 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 51.54.100 - * - *) - -(** - * @file - * log - *) - -type -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for loging is stored. - * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such - * parent context. And a av_log() implementation could then display the parent context - * can be NULL of course - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - -end; - -const - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; dummy: va_list); - cdecl; external av__util; -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -function av_default_item_name (ctx: pointer): PAnsiChar; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.11/libavutil/mathematics.pas b/src/lib/ffmpeg-0.11/libavutil/mathematics.pas deleted file mode 100644 index d4e3c01f..00000000 --- a/src/lib/ffmpeg-0.11/libavutil/mathematics.pas +++ /dev/null @@ -1,110 +0,0 @@ -(* - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 51.54.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = 0.0/0.0; - INFINITY = 1.0/0.0; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5 ///< Round to nearest and halfway cases away from zero. - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.11/libavutil/mem.pas b/src/lib/ffmpeg-0.11/libavutil/mem.pas deleted file mode 100644 index cc6843d5..00000000 --- a/src/lib/ffmpeg-0.11/libavutil/mem.pas +++ /dev/null @@ -1,154 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 51.54.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * @param tab_ptr Pointer to the array. - * @param nb_ptr Pointer to the number of elements in the array. - * @param elem Element to be added. - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: PCint; elem: pointer); - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-0.11/libavutil/opt.pas b/src/lib/ffmpeg-0.11/libavutil/opt.pas deleted file mode 100644 index 39497d87..00000000 --- a/src/lib/ffmpeg-0.11/libavutil/opt.pas +++ /dev/null @@ -1,443 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 51.54.100 - * - *) - -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_IMAGE_SIZE = $53495A45 ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (dbl: cdouble); - 1: (str: PAnsiChar); - (* TODO those are unused now *) - 2: (i64: cint64); - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR(ENOENT) if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @{ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; -(** - * @} - *) - - const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @{ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double(obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -(** - * @} - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @{ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return 0 on success, a negative error code otherwise - *) -(** - * @note the returned string will av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -(** - * @} - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; -(** - * @} - *) diff --git a/src/lib/ffmpeg-0.11/libavutil/pixfmt.pas b/src/lib/ffmpeg-0.11/libavutil/pixfmt.pas deleted file mode 100644 index f93e482b..00000000 --- a/src/lib/ffmpeg-0.11/libavutil/pixfmt.pas +++ /dev/null @@ -1,264 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 51.54.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - PIX_FMT_NONE= -1, - PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - PIX_FMT_GRAY8, ///< Y , 8bpp - PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - PIX_FMT_XVMC_MPEG2_IDCT, - PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus - //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored seperately - //is better - PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian - PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian - PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian - PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian - PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian - PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - PIX_FMT_Y400A = PIX_FMT_GRAY8A; - PIX_FMT_GBR24P = PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - PIX_FMT_RGB32 = PIX_FMT_ARGB; - PIX_FMT_RGB32_1 = PIX_FMT_RGBA; - PIX_FMT_BGR32 = PIX_FMT_ABGR; - PIX_FMT_BGR32_1 = PIX_FMT_BGRA; - PIX_FMT_0RGB32 = PIX_FMT_0RGB; - PIX_FMT_0BGR32 = PIX_FMT_0BGR; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16BE; - PIX_FMT_RGB48 = PIX_FMT_RGB48BE; - PIX_FMT_RGB565 = PIX_FMT_RGB565BE; - PIX_FMT_RGB555 = PIX_FMT_RGB555BE; - PIX_FMT_RGB444 = PIX_FMT_RGB444BE; - PIX_FMT_BGR48 = PIX_FMT_BGR48BE; - PIX_FMT_BGR565 = PIX_FMT_BGR565BE; - PIX_FMT_BGR555 = PIX_FMT_BGR555BE; - PIX_FMT_BGR444 = PIX_FMT_BGR444BE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9BE; - PIX_FMT_YUV422P9 = PIX_FMT_YUV422P9BE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9BE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10BE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10BE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10BE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16BE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16BE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16BE; - - PIX_FMT_RGBA64 = PIX_FMT_RGBA64BE; - PIX_FMT_BGRA64 = PIX_FMT_BGRA64BE; - PIX_FMT_GBRP9 = PIX_FMT_GBRP9BE; - PIX_FMT_GBRP10 = PIX_FMT_GBRP10BE; - PIX_FMT_GBRP16 = PIX_FMT_GBRP16BE; -{$ELSE} - PIX_FMT_RGB32 = PIX_FMT_BGRA; - PIX_FMT_RGB32_1 = PIX_FMT_ABGR; - PIX_FMT_BGR32 = PIX_FMT_RGBA; - PIX_FMT_BGR32_1 = PIX_FMT_ARGB; - PIX_FMT_0RGB32 = PIX_FMT_BGR0; - PIX_FMT_0BGR32 = PIX_FMT_RGB0; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16LE; - PIX_FMT_RGB48 = PIX_FMT_RGB48LE; - PIX_FMT_RGB565 = PIX_FMT_RGB565LE; - PIX_FMT_RGB555 = PIX_FMT_RGB555LE; - PIX_FMT_RGB444 = PIX_FMT_RGB444LE; - PIX_FMT_BGR48 = PIX_FMT_BGR48LE; - PIX_FMT_BGR565 = PIX_FMT_BGR565LE; - PIX_FMT_BGR555 = PIX_FMT_BGR555LE; - PIX_FMT_BGR444 = PIX_FMT_BGR444LE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9LE; - PIX_FMT_YUV422P9 = PIX_FMT_YUV422P9LE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9LE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10LE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10LE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10LE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16LE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16LE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16LE; - - PIX_FMT_RGBA64 = PIX_FMT_RGBA64LE; - PIX_FMT_BGRA64 = PIX_FMT_BGRA64LE; - PIX_FMT_GBRP9 = PIX_FMT_GBRP9LE; - PIX_FMT_GBRP10 = PIX_FMT_GBRP10LE; - PIX_FMT_GBRP16 = PIX_FMT_GBRP16LE; -{$ENDIF} diff --git a/src/lib/ffmpeg-0.11/libavutil/samplefmt.pas b/src/lib/ffmpeg-0.11/libavutil/samplefmt.pas deleted file mode 100644 index 62165737..00000000 --- a/src/lib/ffmpeg-0.11/libavutil/samplefmt.pas +++ /dev/null @@ -1,253 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 51.54.100 - * - *) - -type -(** - * Audio Sample Formats - * - * @par - * The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * @par - * The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * @par - * The data layout as used in av_samples_fill_arrays() and elsewhere in Libav - * (such as AVFrame in libavcodec) is as follows: - * - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; deprecated; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Fill channel data pointers and linesizes for samples with sample - * format sample_fmt. - * - * The pointers array is filled with the pointers to the samples data: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The linesize array is filled with the aligned size of each channel's data - * buffer for planar layout, or the aligned size of the buffer for all channels - * for packed layout. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return 0 on success or a negative error code on failure - *) -function av_samples_fill_arrays(audio_data: pointer; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return 0 on success or a negative error code on failure - * @see av_samples_fill_arrays() - *) -function av_samples_alloc(audio_data: pointer; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.11/rational.pas b/src/lib/ffmpeg-0.11/rational.pas deleted file mode 100644 index 63c47c9d..00000000 --- a/src/lib/ffmpeg-0.11/rational.pas +++ /dev/null @@ -1,193 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 51.34.101 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - (* - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b and -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -end. diff --git a/src/lib/ffmpeg-0.11/swresample.pas b/src/lib/ffmpeg-0.11/swresample.pas deleted file mode 100644 index d7b13428..00000000 --- a/src/lib/ffmpeg-0.11/swresample.pas +++ /dev/null @@ -1,265 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libswresample/swresample.h: - * version: 0.15.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - {$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) - {$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s Swr context, can be NULL - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - {const} var in_: PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param s allocated Swr context, not yet initialized - * @param channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be - * if its set to 1 the returned delay is in seconds - * if its set to 1000 the returned delay is in milli seconds - * if its set to the input sample rate then the returned delay is in input samples - * if its set to the output sample rate then the returned delay is in output samples - * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate) - * @returns the delay in 1/base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the LIBSWRESAMPLE_VERSION_INT constant. - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - *) -function swresample_configuration(): cuchar; - cdecl; external sw__resample; - -(** - * Return the swr license. - *) -function swresample_license(): cuchar; - cdecl; external sw__resample; - -(** - * @ - *) - -implementation - -end. - diff --git a/src/lib/ffmpeg-0.11/swscale.pas b/src/lib/ffmpeg-0.11/swscale.pas deleted file mode 100644 index a918aa09..00000000 --- a/src/lib/ffmpeg-0.11/swscale.pas +++ /dev/null @@ -1,465 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.1.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 100; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -const -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IF FF_API_SWS_GETCONTEXT} -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - * @deprecated Use sws_getCachedContext() instead. - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.7/How to obtain the version of ffmpeg.txt b/src/lib/ffmpeg-0.7/How to obtain the version of ffmpeg.txt deleted file mode 100644 index bc3faf33..00000000 --- a/src/lib/ffmpeg-0.7/How to obtain the version of ffmpeg.txt +++ /dev/null @@ -1 +0,0 @@ -ffmpeg -version | grep ffmpeg |cut -f2 -d\ \ No newline at end of file diff --git a/src/lib/ffmpeg-0.7/How to update the ffmpeg files.txt b/src/lib/ffmpeg-0.7/How to update the ffmpeg files.txt deleted file mode 100644 index 976d0eff..00000000 --- a/src/lib/ffmpeg-0.7/How to update the ffmpeg files.txt +++ /dev/null @@ -1,12 +0,0 @@ -how to update the ffmpeg files: - -1) rational.pas - error.pas -2) mathematics.pas - dict.pas - opt.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-0.7/ToDo.txt b/src/lib/ffmpeg-0.7/ToDo.txt deleted file mode 100644 index e471960b..00000000 --- a/src/lib/ffmpeg-0.7/ToDo.txt +++ /dev/null @@ -1,18 +0,0 @@ - cpu.pas - dict.pas - error.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas - avutil.pas - - audioconvert.pas - avcodec.pas - - avio.pas - avformat.pas - - swscale.pas diff --git a/src/lib/ffmpeg-0.7/avcodec.pas b/src/lib/ffmpeg-0.7/avcodec.pas deleted file mode 100644 index a402f0c3..00000000 --- a/src/lib/ffmpeg-0.7/avcodec.pas +++ /dev/null @@ -1,4811 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 52.122.0 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 52; - LIBAVCODEC_MAX_VERSION_MINOR = 123; - LIBAVCODEC_MAX_VERSION_RELEASE = 0; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 52; - LIBAVCODEC_MIN_VERSION_MINOR = 122; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const -{$ifndef FF_API_PALETTE_CONTROL} - FF_API_PALETTE_CONTROL = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_MM_FLAGS} - FF_API_MM_FLAGS = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_OPT_SHOW} - FF_API_OPT_SHOW = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_AUDIO_OLD} - FF_API_AUDIO_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_VIDEO_OLD} - FF_API_VIDEO_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_SUBTITLE_OLD} - FF_API_SUBTITLE_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_USE_LPC} - FF_API_USE_LPC = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_SET_STRING_OLD} - FF_API_SET_STRING_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_INOFFICIAL} - FF_API_INOFFICIAL = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_OLD_SAMPLE_FMT} - FF_API_OLD_SAMPLE_FMT = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_OLD_AUDIOCONVERT} - FF_API_OLD_AUDIOCONVERT = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_HURRY_UP} - FF_API_HURRY_UP = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_RATE_EMU} - FF_API_RATE_EMU = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_MB_Q} - FF_API_MB_Q = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_ANTIALIAS_ALGO} - FF_API_ANTIALIAS_ALGO = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_REQUEST_CHANNELS} - FF_API_REQUEST_CHANNELS = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_OPT_H} - FF_API_OPT_H = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_THREAD_INIT} - FF_API_THREAD_INIT = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_OLD_FF_PICT_TYPES} - FF_API_OLD_FF_PICT_TYPES = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_FLAC_GLOBAL_OPTS} - FF_API_FLAC_GLOBAL_OPTS = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_GET_PIX_FMT_NAME} - FF_API_GET_PIX_FMT_NAME = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -{$IF FF_API_OLD_AUDIOCONVERT} - {$I libavcodec/audioconvert.pas} -{$IFEND} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. it is as close as possible to similar codecs. - *) -type - TCodecID = ( - CODEC_ID_NONE, - - //* video codecs */ - CODEC_ID_MPEG1VIDEO, - CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - CODEC_ID_MPEG2VIDEO_XVMC, - CODEC_ID_H261, - CODEC_ID_H263, - CODEC_ID_RV10, - CODEC_ID_RV20, - CODEC_ID_MJPEG, - CODEC_ID_MJPEGB, - CODEC_ID_LJPEG, - CODEC_ID_SP5X, - CODEC_ID_JPEGLS, - CODEC_ID_MPEG4, - CODEC_ID_RAWVIDEO, - CODEC_ID_MSMPEG4V1, - CODEC_ID_MSMPEG4V2, - CODEC_ID_MSMPEG4V3, - CODEC_ID_WMV1, - CODEC_ID_WMV2, - CODEC_ID_H263P, - CODEC_ID_H263I, - CODEC_ID_FLV1, - CODEC_ID_SVQ1, - CODEC_ID_SVQ3, - CODEC_ID_DVVIDEO, - CODEC_ID_HUFFYUV, - CODEC_ID_CYUV, - CODEC_ID_H264, - CODEC_ID_INDEO3, - CODEC_ID_VP3, - CODEC_ID_THEORA, - CODEC_ID_ASV1, - CODEC_ID_ASV2, - CODEC_ID_FFV1, - CODEC_ID_4XM, - CODEC_ID_VCR1, - CODEC_ID_CLJR, - CODEC_ID_MDEC, - CODEC_ID_ROQ, - CODEC_ID_INTERPLAY_VIDEO, - CODEC_ID_XAN_WC3, - CODEC_ID_XAN_WC4, - CODEC_ID_RPZA, - CODEC_ID_CINEPAK, - CODEC_ID_WS_VQA, - CODEC_ID_MSRLE, - CODEC_ID_MSVIDEO1, - CODEC_ID_IDCIN, - CODEC_ID_8BPS, - CODEC_ID_SMC, - CODEC_ID_FLIC, - CODEC_ID_TRUEMOTION1, - CODEC_ID_VMDVIDEO, - CODEC_ID_MSZH, - CODEC_ID_ZLIB, - CODEC_ID_QTRLE, - CODEC_ID_SNOW, - CODEC_ID_TSCC, - CODEC_ID_ULTI, - CODEC_ID_QDRAW, - CODEC_ID_VIXL, - CODEC_ID_QPEG, -{$IF LIBAVCODEC_VERSION_MAJOR < 53} - CODEC_ID_XVID, -{$IFEND} - CODEC_ID_PNG, - CODEC_ID_PPM, - CODEC_ID_PBM, - CODEC_ID_PGM, - CODEC_ID_PGMYUV, - CODEC_ID_PAM, - CODEC_ID_FFVHUFF, - CODEC_ID_RV30, - CODEC_ID_RV40, - CODEC_ID_VC1, - CODEC_ID_WMV3, - CODEC_ID_LOCO, - CODEC_ID_WNV1, - CODEC_ID_AASC, - CODEC_ID_INDEO2, - CODEC_ID_FRAPS, - CODEC_ID_TRUEMOTION2, - CODEC_ID_BMP, - CODEC_ID_CSCD, - CODEC_ID_MMVIDEO, - CODEC_ID_ZMBV, - CODEC_ID_AVS, - CODEC_ID_SMACKVIDEO, - CODEC_ID_NUV, - CODEC_ID_KMVC, - CODEC_ID_FLASHSV, - CODEC_ID_CAVS, - CODEC_ID_JPEG2000, - CODEC_ID_VMNC, - CODEC_ID_VP5, - CODEC_ID_VP6, - CODEC_ID_VP6F, - CODEC_ID_TARGA, - CODEC_ID_DSICINVIDEO, - CODEC_ID_TIERTEXSEQVIDEO, - CODEC_ID_TIFF, - CODEC_ID_GIF, - CODEC_ID_FFH264, - CODEC_ID_DXA, - CODEC_ID_DNXHD, - CODEC_ID_THP, - CODEC_ID_SGI, - CODEC_ID_C93, - CODEC_ID_BETHSOFTVID, - CODEC_ID_PTX, - CODEC_ID_TXD, - CODEC_ID_VP6A, - CODEC_ID_AMV, - CODEC_ID_VB, - CODEC_ID_PCX, - CODEC_ID_SUNRAST, - CODEC_ID_INDEO4, - CODEC_ID_INDEO5, - CODEC_ID_MIMIC, - CODEC_ID_RL2, - CODEC_ID_8SVX_EXP, - CODEC_ID_8SVX_FIB, - CODEC_ID_ESCAPE124, - CODEC_ID_DIRAC, - CODEC_ID_BFI, - CODEC_ID_CMV, - CODEC_ID_MOTIONPIXELS, - CODEC_ID_TGV, - CODEC_ID_TGQ, - CODEC_ID_TQI, - CODEC_ID_AURA, - CODEC_ID_AURA2, - CODEC_ID_V210X, - CODEC_ID_TMV, - CODEC_ID_V210, - CODEC_ID_DPX, - CODEC_ID_MAD, - CODEC_ID_FRWU, - CODEC_ID_FLASHSV2, - CODEC_ID_CDGRAPHICS, - CODEC_ID_R210, - CODEC_ID_ANM, - CODEC_ID_BINKVIDEO, - CODEC_ID_IFF_ILBM, - CODEC_ID_IFF_BYTERUN1, - CODEC_ID_KGV1, - CODEC_ID_YOP, - CODEC_ID_VP8, - CODEC_ID_PICTOR, - CODEC_ID_ANSI, - CODEC_ID_A64_MULTI, - CODEC_ID_A64_MULTI5, - CODEC_ID_R10K, - CODEC_ID_MXPEG, - CODEC_ID_LAGARITH, - CODEC_ID_PRORES, - CODEC_ID_JV, - CODEC_ID_DFA, - CODEC_ID_8SVX_RAW, - - //* various PCM "codecs" */ - CODEC_ID_PCM_S16LE= $10000, - CODEC_ID_PCM_S16BE, - CODEC_ID_PCM_U16LE, - CODEC_ID_PCM_U16BE, - CODEC_ID_PCM_S8, - CODEC_ID_PCM_U8, - CODEC_ID_PCM_MULAW, - CODEC_ID_PCM_ALAW, - CODEC_ID_PCM_S32LE, - CODEC_ID_PCM_S32BE, - CODEC_ID_PCM_U32LE, - CODEC_ID_PCM_U32BE, - CODEC_ID_PCM_S24LE, - CODEC_ID_PCM_S24BE, - CODEC_ID_PCM_U24LE, - CODEC_ID_PCM_U24BE, - CODEC_ID_PCM_S24DAUD, - CODEC_ID_PCM_ZORK, - CODEC_ID_PCM_S16LE_PLANAR, - CODEC_ID_PCM_DVD, - CODEC_ID_PCM_F32BE, - CODEC_ID_PCM_F32LE, - CODEC_ID_PCM_F64BE, - CODEC_ID_PCM_F64LE, - CODEC_ID_PCM_BLURAY, - CODEC_ID_PCM_LXF, - CODEC_ID_S302M, - - //* various ADPCM codecs */ - CODEC_ID_ADPCM_IMA_QT= $11000, - CODEC_ID_ADPCM_IMA_WAV, - CODEC_ID_ADPCM_IMA_DK3, - CODEC_ID_ADPCM_IMA_DK4, - CODEC_ID_ADPCM_IMA_WS, - CODEC_ID_ADPCM_IMA_SMJPEG, - CODEC_ID_ADPCM_MS, - CODEC_ID_ADPCM_4XM, - CODEC_ID_ADPCM_XA, - CODEC_ID_ADPCM_ADX, - CODEC_ID_ADPCM_EA, - CODEC_ID_ADPCM_G726, - CODEC_ID_ADPCM_CT, - CODEC_ID_ADPCM_SWF, - CODEC_ID_ADPCM_YAMAHA, - CODEC_ID_ADPCM_SBPRO_4, - CODEC_ID_ADPCM_SBPRO_3, - CODEC_ID_ADPCM_SBPRO_2, - CODEC_ID_ADPCM_THP, - CODEC_ID_ADPCM_IMA_AMV, - CODEC_ID_ADPCM_EA_R1, - CODEC_ID_ADPCM_EA_R3, - CODEC_ID_ADPCM_EA_R2, - CODEC_ID_ADPCM_IMA_EA_SEAD, - CODEC_ID_ADPCM_IMA_EA_EACS, - CODEC_ID_ADPCM_EA_XAS, - CODEC_ID_ADPCM_EA_MAXIS_XA, - CODEC_ID_ADPCM_IMA_ISS, - CODEC_ID_ADPCM_G722, - - //* AMR */ - CODEC_ID_AMR_NB= $12000, - CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - CODEC_ID_RA_144= $13000, - CODEC_ID_RA_288, - - //* various DPCM codecs */ - CODEC_ID_ROQ_DPCM= $14000, - CODEC_ID_INTERPLAY_DPCM, - CODEC_ID_XAN_DPCM, - CODEC_ID_SOL_DPCM, - - //* audio codecs */ - CODEC_ID_MP2= $15000, - CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - CODEC_ID_AAC, - CODEC_ID_AC3, - CODEC_ID_DTS, - CODEC_ID_VORBIS, - CODEC_ID_DVAUDIO, - CODEC_ID_WMAV1, - CODEC_ID_WMAV2, - CODEC_ID_MACE3, - CODEC_ID_MACE6, - CODEC_ID_VMDAUDIO, - CODEC_ID_SONIC, - CODEC_ID_SONIC_LS, - CODEC_ID_FLAC, - CODEC_ID_MP3ADU, - CODEC_ID_MP3ON4, - CODEC_ID_SHORTEN, - CODEC_ID_ALAC, - CODEC_ID_WESTWOOD_SND1, - CODEC_ID_GSM, ///< as in Berlin toast format - CODEC_ID_QDM2, - CODEC_ID_COOK, - CODEC_ID_TRUESPEECH, - CODEC_ID_TTA, - CODEC_ID_SMACKAUDIO, - CODEC_ID_QCELP, - CODEC_ID_WAVPACK, - CODEC_ID_DSICINAUDIO, - CODEC_ID_IMC, - CODEC_ID_MUSEPACK7, - CODEC_ID_MLP, - CODEC_ID_GSM_MS, { as found in WAV } - CODEC_ID_ATRAC3, - CODEC_ID_VOXWARE, - CODEC_ID_APE, - CODEC_ID_NELLYMOSER, - CODEC_ID_MUSEPACK8, - CODEC_ID_SPEEX, - CODEC_ID_WMAVOICE, - CODEC_ID_WMAPRO, - CODEC_ID_WMALOSSLESS, - CODEC_ID_ATRAC3P, - CODEC_ID_EAC3, - CODEC_ID_SIPR, - CODEC_ID_MP1, - CODEC_ID_TWINVQ, - CODEC_ID_TRUEHD, - CODEC_ID_MP4ALS, - CODEC_ID_ATRAC1, - CODEC_ID_BINKAUDIO_RDFT, - CODEC_ID_BINKAUDIO_DCT, - CODEC_ID_AAC_LATM, - CODEC_ID_QDMC, - CODEC_ID_CELT, - - //* subtitle codecs */ - CODEC_ID_DVD_SUBTITLE= $17000, - CODEC_ID_DVB_SUBTITLE, - CODEC_ID_TEXT, ///< raw UTF-8 text - CODEC_ID_XSUB, - CODEC_ID_SSA, - CODEC_ID_MOV_TEXT, - CODEC_ID_HDMV_PGS_SUBTITLE, - CODEC_ID_DVB_TELETEXT, - CODEC_ID_SRT, - CODEC_ID_MICRODVD, - - //* other specific kind of codecs (generally used for attachments) */ - CODEC_ID_TTF= $18000, - - CODEC_ID_PROBE= $19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it - - CODEC_ID_MPEG2TS= $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - CODEC_ID_FFMETADATA= $21000 ///< Dummy codec for streams containing only metadata information. - ); - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; -{$IFEND} - -{$IF FF_API_OLD_SAMPLE_FMT} -type - TSampleFormat = TAVSampleFormat; - -const - SAMPLE_FMT_NONE = AV_SAMPLE_FMT_NONE; - SAMPLE_FMT_U8 = AV_SAMPLE_FMT_U8; - SAMPLE_FMT_S16 = AV_SAMPLE_FMT_S16; - SAMPLE_FMT_S32 = AV_SAMPLE_FMT_S32; - SAMPLE_FMT_FLT = AV_SAMPLE_FMT_FLT; - SAMPLE_FMT_DBL = AV_SAMPLE_FMT_DBL; - SAMPLE_FMT_NB = AV_SAMPLE_FMT_NB; -{$IFEND} - -{$IF FF_API_OLD_AUDIOCONVERT} - -const - {* Audio channel masks *} - CH_FRONT_LEFT = AV_CH_FRONT_LEFT; - CH_FRONT_RIGHT = AV_CH_FRONT_RIGHT; - CH_FRONT_CENTER = AV_CH_FRONT_CENTER; - CH_LOW_FREQUENCY = AV_CH_LOW_FREQUENCY; - CH_BACK_LEFT = AV_CH_BACK_LEFT; - CH_BACK_RIGHT = AV_CH_BACK_RIGHT; - CH_FRONT_LEFT_OF_CENTER = AV_CH_FRONT_LEFT_OF_CENTER; - CH_FRONT_RIGHT_OF_CENTER = AV_CH_FRONT_RIGHT_OF_CENTER; - CH_BACK_CENTER = AV_CH_BACK_CENTER; - CH_SIDE_LEFT = AV_CH_SIDE_LEFT; - CH_SIDE_RIGHT = AV_CH_SIDE_RIGHT; - CH_TOP_CENTER = AV_CH_TOP_CENTER; - CH_TOP_FRONT_LEFT = AV_CH_TOP_FRONT_LEFT; - CH_TOP_FRONT_CENTER = AV_CH_TOP_FRONT_CENTER; - CH_TOP_FRONT_RIGHT = AV_CH_TOP_FRONT_RIGHT; - CH_TOP_BACK_LEFT = AV_CH_TOP_BACK_LEFT; - CH_TOP_BACK_CENTER = AV_CH_TOP_BACK_CENTER; - CH_TOP_BACK_RIGHT = AV_CH_TOP_BACK_RIGHT; - CH_STEREO_LEFT = AV_CH_STEREO_LEFT; - CH_STEREO_RIGHT = AV_CH_STEREO_RIGHT; - -{** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *} - CH_LAYOUT_NATIVE = AV_CH_LAYOUT_NATIVE; - - {* Audio channel convenience macros *} - CH_LAYOUT_MONO = AV_CH_LAYOUT_MONO; - CH_LAYOUT_STEREO = AV_CH_LAYOUT_STEREO; - CH_LAYOUT_2_1 = AV_CH_LAYOUT_2_1; - CH_LAYOUT_SURROUND = AV_CH_LAYOUT_SURROUND; - CH_LAYOUT_4POINT0 = AV_CH_LAYOUT_4POINT0; - CH_LAYOUT_2_2 = AV_CH_LAYOUT_2_2; - CH_LAYOUT_QUAD = AV_CH_LAYOUT_QUAD; - CH_LAYOUT_5POINT0 = AV_CH_LAYOUT_5POINT0; - CH_LAYOUT_5POINT1 = AV_CH_LAYOUT_5POINT1; - CH_LAYOUT_5POINT0_BACK = AV_CH_LAYOUT_5POINT0_BACK; - CH_LAYOUT_5POINT1_BACK = AV_CH_LAYOUT_5POINT1_BACK; - CH_LAYOUT_7POINT0 = AV_CH_LAYOUT_7POINT0; - CH_LAYOUT_7POINT1 = AV_CH_LAYOUT_7POINT1; - CH_LAYOUT_7POINT1_WIDE = AV_CH_LAYOUT_7POINT1_WIDE; - CH_LAYOUT_STEREO_DOWNMIX = AV_CH_LAYOUT_STEREO_DOWNMIX; -{$IFEND} - -{* in bytes *} - AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio - -{** - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *} - FF_INPUT_BUFFER_PADDING_SIZE = 8; - -{** - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *} - FF_MIN_BUFFER_SIZE = 16384; - -type -{* - * motion estimation type. - *} - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - - TAVDiscard = ( - {* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *} - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - -{$IF FF_API_FLAC_GLOBAL_OPTS} -(** - * LPC analysis type - *) - TAVLPCType = ( - AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type - AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients - AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients - AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion - AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization - AV_LPC_TYPE_NB ///< Not part of ABI - ); -{$IFEND} - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -{* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*} - - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - CODEC_FLAG_PART = $0080; ///< Use data partitioning. - {** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *} - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_EXTERN_HUFF = $1000; ///< use external huffman table (for mjpeg) - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - {* Fx : Flag for h263+ extra options *} - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_H263P_UMV = $02000000; ///< Unlimited motion vector - CODEC_FLAG_CBP_RD = $04000000; ///< use rate distortion optimization for cbp - CODEC_FLAG_QP_RD = $08000000; ///< use rate distortion optimization for qp selectioon - CODEC_FLAG_H263P_AIV = $00000008; ///< H263 Alternative inter vlc - CODEC_FLAG_OBMC = $00000001; ///< OBMC - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_H263P_SLICE_STRUCT = $10000000; - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_SVCD_SCAN_OFFSET = $40000000; ///< will reserve space for SVCD scan offset user data - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_STRICT_GOP = $00000002; ///< strictly enforce GOP size - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_BPYRAMID = $00000010; ///< H.264 allow b-frames to be used as references - CODEC_FLAG2_WPRED = $00000020; ///< H.264 weighted biprediction for b-frames - CODEC_FLAG2_MIXED_REFS = $00000040; ///< H.264 multiple references per partition - CODEC_FLAG2_8X8DCT = $00000080; ///< H.264 high profile 8x8 transform - CODEC_FLAG2_FASTPSKIP = $00000100; ///< H.264 fast pskip - CODEC_FLAG2_AUD = $00000200; ///< H.264 access unit delimiters - CODEC_FLAG2_BRDO = $00000400; ///< b-frame rate-distortion optimization - CODEC_FLAG2_INTRA_VLC = $00000800; ///< use MPEG-2 intra VLC table - CODEC_FLAG2_MEMC_ONLY = $00001000; ///< only do ME/MC (I frames -> ref, P frame -> ME+MC) - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. - CODEC_FLAG2_SKIP_RD = $00004000; ///< RD optimal MB level residual skipping - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_NON_LINEAR_QUANT = $00010000; ///< Use MPEG-2 nonlinear quantizer. - CODEC_FLAG2_BIT_RESERVOIR = $00020000; ///< Use a bit reservoir when encoding if possible - CODEC_FLAG2_MBTREE = $00040000; ///< Use macroblock tree ratecontrol (x264 only) - CODEC_FLAG2_PSY = $00080000; ///< Use psycho visual optimizations. - CODEC_FLAG2_SSIM = $00100000; ///< Compute SSIM during encoding, error[] values are undefined. - CODEC_FLAG2_INTRA_REFRESH = $00200000; ///< Use periodic insertion of intra blocks instead of keyframes. - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - - (** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - (* if 'parse_only' field is true, then avcodec_parse_frame() can be used *) - CODEC_CAP_PARSE_ONLY = $0004; - CODEC_CAP_TRUNCATED = $0008; - - (* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - - (** - * codec has a non zero delay and needs to be feeded with NULL at the end to get the delayed data. - * if this is not set, the codec is guranteed to never be feeded with NULL data - *) - CODEC_CAP_DELAY = $0020; - - (** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - - (** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - - (** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - - (** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - - (** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - - (** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - - (** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - - (** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - - (** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - -{$IF FF_API_OLD_FF_PICT_TYPES} -(* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values *) - FF_I_TYPE = 1; ///< Intra - FF_P_TYPE = 2; ///< Predicted - FF_B_TYPE = 3; ///< Bi-dir predicted - FF_S_TYPE = 4; ///< S(GMC)-VOP MPEG4 - FF_SI_TYPE = 5; ///< Switching Intra - FF_SP_TYPE = 6; ///< Switching Predicted - FF_BI_TYPE = 7; -{$IFEND} - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - //FF_BUG_FAKE_SCALABILITY = 16 //Autodetection should work 100%. - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; -{$IF FF_API_INOFFICIAL} - FF_COMPLIANCE_INOFFICIAL = -1; ///< Allow inofficial extensions -{$IFEND} - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_ER_CAREFUL = 1; - FF_ER_COMPLIANT = 2; - FF_ER_AGGRESSIVE = 3; - FF_ER_VERY_AGGRESSIVE = 4; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_LIBMPEG2MMX = 4; - FF_IDCT_PS2 = 5; - FF_IDCT_MLIB = 6; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_H264 = 11; - FF_IDCT_VP3 = 12; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_CAVS = 15; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_WMV2 = 19; - FF_IDCT_FAAN = 20; - FF_IDCT_EA = 21; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - FF_IDCT_BINK = 24; - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - -{$IF FF_API_MM_FLAGS} - FF_MM_FORCE = AV_CPU_FLAG_FORCE; - FF_MM_MMX = AV_CPU_FLAG_MMX; - FF_MM_3DNOW = AV_CPU_FLAG_3DNOW; - FF_MM_MMXEXT = AV_CPU_FLAG_MMX2; - FF_MM_MMX2 = AV_CPU_FLAG_MMX2; - FF_MM_SSE = AV_CPU_FLAG_SSE; - FF_MM_SSE2 = AV_CPU_FLAG_SSE2; - FF_MM_SSE2SLOW = AV_CPU_FLAG_SSE2SLOW; - FF_MM_3DNOWEXT = AV_CPU_FLAG_3DNOWEXT; - FF_MM_SSE3 = AV_CPU_FLAG_SSE3; - FF_MM_SSE3SLOW = AV_CPU_FLAG_SSE3SLOW; - FF_MM_SSSE3 = AV_CPU_FLAG_SSSE3; - FF_MM_SSE4 = AV_CPU_FLAG_SSE4; - FF_MM_SSE42 = AV_CPU_FLAG_SSE42; - FF_MM_IWMMXT = AV_CPU_FLAG_IWMMXT; - FF_MM_ALTIVEC = AV_CPU_FLAG_ALTIVEC; -{$IFEND} - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - -{$IF FF_API_ANTIALIAS_ALGO} - FF_AA_AUTO = 0; - FF_AA_FASTINT = 1; //not implemented yet - FF_AA_INT = 2; - FF_AA_FLOAT = 3; -{$IFEND} - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - FF_PROFILE_H264_CONSTRAINED = (1<<9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1<<11); // 8+3; constraint_set3_flag - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_LEVEL_UNKNOWN = -99; - - X264_PART_I4X4 = $001; (* Analyse i4x4 *) - X264_PART_I8X8 = $002; (* Analyse i8x8 (requires 8x8 transform) *) - X264_PART_P8X8 = $010; (* Analyse p16x8, p8x16 and p8x8 *) - X264_PART_P4X4 = $020; (* Analyse p8x4, p4x8, p4x4 *) - X264_PART_B8X8 = $100; (* Analyse b16x8, b8x16 and b8x8 *) - - FF_COMPRESSION_DEFAULT = -1; - - FF_THREAD_FRAME = 1; //< Decode more than one frame at once - FF_THREAD_SLICE = 2; //< Decode more than one part of a single frame at once - - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type - PAVPacket = ^TAVPacket; - TAVPacket = record -(* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; -(* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - flags: cint; -(* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; - pos: cint64; // byte position in stream, -1 if unknown - -(* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; -{$IF LIBAVCODEC_VERSION_MAJOR < 53} - PKT_FLAG_KEY = AV_PKT_FLAG_KEY; -{$IFEND} - -type - PAVCodecContext = ^TAVCodecContext; - - (** - * Audio Video Frame. - * New fields can be added to the end of FF_COMMON_FRAME with minor version - * bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. No fields should be added into AVFrame before or after - * FF_COMMON_FRAME! - * sizeof(AVFrame) must not be used outside libav*. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture planes. - * This might be different from the first allocated byte - * - encoding: - * - decoding: - *) - data: array [0..3] of pbyte; - linesize: array [0..3] of cint; - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..3] of pbyte; - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * buffer age (1->was last buffer and dint change, 2->..., ...). - * Set to INT_MAX if the buffer has not been used yet. - * - encoding: unused - * - decoding: MUST be set by get_buffer(). - *) - age: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: byte; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..3] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * - *) - qscale_type: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * reordered pts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * reordered sample aspect ratio for the video frame, 0/1 if unknown\unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * format of the frame, -1 if unknown or unset - * It should be cast to the corresponding enum (enum PixelFormat - * for video, enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - end; {TAVFrame} - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PQuadIntArray = ^TQuadIntArray; - TQuadIntArray = array [0..3] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - -{$IF FF_API_PALETTE_CONTROL} -(** - * AVPaletteControl - * This structure defines a method for communicating palette changes - * between and demuxer and a decoder. - * - * @deprecated Use AVPacket to send palette changes instead. - * This is totally broken. - *) - PAVPaletteControl = ^TAVPaletteControl; - TAVPaletteControl = record - (* demuxer sets this to 1 to indicate the palette has changed; - * decoder resets to 0 *) - palette_changed: cint; - - (* 4-byte ARGB palette entries, stored in native byte order; note that - * the individual palette components should be on a 8-bit scale; if - * the palette data comes from a IBM VGA native format, the component - * data is probably 6 bits in size and needs to be scaled *) - palette: array [0..AVPALETTE_COUNT - 1] of cuint; - end; {deprecated;} -{$IFEND} - - (** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context - *) - av_class: PAVClass; - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * Some codecs need additional format info. It is stored here. - * If any muxer uses this then ALL demuxers/parsers AND encoders for the - * specific codec MUST set it correctly otherwise stream copy breaks. - * In general use of this field by muxers is not recommanded. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. (FIXME: Is this OK?) - *) - sub_id: cint; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid prolems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - * Note: For compatibility it is possible to set this instead of - * coded_width/height before decoding. - *) - width, height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overriden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - -{$IF FF_API_RATE_EMU} - (** - * Frame rate emulation. If not zero, the lower layer (i.e. format handler) - * has to read frames at native frame rate. - * - encoding: Set by user. - * - decoding: unused - *) - rate_emu: cint; -{$IFEND} - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PQuadIntArray; - y: cint; type_: cint; height: cint); cdecl; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Samples per packet, initialized when calling 'init'. - *) - frame_size: cint; - frame_number: cint; ///< audio or video frame number -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} - real_pict_num: cint; ///< returns the real picture number of previous encoded frame -{$IFEND} - - (** - * Number of frames the decoded output will be delayed relative to - * the encoded input. - * - encoding: Set by libavcodec. - * - decoding: unused - *) - delay: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - -{$IF FF_API_HURRY_UP} - (** - * hurry up amount - * - encoding: unused - * - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header - * @deprecated Deprecated in favor of skip_idct and skip_frame. - *) - hurry_up: cint; -{$IFEND} - - codec: PAVCodec; - - priv_data: pointer; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - codec_name: array [0..31] of AnsiChar; - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec_id: TCodecID; (* see CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger then 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - luma_elim_threshold: cint; - - (** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - chroma_elim_threshold: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Error recognization; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Called at the beginning of each frame to get a buffer for it. - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - parse_only: cint; (* - decoding only: if true, only parsing is done - (function avcodec_parse_frame()). The frame - data is returned. Only MPEG codecs support this now. *) - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override: PRcOverride; - rc_override_count: cint; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - rc_buffer_aggressivity: cfloat; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * dsp_mask could be add used to disable unwanted CPU features - * CPU features (i.e. MMX, SSE. ...) - * - * With the FORCE flag you may instead enable given CPU features. - * (Dangerous: Usable in case of misdetection, improper usage however will - * result into program crash.) - *) - dsp_mask: cuint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..3] of cuint64; - -{$IF FF_API_MB_Q} - (** - * minimum MB quantizer - * - encoding: unused - * - decoding: unused - *) - mb_qmin: cint; {deprecated} - - (** - * maximum MB quantizer - * - encoding: unused - * - decoding: unused - *) - mb_qmax: cint; {deprecated} -{$IFEND} - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - *) - color_table_id: cint; - - (** - * internal_buffer count - * Don't touch, used by libavcodec default_get_buffer(). - *) - internal_buffer_count: cint; - - (** - * internal_buffers - * Don't touch, used by libavcodec default_get_buffer(). - *) - internal_buffer: pointer; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - { - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - realloc: function (s: PAVCodecContext; buf: Pbyte; buf_size: cint): Pbyte; cdecl; - } - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: array [0..3] of AnsiChar; //cuint; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - -{$IF FF_API_PALETTE_CONTROL} - (** - * palette control structure - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by user. - *) - palctrl: PAVPaletteControl; -{$IFEND} - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - inter_threshold: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - -{$IF FF_API_ANTIALIAS_ALGO} - (** - * MP3 antialias algorithm, see FF_AA_* below. - * - encoding: unused - * - decoding: Set by user. - *) - antialias_algo: cint; {deprecated} -{$IFEND} - - (** - * quantizer noise shaping - * - encoding: Set by user. - * - decoding: unused - *) - quantizer_noise_shaping: cint; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; - - (** - * Bitstream width / height, may be different from width/height if lowres - * or other things are used. - * - encoding: unused - * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. - *) - coded_width, coded_height: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * constant rate factor - quality-based VBR - values ~correspond to qps - * - encoding: Set by user. - * - decoding: unused - *) - crf: cfloat; - - (** - * constant quantization parameter rate control method - * - encoding: Set by user. - * - decoding: unused - *) - cqp: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Influences how often B-frames are used. - * - encoding: Set by user. - * - decoding: unused - *) - bframebias: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * Reduce fluctuations in qp (before curve compression). - * - encoding: Set by user. - * - decoding: unused - *) - complexityblur: cfloat; - - (** - * in-loop deblocking filter alphac0 parameter - * alpha is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockalpha: cint; - - (** - * in-loop deblocking filter beta parameter - * beta is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockbeta: cint; - - (** - * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4 - * - encoding: Set by user. - * - decoding: unused - *) - partitions: cint; - - (** - * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto) - * - encoding: Set by user. - * - decoding: unused - *) - directpred: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjusts sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - -{$IF FF_API_USE_LPC} - (** - * Sets whether to use LPC mode - used by FLAC encoder. - * - encoding: Set by user. - * - decoding: unused - * @deprecated Deprecated in favor of lpc_type and lpc_passes. - *) - use_lpc: cint; - - (** - * LPC coefficient precision - used by FLAC encoder - * - encoding: Set by user. - * - decoding: unused - *) - lpc_coeff_precision: cint; -{$IFEND} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - -{$IF FF_API_FLAC_GLOBAL_OPTS} - (** - * @defgroup flac_opts FLAC options - * @deprecated Use FLAC encoder private options instead. - * @{ - *) - - (** - * search method for selecting prediction order - * - encoding: Set by user. - * - decoding: unused - *) - prediction_order_method: cint; {deprecated} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_partition_order: cint; {deprecated} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_partition_order: cint; {deprecated} -{$IFEND} - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user. - * - decoding: unused - *) - timecode_frame_start: cint64; - -{$IF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; -{$IFEND} - - (** - * Percentage of dynamic range compression to be applied by the decoder. - * The default value is 1.0, corresponding to full compression. - * - encoding: unused - * - decoding: Set by user. - *) - drc_scale: cfloat; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * This field is applicable only when sample_fmt is AV_SAMPLE_FMT_S32. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - channel_layout: cint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cint64; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * explicit P-frame weighted prediction analysis method - * 0: off - * 1: fast blind weighting (one reference duplicate with -1 offset) - * 2: smart weighting (full fade detection analysis) - * - encoding: Set by user. - * - decoding: unused - *) - weighted_p_pred: cint; - - (** - * AQ mode - * 0: Disabled - * 1: Variance AQ (complexity mask) - * 2: Auto-variance AQ (experimental) - * - encoding: Set by user - * - decoding: unused - *) - aq_mode: cint; - - (** - * AQ strength - * Reduces blocking and blurring in flat and textured areas. - * - encoding: Set by user - * - decoding: unused - *) - aq_strength: cfloat; - - (** - * PSY RD - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_rd: cfloat; - - (** - * PSY trellis - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_trellis: cfloat; - - (** - * RC lookahead - * Number of frames for frametype and ratecontrol lookahead - * - encoding: Set by user - * - decoding: unused - *) - rc_lookahead: cint; - - (** - * Constant rate factor maximum - * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse - * than crf_max, even if doing so would violate VBV restrictions. - * - encoding: Set by user. - * - decoding: unused - *) - crf_max: cfloat; - - log_level_offset: cint; - -{$IF FF_API_FLAC_GLOBAL_OPTS} - (** - * Determines which LPC analysis algorithm to use. - * - encoding: Set by user - * - decoding: unused - *) - lpc_type: TAVLPCType; {deprecated} - - (** - * Number of passes to use for Cholesky factorization during LPC analysis - * - encoding: Set by user - * - decoding: unused - *) - lpc_passes: cint; {deprecated} -{$IFEND} - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - - (** - * Whether this is a copy of the context which had init() called on it. - * This is used by multithreading - shared tables and picture pointers - * should be freed from the original context only. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - is_copy: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - -(** - * AVCodec. - *) - TAVCodec = record - name: PAnsiChar; - type_: TAVMediaType; - id: TCodecID; - priv_data_size: cint; - init: function (avctx: PAVCodecContext): cint; cdecl; - encode: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; data: pointer): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - next: PAVCodec; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (** - * @defgroup framethreading Frame-level threading support functions. - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See CODEC_ID_xxx - *) - id: TCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..3] of PByteArray; - linesize: array [0..3] of cint; ///< number of bytes per line - end; {TAVPicture} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The pressentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(* packet functions *) - -(** - * @deprecated use NULL instead - *) -procedure av_destruct_packet_nofree(pkt: PAVPacket); - cdecl; external av__codec; deprecated; - -(* - * Default packet destructor. - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* resample.c *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -{$IF FF_API_AUDIO_OLD} -(** - * @deprecated Use av_audio_resample_init() instead. - *) -function audio_resample_init (output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint): PReSampleContext; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occured - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields. - * The fields of the given AVPicture are filled in by using the 'ptr' address - * which points to the image data buffer. Depending on the specified picture - * format, one or multiple image data pointers and line sizes will be set. - * If a planar format is specified, several pointers will be set pointing to - * the different picture planes and the line sizes of the different planes - * will be stored in the lines_sizes array. - * Call with ptr == NULL to get the required size for the ptr buffer. - * - * @param picture AVPicture whose fields are to be filled in - * @param ptr Buffer which will contain or contains the actual image data - * @param pix_fmt The format in which the picture data is stored. - * @param width the width of the image in pixels - * @param height the height of the image in pixels - * @return size of the image data in bytes - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer. - * The data is stored compactly, without any gaps for alignment or padding - * which may be applied by avpicture_fill(). - * - * \see avpicture_get_size() - * - * @param[in] src AVPicture containing image data - * @param[in] pix_fmt The format in which the picture data is stored. - * @param[in] width the width of the image in pixels. - * @param[in] height the height of the image in pixels. - * @param[out] dest A buffer into which picture data will be copied. - * @param[in] dest_size The size of 'dest'. - * @return The number of bytes written to dest, or a negative value (error code) on error. - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Note that this returns the size of a compact representation as generated - * by avpicture_layout, which can be smaller than the size required for e.g. - * avpicture_fill. - * - * @param pix_fmt the given picture format - * @param width the width of the image - * @param height the height of the image - * @return Image data size in bytes or -1 on error (e.g. too large dimensions). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -{$IF FF_API_GET_PIX_FMT_NAME} -(** - * Return the short name for a pixel format. - * - * \see av_get_pix_fmt(), av_get_pix_fmt_string(). - * @deprecated Deprecated in favor of av_get_pix_fmt_name(). - *) -function avcodec_get_pix_fmt_name(pix_fmt: TAVPixelFormat): PAnsiChar; - cdecl; external av__codec; deprecated; -{$IFEND} - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} -(** - * Return the pixel format corresponding to the name name. - * - * If there is no pixel format with name name, then looks for a - * pixel format with the name corresponding to the native endian - * format of name. - * For example in a little-endian system, first looks for "gray16", - * then for "gray16le". - * - * Finally if no pixel format has been found, returns PIX_FMT_NONE.* - * @deprecated Deprecated in favor of av_get_pix_fmt(). - *) -function avcodec_get_pix_fmt(name: {const} PAnsiChar): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; {**< loss due to resolution change *} - FF_LOSS_DEPTH = $0002; {**< loss due to color depth change *} - FF_LOSS_COLORSPACE = $0004; {**< loss due to color space conversion *} - FF_LOSS_ALPHA = $0008; {**< loss of alpha bits *} - FF_LOSS_COLORQUANT = $0010; {**< loss due to color quantization *} - FF_LOSS_CHROMA = $0020; {**< loss of chroma (e.g. RGB to gray conversion) *} - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur. - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_mask parameter. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24); - * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint64; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): TAVPixelFormat; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} -(** - * @deprecated Use av_get_pix_fmt_string() instead. - *) -procedure avcodec_pix_fmt_string (buf: PAnsiChar; buf_size: cint; pix_fmt: TAVPixelFormat); - cdecl; external av__codec; deprecated; -{$IFEND} - -const - FF_ALPHA_TRANSP = $0001; {* image has some totally transparent pixels *} - FF_ALPHA_SEMI_TRANSP = $0002; {* image has some transparent pixels *} - -(** - * Tell if an image really has transparent alpha values. - * @return ored mask of FF_ALPHA_xxx constants - *) -function img_get_alpha_info (src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; - cdecl; external av__codec; - -(* deinterlace a picture *) -(* deinterlace - if not supported return -1 *) -function avpicture_deinterlace (dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; - cdecl; external av__codec; - -(* external high level API *) - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Initialize libavcodec. - * - * @warning This function must be called before any other libavcodec - * function. - * - * @warning This function is not thread-safe. - *) -procedure avcodec_init(); - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} -(** - * @deprecated Deprecated in favor of avcodec_register(). - *) -procedure register_avcodec(codec: PAVCodec); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Register the codec codec and initialize libavcodec. - * - * @see avcodec_init(), avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id CodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: PAVCodec); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context3(codec: PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param pic The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults (pic: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct can be deallocated by simply calling av_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PQuadIntArray); - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} -(** - * @deprecated Deprecated in favor of av_check_image_size(). - *) -function avcodec_check_dimensions(av_log_ctx: pointer; w: cuint; h: cuint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -{$IF FF_API_THREAD_INIT} -(** - * @deprecated Set s->thread_count before calling avcodec_open() instead of calling this. - *) -function avcodec_thread_init(s: PAVCodecContext; thread_count: cint): cint; - cdecl; external av__codec; deprecated; -procedure avcodec_thread_free(s: PAVCodecContext); - cdecl; external av__codec; deprecated; -{$IFEND} - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context(); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context(); - * - * if (avcodec_open(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -{$IF FF_API_AUDIO_OLD} -(** - * Decode an audio frame from buf into samples. - * Wrapper function which calls avcodec_decode_audio3. - * - * @deprecated Use avcodec_decode_audio3 instead. - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] buf the input buffer - * @param[in] buf_size the input buffer size in bytes - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_audio2(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - buf: {const} PByteArray; buf_size: cint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Some codecs have a delay between input and output, these need to be - * fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -{$IF FF_API_VIDEO_OLD} -(** - * Decode a video frame from buf into picture. - * Wrapper function which calls avcodec_decode_video2. - * - * @deprecated Use avcodec_decode_video2 instead. - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use avcodec_alloc_frame to get an AVFrame, the codec will - * allocate memory for the actual bitmap. - * with default get/release_buffer(), the decoder frees/reuses the bitmap as it sees fit. - * with overridden get/release_buffer() (needs CODEC_CAP_DR1) the user decides into what buffer the decoder - * decodes and the decoder tells the user once it does not need the data anymore, - * the user app can at this point free/reuse/keep the memory as it sees fit. - * - * @param[in] buf the input buffer - * @param[in] buf_size the size of the input buffer in bytes - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - buf: {const} PByteArray; buf_size: cint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -{$IF FF_API_SUBTITLE_OLD} -(* Decode a subtitle message. Return -1 if error, otherwise return the - * number of bytes used. If no subtitle could be decompressed, - * got_sub_ptr is zero. Otherwise, the subtitle is stored in*sub. - *) -function avcodec_decode_subtitle(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - buf: {const} PByteArray; buf_size: cint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Frees all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -function avcodec_parse_frame(avctx: PAVCodecContext; pdata: PPointer; - data_size_ptr: PCint; - buf: PByteArray; buf_size: cint): cint; - cdecl; external av__codec; - -(** - * Encode an audio frame from samples into buf. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for PCM audio the user will know how much space is needed - * because it depends on the value passed in buf_size as described - * below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For PCM audio the number of samples read from samples is equal to - * buf_size * input_sample_size / output_sample_size. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; - -(** - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -procedure avcodec_default_free_buffers(s: PAVCodecContext); - cdecl; external av__codec; - -(* misc useful functions *) - -{$IF FF_API_OLD_FF_PICT_TYPES} -(** - * Return a single letter to describe the given picture type pict_type. - * - * @param[in] pict_type the picture type - * @return A single character representing the picture type. - * @deprecated Use av_get_picture_type_char() instead. - *) -function av_get_pict_type_char(pict_type: cint): AnsiChar; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TCodecID): cint; - cdecl; external av__codec; - -{$IF FF_API_OLD_SAMPLE_FMT} -(** - * @deprecated Use av_get_bits_per_sample_fmt() instead. - *) -function av_get_bits_per_sample_format(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (*! - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} -function av_parser_parse(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: FF_INTERNALC_MEM_TYPE); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: FF_INTERNALC_MEM_TYPE); - cdecl; external av__codec; - -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} -(** - * @deprecated Deprecated in favor of av_image_copy(). - *) -type - PQuaduint8Array = ^TQuaduint8Array; - TQuaduint8Array = array [0..3] of cuint8; - -procedure av_picture_data_copy(dst_data: PQuaduint8Array; dst_linesize: TQuadIntArray; - src_data: PQuaduint8Array; src_linesize: TQuadIntArray; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Copy image src to dst. Wraps av_picture_data_copy() above. - *) -procedure av_picture_copy(dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - top_band: cint; - left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; - src: {const} PAVPicture; - height: cint; - width: cint; - pix_fmt: TAVPixelFormat; - padtop: cint; - padbottom: cint; - padleft: cint; - padright: - cint; - color: PCint): cint; - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} -(** - * Parse str and put in width_ptr and height_ptr the detected values. - * - * @deprecated Deprecated in favor of av_parse_video_size(). - *) -function av_parse_video_frame_size(width_ptr: PCint; height_ptr: PCint; str: {const} PAnsiChar): cint; - cdecl; external av__codec; deprecated; - -(** - * Parse str and store the detected values in *frame_rate. - * - * @deprecated Deprecated in favor of av_parse_video_rate(). - *) -function av_parse_video_frame_rate(frame_rate: PAVRational; str: {const} PAnsiChar): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); - cdecl; external av__codec; - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.7/avformat.pas b/src/lib/ffmpeg-0.7/avformat.pas deleted file mode 100644 index 7153bfb0..00000000 --- a/src/lib/ffmpeg-0.7/avformat.pas +++ /dev/null @@ -1,1836 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 0.7 libavformat/avformat.h - * Min. version: 52.110.0 - * Max. version: 52.111.0 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 0.7x - * This file has been created with the previous ffmpeg headers as a basis - * by removing all unneeded conditionals. - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 111; - LIBAVFORMAT_MAX_VERSION_RELEASE = 0; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 52; - LIBAVFORMAT_MIN_VERSION_MINOR = 110; - LIBAVFORMAT_MIN_VERSION_RELEASE = 0; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -type - PAVFile = Pointer; - -(* - * Public Metadata API. - * The metadata API allows libavformat to export metadata tags to a client - * application using a sequence of key/value pairs. Like all strings in FFmpeg, - * metadata must be stored as UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * Important concepts to keep in mind: - * 1. Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * 2. Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * 3. Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * a) language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * b) sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * 4. Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - * album -- name of the set this work belongs to - * album_artist -- main creator of the set/album, if different from artist. - * e.g. "Various Artists" for compilation albums. - * artist -- main creator of the work - * comment -- any additional description of the file. - * composer -- who composed the work, if different from artist. - * copyright -- name of copyright holder. - * creation_time-- date when the file was created, preferably in ISO 8601. - * date -- date when the work was created, preferably in ISO 8601. - * disc -- number of a subset, e.g. disc in a multi-disc collection. - * encoder -- name/settings of the software/hardware that produced the file. - * encoded_by -- person/group who created the file. - * filename -- original name of the file. - * genre -- . - * language -- main language in which the work is performed, preferably - * in ISO 639-2 format. Multiple languages can be specified by - * separating them with commas. - * performer -- artist who performed the work, if different from artist. - * E.g for "Also sprach Zarathustra", artist would be "Richard - * Strauss" and performer "London Philharmonic Orchestra". - * publisher -- name of the label/publisher. - * service_name -- name of the service in broadcasting (channel name). - * service_provider -- name of the service provider in broadcasting. - * title -- name of the work. - * track -- number of this work in the set, can be in form current/total. - * variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - *) - -{$IF FF_API_OLD_METADATA2} -(** - * @defgroup old_metadata Old metadata API - * The following functions are deprecated, use - * their equivalents from libavutil/dict.h instead. - * @ - *) - -const - AV_METADATA_MATCH_CASE = AV_DICT_MATCH_CASE; - AV_METADATA_IGNORE_SUFFIX = AV_DICT_IGNORE_SUFFIX; - AV_METADATA_DONT_STRDUP_KEY = AV_DICT_DONT_STRDUP_KEY; - AV_METADATA_DONT_STRDUP_VAL = AV_DICT_DONT_STRDUP_VAL; - AV_METADATA_DONT_OVERWRITE = AV_DICT_DONT_OVERWRITE; - -type - PAVMetadataTag = ^TAVMetadataTag; - TAVMetadataTag = record - key: PAnsiChar; - value: PAnsiChar; - end; - - PAVMetadata = Pointer; - PAVDictionary = PAVMetadata; - PAVDictionaryEntry = PAVMetadata; - -(** - * Get a metadata element with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found tag or NULL, changing key or value leads to undefined behavior. - *) -function av_metadata_get(m: PAVDictionary; key: {const} PAnsiChar; - prev: {const} PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__format; - -{$IF FF_API_OLD_METADATA} -(** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped) - * @param value tag value to add to *pm (will be av_strduped) - * @return >= 0 on success otherwise an error code <0 - * @deprecated Use av_metadata_set2() instead. - *) -function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped depending on flags) - * @param value tag value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_metadata_set2(var pm: PAVDictionary; key: {const} PAnsiChar; value: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; - -(** - * Copy metadata from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting metadata in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_metadata_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__format; deprecated; - -(** - * Free all the memory allocated for an AVDictionary struct. - *) -procedure av_metadata_free(var m: PAVDictionary); - cdecl; external av__format; deprecated; - -{$IFEND} - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PByteIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - - //! Demuxer will use url_fopen, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - - AVFMT_NOOUTPUTLOOP = -1; - AVFMT_INFINITEOUTPUTLOOP = 0; - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_RTP_HINT = $0040; ///< Add RTP hinting to the output file - - // used by AVStream - MAX_REORDER_DELAY = 16; - MAX_PROBE_PACKETS = 2500; - MAX_STD_TIMEBASES = 60*12+5; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVFormatParameters = ^TAVFormatParameters; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units -{$IF FF_API_OLD_METADATA} - title: PAnsiChar; ///< chapter title -{$IFEND} - metadata: PAVDictionary; - end; - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - TAVFormatParameters = record - time_base: TAVRational; - sample_rate: cint; - channels: cint; - width: cint; - height: cint; - pix_fmt: TAVPixelFormat; - channel: cint; (**< Used to select DV channel. *) - standard: PAnsiChar; (**< TV standard, NTSC, PAL, SECAM *) - { Delphi does not support bit fields -> use bf_flags instead - unsigned int mpeg2ts_raw:1; (**< Force raw MPEG-2 transport stream output, if possible. *) - unsigned int mpeg2ts_compute_pcr:1; (**< Compute exact PCR for each transport - stream packet (only meaningful if - mpeg2ts_raw is TRUE). *) - unsigned int initial_pause:1; (**< Do not begin to play the stream - immediately (RTSP only). *) - unsigned int prealloced_context:1; - } - bf_flags: byte; // 0:mpeg2ts_raw/1:mpeg2ts_compute_pcr/2:initial_pause/3:prealloced_context - video_codec_id: TCodecID; - audio_codec_id: TCodecID; - end; - - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - (* output support *) - audio_codec: TCodecID; (**< default audio codec *) - video_codec: TCodecID; (**< default video codec *) - write_header: function (c: PAVFormatContext): cint; cdecl; - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER - *) - flags: cint; - (** - * Currently only used to set pixel format if not YUV420P. - *) - set_parameters: function (c: PAVFormatContext; f: PAVFormatParameters): cint; cdecl; - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - subtitle_codec: TCodecID; (**< default subtitle codec *) - - {const} metadata_conv: PAVMetadataConv; - - (* private fields *) - next: PAVOutputFormat; - end; - - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. 'ap' if non-NULL contains - * additional parameters. Only used in raw format right - * now. 'av_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'av_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Gets the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - (** - * General purpose read-only value that the format can use. - *) - value: cint; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - codec_tag: {const} PPAVCodecTag; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - {const} metadata_conv: PAVMetadataConv; - - (* private fields *) - next: PAVInputFormat; - end; - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - -(** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - id: cint; (**< format-specific stream ID *) - codec: PAVCodecContext; (**< codec context *) - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - *) - r_frame_rate: TAVRational; - priv_data: pointer; - - (* internal data used in av_find_stream_info() *) - first_dts: cint64; - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * time base should be 1/framerate and timestamp increments should be 1. - *) - time_base: TAVRational; - pts_wrap_bits: cint; (* number of bits in pts (used for wrapping control) *) - (* ffmpeg.c private use *) - stream_copy: cint; (**< If set, just copy stream. *) - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - //FIXME move stuff to a flags field? - (** - * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. - * MN:dunno if thats the right place, for it - *) - quality: cfloat; - - (** - * Decoding: pts of the first frame of the stream, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - -{$IF FF_API_OLD_METADATA} - language: array [0..3] of PAnsiChar; (**< ISO 639-2/B 3-letter language code (empty string if undefined) *) -{$IFEND} - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - cur_dts: cint64; - last_IP_duration: cint; - last_IP_pts: cint64; - (* av_seek_frame() support *) - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - unused: array [0..4] of cint64; -{$IF FF_API_OLD_METADATA} - filename: PAnsiChar; (**< source filename of the stream *) -{$IFEND} - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVMetadata; - - {* Intended mostly for av_read_frame() support. Not supposed to be used by *} - {* external applications; try to use something else if at all possible. *} - cur_ptr: {const} PCuint8; - cur_len: cint; - cur_pkt: TAVPacket; - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - - (** - * Number of packets to buffer for codec probing - * NOT PART OF PUBLIC API - *) - probe_packets: cint; - - (** - * last packet in packet_buffer for this stream when muxing. - * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav* - *) - last_in_packet_buffer: PAVPacketList; - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - (** - * Stream informations used internally by av_find_stream_info() - *) - info: pointer; - { - record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - duration_error: array[0..MAX_STD_TIMEBASES-1] of cdouble; - codec_info_duration: cint64; - end; - } - - (** - * flag to indicate that probing is requested - * NOT PART OF PUBLIC API - *) - request_probe: cint; - end; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*. - *) - TAVFormatContext = record - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - (* Can only be iformat or oformat, not both at the same time. *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - priv_data: pointer; - - pb: PByteIOContext; - - nb_streams: cuint; -{$IF FF_API_MAX_STREAMS} - streams: array [0..MAX_STREAMS - 1] of PAVStream; -{$ELSE} - streams: PPAVStream; -{$IFEND} - filename: array [0..1023] of AnsiChar; (* input or output filename *) - (* stream info *) - timestamp: cint64; -{$IF FF_API_OLD_METADATA} - title: array [0..511] of AnsiChar; - author: array [0..511] of AnsiChar; - copyright: array [0..511] of AnsiChar; - comment: array [0..511] of AnsiChar; - album: array [0..511] of AnsiChar; - year: cint; (**< ID3 year, 0 if none *) - track: cint; (**< track number, 0 if none *) - genre: array [0..31] of AnsiChar; (**< ID3 genre *) -{$IFEND} - - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - (* private data for pts handling (do not modify directly). *) - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - (** - * decoding: total file size, 0 if unknown - *) - file_size: cint64; - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - (* av_read_frame() support *) - cur_st: PAVStream; - cur_ptr_deprecated: pbyte; - cur_len_deprecated: cint; - cur_pkt_deprecated: TAVPacket; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - index_built: cint; - - mux_rate: cint; - packet_size: cuint; - preload: cint; - max_delay: cint; - - (** - * number of times to loop output in formats that support it - *) - loop_output: cint; - - flags: cint; - loop_input: cint; - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * Maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in av_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen : cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer: PAVPacketList; - raw_packet_buffer_end: PAVPacketList; - - packet_buffer_end: PAVPacketList; - - metadata: PAVMetadata; - - (** - * Remaining size available for raw_packet_buffer, in bytes. - * NOT PART OF PUBLIC API - *) - raw_packet_buffer_remaining_size: cint; - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - end; - - (** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id : cint; -{$IF FF_API_OLD_METADATA} - provider_name : PAnsiChar; ///< network name for DVB streams - name : PAnsiChar; ///< service name for DVB streams -{$IFEND} - flags : cint; - discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index : PCardinal; - nb_stream_indexes : PCardinal; - metadata : PAVMetadata; - end; - - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. If one of the tables is NULL, then - * tags are converted to/from ffmpeg generic tag names. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) -procedure av_metadata_conv(ctx: PAVFormatContext; {const} d_conv: PAVMetadataConv; - {const} s_conv: PAVMetadataConv); - cdecl; external av__format; - -{ -var - first_iformat: PAVInputFormat; external av__format; - first_oformat: PAVOutputFormat; external av__format; -} - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -function av_guess_image2_codec(filename: {const} PAnsiChar): TCodecID; - cdecl; external av__format; - -(* XXX: Use automatic init with either ELF sections or C file parser *) -(* modules. *) - -(* utils.c *) -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; - -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -function guess_stream_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; deprecated; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -(** - * @deprecated Use av_guess_format() instead. - *) -function guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; deprecated; - -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TCodecID; - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - *) -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - *) -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -(** - * Get the CodecID for the given codec tag tag. - * If no codec id is found returns CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; - cdecl; external av__format; - -(* media file input *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Allocate all the structures needed to read an input stream. - * This does not open the needed codecs for decoding the stream[s]. - *) -function av_open_input_stream(var ic_ptr: PAVFormatContext; - pb: PByteIOContext; filename: PAnsiChar; - fmt: PAVInputFormat; ap: PAVFormatParameters): cint; - cdecl; external av__format; - -(** - * Open a media file as input. The codecs are not opened. Only the file - * header (if present) is read. - * - * @param ic_ptr The opened media file handle is put here. - * @param filename filename to open - * @param fmt If non-NULL, force the file format to use. - * @param buf_size optional buffer size (zero if default is OK) - * @param ap Additional parameters needed when opening the file - * (NULL if default). - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_open_input_file(var ic_ptr: PAVFormatContext; filename: PAnsiChar; - fmt: PAVInputFormat; buf_size: cint; - ap: PAVFormatParameters): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; {const} filename: PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * @deprecated Use avformat_alloc_context() instead. - *) -function av_alloc_format_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52111000} // 52.111.0 -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; -{$IFEND} - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * - * The returned packet is valid - * until the next av_read_frame() or until av_close_input_file() and - * must be freed with av_free_packet. For video, the packet contains - * exactly one frame. For audio, it contains an cint number of - * frames if each frame has a known fixed size (e.g. PCM or ADPCM - * data). If the audio frames have a variable size (e.g. MPEG audio), - * then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in byte and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * - * @param stream_index index of the stream which is used as time base reference. - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Free a AVFormatContext allocated by av_open_input_stream. - * @param s context to free - *) -procedure av_close_input_stream(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * Add a new chapter. - * This function is NOT part of the public API - * and should ONLY be used by demuxers. - * - * @param s media file handle - * @param id unique ID for this chapter - * @param start chapter start time in time_base units - * @param end chapter end time in time_base units - * @param title chapter title - * - * @return AVChapter or NULL on error - *) -function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; - start, end_: cint64; title: {const} PAnsiChar): PAVChapter; - cdecl; external av__format; - -(** - * Set the pts for a given stream. - * - * @param s stream - * @param pts_wrap_bits number of bits effectively used by the pts - * (used for wrap control, 33 is the value for MPEG) - * @param pts_num numerator to convert to seconds (MPEG: 1) - * @param pts_den denominator to convert to seconds (MPEG: 90000) - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Ensure the index uses less memory than the maximum specified in - * AVFormatContext.max_index_size by discarding entries if it grows - * too large. - * This function is not part of the public API and should only be called - * by demuxers. - *) -procedure ff_reduce_index(s: PAVFormatContext; stream_index: cint); - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Perform a binary search using av_index_search_timestamp() and - * AVInputFormat.read_timestamp(). - * This is not supposed to be called directly by a user application, - * but by demuxers. - * @param target_ts target timestamp in the time base of the given stream - * @param stream_index stream number - *) -function av_seek_frame_binary(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Update cur_dts of all streams based on the given timestamp and AVStream. - * - * Stream ref_st unchanged, others set cur_dts in their native time base. - * Only needed for timestamp wrapping or if (dts not set and pts!=dts). - * @param timestamp new dts expressed in time_base of param ref_st - * @param ref_st reference stream giving time_base of param timestamp - *) -procedure av_update_cur_dts(s: PAVFormatContext; ref_st: PAVStream; - timestamp: cint64); - cdecl; external av__format; - -type - TReadTimestampFunc = function (pavfc: PAVFormatContext; - arg2: cint; arg3: Pint64; arg4: cint64): cint64; cdecl; - -(** - * Perform a binary search using read_timestamp(). - * This is not supposed to be called directly by a user application, - * but by demuxers. - * @param target_ts target timestamp in the time base of the given stream - * @param stream_index stream number - *) -function av_gen_search(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; pos_min: cint64; - pos_max: cint64; pos_limit: cint64; - ts_min: cint64; ts_max: cint64; - flags: cint; ts_ret: Pint64; - read_timestamp: TReadTimestampFunc): cint64; - cdecl; external av__format; - -(** - * media file output - *) -function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -(** - * Allocate the stream private data and write the stream header to an - * output media file. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_header(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * The packet shall contain one audio or video frame. - * The packet must be correctly interleaved according to the container - * specification, if not then av_interleaved_write_frame must be used. - * - * @param s media file handle - * @param pkt The packet, which contains the stream_index, buf/buf_size, - * dts/pts, ... - * @return < 0 on error, = 0 if OK, 1 if end of stream wanted - *) -function av_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet, which contains the stream_index, buf/buf_size, - * dts/pts, ... - * @return < 0 on error, = 0 if OK, 1 if end of stream wanted - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Interleave a packet per dts in an output media file. - * - * Packets with pkt->destruct == av_destruct_packet will be freed inside this - * function, so they cannot be used after it. Note that calling av_free_packet() - * on them is still safe. - * - * @param s media file handle - * @param out the interleaved packet will be output here - * @param pkt the input packet - * @param flush 1 if no further packets are available as input and all - * remaining packets should be output - * @return 1 if a packet was output, 0 if no packet could be output, - * < 0 if an error occurred - *) -function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; - pkt: PAVPacket; flush: cint): cint; - cdecl; external av__format; - -(** - * Add packet to AVFormatContext->packet_buffer list, determining its - * interleaved position using compare() function argument. - * - * This function is not part of the public API and should only be called - * by muxers using their own interleave function. - *) -{ -procedure ff_interleave_add_packet(s: PAVFormatContext; - pkt: PAVPacket; - compare: function(para1: PAVFormatContext; - para2: PAVPacket; - para3: PAVPacket): cint); - cdecl; external av__format; -} - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to av_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -procedure dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Parse width and height out of string str. - * @deprecated Use av_parse_video_frame_size instead. - *) -function parse_image_size(width_ptr: PCint; height_ptr: PCint; - str: PAnsiChar): cint; - cdecl; external av__format; deprecated; - -(** - * Convert framerate from a string to a fraction. - * @deprecated Use av_parse_video_frame_rate instead. - *) -function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; - arg: PByteArray): cint; - cdecl; external av__format; deprecated; - -(** - * Parse datestr and return a corresponding number of microseconds. - * @param datestr String representing a date or a duration. - * - If a date the syntax is: - * @code - * now|{[{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z|z]} - * @endcode - * If the value is "now" it takes the current time. - * Time is localtime unless Z is appended, in which case it is - * interpreted as UTC. - * If the year-month-day part is not specified it takes the current - * year-month-day. - * Returns the number of microseconds since 1st of January, 1970 up to - * the time of the parsed date or INT64_MIN if datestr cannot be - * successfully parsed. - * - If a duration the syntax is: - * @code - * [-]HH[:MM[:SS[.m...]]] - * [-]S+[.m...] - * @endcode - * @return the number of microseconds contained in a time interval - * with the specified duration or INT64_MIN if datestr cannot be - * successfully parsed. - * @param duration Flag which tells how to interpret datestr, if - * not zero datestr is interpreted as a duration, otherwise as a - * date. - *) -function parse_date(datestr: PAnsiChar; duration: cint): cint64; - cdecl; external av__format; - -(** - * Get the current time in microseconds. - *) -function av_gettime(): cint64; - cdecl; external av__format; - -(* ffm-specific for ffserver *) -const - FFM_PACKET_SIZE = 4096; - -function ffm_read_write_index(fd: cint): cint64; - cdecl; external av__format; - -function ffm_write_write_index(fd: cint; pos: cint64): cint; - cdecl; external av__format; - -procedure ffm_set_write_index(s: PAVFormatContext; pos: cint64; file_size: cint64); - cdecl; external av__format; - -(** - * Attempt to find a specific tag in a URL. - * - * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done. - * Return 1 if found. - *) -function find_info_tag(arg: PAnsiChar; arg_size: cint; tag1: PAnsiChar; info: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buff buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PByteArray; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.7/avio.pas b/src/lib/ffmpeg-0.7/avio.pas deleted file mode 100644 index 25846a4e..00000000 --- a/src/lib/ffmpeg-0.7/avio.pas +++ /dev/null @@ -1,911 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 52.110.0 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_MAX_STREAMS = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA2 = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - FF_API_URL_RESETBUF = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_REGISTER_PROTOCOL = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_GUESS_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_UDP_GET_FILE = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_URL_SPLIT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_ALLOC_FORMAT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARSE_FRAME_PARAM = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_READ_SEEK = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_LAVF_UNUSED = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARAMETERS_CODEC_ID = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_FIRST_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_SYMVER = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_INDEX_BUILT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_DUMP_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PARSE_DATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FIND_INFO_TAG = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_GUESS_IMG2_CODEC = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_SDP_CREATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FLAG_RTP_HINT = (LIBAVFORMAT_VERSION_MAJOR < 54); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - URL_PROTOCOL_FLAG_NESTED_SCHEME = 1; (*< The protocol name can be the first part of a nested protocol scheme *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - -type -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) -{$IF FF_API_OLD_AVIO} - is_streamed: cint; { deprecated } -{$IFEND} - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - end; - -(* unbuffered I/O *) - -{$IF FF_API_OLD_AVIO} - PURLProtocol = ^TURLProtocol; - -(** - * URL Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(URLContext) must not be used outside libav*. - * @deprecated This struct will be made private - *) - PPURLContext = ^PURLContext; - PURLContext = ^TURLContext; - TURLContext = record -{$IF FF_API_URL_CLASS} - av_class: {const} PAVClass; ///< information for av_log(). Set by url_open(). -{$IFEND} - prot: PURLProtocol; - flags: cint; - is_streamed: cint; (**< true if streamed (no seek possible), default = false *) - max_packet_size: cint; (**< if non zero, the stream is packetized with this max packet size *) - priv_data: pointer; - filename: PAnsiChar; (**< specified URL *) - is_connected: cint; - end; - -(** - * @deprecated This struct is to be made private. Use the higher-level - * AVIOContext-based API instead. - *) - TURLProtocol = record - name: PAnsiChar; - url_open: function (h: PURLContext; url: {const} PAnsiChar; flags: cint): cint; cdecl; - url_read: function (h: PURLContext; buf: PByteArray; size: cint): cint; cdecl; - url_write: function (h: PURLContext; {const} buf: PByteArray; size: cint): cint; cdecl; - url_seek: function (h: PURLContext; pos: cint64; whence: cint): cint64; cdecl; - url_close: function (h: PURLContext): cint; cdecl; - next: PURLProtocol; - url_read_pause: function (h: PURLContext; pause: cint): cint; cdecl; - url_read_seek: function (h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - url_get_file_handle: function (h: PURLContext): cint; cdecl; - priv_data_size: cint; - {const} priv_data_class: PAVClass; - flags: cint; - url_check: function (h: PURLContext; mask: cint): cint; cdecl; - end; - - PURLPollEntry = ^TURLPollEntry; - TURLPollEntry = record - handle: PURLContext; - events: cint; - revents: cint; - end; - -(* not implemented *) -function url_poll(poll_table: PURLPollEntry; n: cint; timeout: cint): cint; - cdecl; external av__format; deprecated; - -const -(** - * @defgroup open_modes URL open modes - * The flags argument to url_open and cosins must be one of the following - * constants, optionally ORed with other flags. - * @ - *) - URL_RDONLY = 0; (**< read-only *) - URL_WRONLY = 1; (**< write-only *) - URL_RDWR = 2; (**< read-write *) -(** - * @ - *) - -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - URL_FLAG_NONBLOCK = 4; - -type - PURLInterruptCB = ^TURLInterruptCB; - TURLInterruptCB = function (): cint; cdecl; - -{ -var - url_interrupt_cb: PURLInterruptCB; cvar; external: av__format; -} - -(** - * @defgroup old_url_funcs Old url_* functions - * @eprecated. Use the buffered API based on AVIOContext instead. - * @ - *) -function url_open_protocol(puc: PPURLContext; up: PURLProtocol; - url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_alloc(h: PPURLContext; {const} url: PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_connect(h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_open(h: PPointer; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_read (h: PURLContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_read_complete (h: PURLContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_write (h: PURLContext; {const} buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_seek (h: PURLContext; pos: cint64; whence: cint): cint64; - cdecl; external av__format; deprecated; -function url_close (h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_filesize (h: PURLContext): cint64; - cdecl; external av__format; deprecated; -function url_get_file_handle(h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_get_max_packet_size(h: PURLContext): cint; - cdecl; external av__format; deprecated; -procedure url_get_filename(h: PURLContext; buf: PAnsiChar; buf_size: cint); - cdecl; external av__format; deprecated; -function av_url_read_pause(h: PURLContext; pause: cint): cint; - cdecl; external av__format; deprecated; -function av_url_read_seek(h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; deprecated; -procedure url_set_interrupt_cb (interrupt_cb: TURLInterruptCB); - cdecl; external av__format; deprecated; - -(** - * returns the next registered protocol after the given protocol (the first if - * NULL is given), or NULL if protocol is the last one. - *) -function av_protocol_next(p: PURLProtocol): PURLProtocol; - cdecl; external av__format; - -(** - * Register the URLProtocol protocol. - * - * @param size the size of the URLProtocol struct referenced - *) -function av_register_protocol2(protocol: PURLProtocol; size: cint): cint; - cdecl; external av__format; deprecated; -(** - * @ - *) - -type - PByteIOContext = PAVIOContext; { deprecated } - TByteIOContext = TAVIOContext; { deprecated } - -function init_put_byte(s: PAVIOContext; - buffer: PByteArray; - buffer_size: cint; write_flag: cint; - opaque: pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): cint; - cdecl; external av__format; deprecated; -function av_alloc_put_byte( - buffer: PByteArray; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; deprecated; - -(** - * @defgroup old_avio_funcs Old put_/get_*() functions - * The following functions are deprecated. Use the "avio_"-prefixed functions instead. - * @ - *) -function get_buffer(s: PAVIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function get_partial_buffer(s: PAVIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function get_byte(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function get_le16(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le24(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le32(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le64(s: PAVIOContext): cuint64; - cdecl; external av__format; deprecated; -function get_be16(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be24(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be32(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be64(s: PAVIOContext): cuint64; - cdecl; external av__format; deprecated; - -procedure put_byte(s: PAVIOContext; b: cint); - cdecl; external av__format; deprecated; -procedure put_nbyte(s: PAVIOContext; b: cint; count: cint); - cdecl; external av__format; deprecated; -procedure put_buffer (s: PAVIOContext; buf: {const} PByteArray; size: cint); - cdecl; external av__format; deprecated; -procedure put_le64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; deprecated; -procedure put_be64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; deprecated; -procedure put_le32(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be32(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_le24(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be24(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_le16(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be16(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_tag(s: PAVIOContext; tag: {const} PAnsiChar); - cdecl; external av__format; deprecated; -(** - * @ - *) - -function av_url_read_fpause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; deprecated; -function av_url_read_fseek(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; deprecated; - -(** - * @defgroup old_url_f_funcs Old url_f* functions - * @deprecated, use the "avio_"-prefixed functions instead. - * @ - *) -function url_fopen(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_fclose(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_fseek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; deprecated; -function url_fskip(s: PAVIOContext; offset: cint64): cint; - cdecl; external av__format; deprecated; -function url_ftell(s: PAVIOContext): cint64; - cdecl; external av__format; deprecated; -function url_fsize(s: PAVIOContext): cint64; - cdecl; external av__format; deprecated; -const - URL_EOF = -1; -(** @note return URL_EOF (-1) if EOF *) -function url_fgetc(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_setbufsize (s: PAVIOContext; buf_size: cint): cint; - cdecl; external av__format; deprecated; -function url_fprintf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; deprecated; -procedure put_flush_packet (s: PAVIOContext); - cdecl; external av__format; deprecated; -function url_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_open_dyn_packet_buf(var s: PAVIOContext; max_packet_size: cint): cint; - cdecl; external av__format; deprecated; -function url_close_dyn_buf(s: PAVIOContext; pbuffer:PPointer): cint; - cdecl; external av__format; deprecated; -function url_fdopen (var s: PAVIOContext; h: PURLContext): cint; - cdecl; external av__format; deprecated; -(** - * @ - *) - -function url_ferror(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -function udp_set_remote_url(h: PURLContext; uri: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; -function udp_get_local_port(h: PURLContext): cint; - cdecl; external av__format; deprecated; - -type - Tupdate_checksum = function (c: culong; p: Pcuint8; len: cuint): culong; cdecl; -procedure init_checksum(s: PAVIOContext; - update_checksum: Tupdate_checksum; - checksum: culong); - cdecl; external av__format; deprecated; -function get_checksum(s: PAVIOContext): culong; - cdecl; external av__format; deprecated; -procedure put_strz(s: PAVIOContext; buf: {const} PAnsiChar); - cdecl; external av__format; deprecated; -(** @note unlike fgets, the EOL character is not returned and a whole - line is parsed. return NULL if first char read was EOF *) -function url_fgets(s: PAVIOContext; buf: PAnsiChar; buf_size: cint): PAnsiChar; - cdecl; external av__format; deprecated; -(** - * @deprecated use avio_get_str instead - *) -function get_strz(s: PAVIOContext; buf: PAnsiChar; maxlen: cint): PAnsiChar; - cdecl; external av__format; deprecated; -(** - * @deprecated Use AVIOContext.seekable field directly. - *) -function url_is_streamed(s: PAVIOContext): cint; {$IFDEF HasInline}inline;{$ENDIF} deprecated; - -function url_fileno(s: PAVIOContext): PURLContext; - cdecl; external av__format; deprecated; - -(** - * @deprecated use AVIOContext.max_packet_size directly. - *) -function url_fget_max_packet_size (s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -function url_open_buf(var s: PAVIOContext; buf: PAnsiChar; buf_size: cint; flags: cint): cint; - cdecl; external av__format; deprecated; - -(** return the written or read size *) -function url_close_buf(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -(** - * Return a non-zero value if the resource indicated by url - * exists, 0 otherwise. - * @deprecated Use avio_check instead. - *) -function url_exist(url: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; -{$IFEND} // FF_API_OLD_AVIO - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - * - * @note This function is slightly broken until next major bump - * because of AVIO_RDONLY == 0. Don't use it until then. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * The callback is called in blocking functions to test regulary if - * asynchronous interruption is needed. AVERROR_EXIT is returned - * in this case by the interrupted function. 'NULL' means no interrupt - * callback is given. - *) -procedure avio_set_interrupt_cb(interrupt_cb: Pointer); - cdecl; external av__format; - -{$IF FF_API_REGISTER_PROTOCOL} -{ -var - first_protocol: PURLProtocol; cvar; external av__format; -} -{$IFEND} - -{$IF FF_API_REGISTER_PROTOCOL} -(** - * @deprecated Use av_register_protocol() instead. - *) -function register_protocol(protocol: PURLProtocol): cint; - cdecl; external av__format; deprecated; - -(** - * @deprecated Use av_register_protocol2() instead. - *) -function av_register_protocol(protocol: PURLProtocol): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const - (** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - - (** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonble - * means that can be extreemly slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @defgroup avio_read Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -{$IF FF_API_URL_RESETBUF} -(** Reset the buffer for reading or writing. - * @note Will drop any data currently in the buffer without transmitting it. - * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY - * to set up the buffer for writing. *) -function url_resetbuf(s: PAVIOContext; flags: cint): cint; - cdecl; external av__format; -{$IFEND} - -(** - * @defgroup open_modes URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @ - *) - -const -{$IF LIBAVFORMAT_VERSION_MAJOR < 53} - AVIO_RDONLY = 0; (**< read-only *) - AVIO_WRONLY = 1; (**< write-only *) - AVIO_RDWR = 2; (**< read-write *) -{$ELSE} - AVIO_RDONLY = 1; (**< read-only *) - AVIO_WRONLY = 2; (**< write-only *) - AVIO_RDWR = 4; (**< read-write *) -{$IFEND} -(** - * @ - *) - -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) -const -{$IF LIBAVFORMAT_VERSION_MAJOR < 53} - AVIO_FLAG_NONBLOCK = 4; -{$ELSE} - AVIO_FLAG_NONBLOCK = 8; -{$IFEND} - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * @return 0 on success, an AVERROR < 0 on error. - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -{$IF FF_API_UDP_GET_FILE} -function udp_get_file_handle(h: PURLContext): cint; - cdecl; external av__format; -{$IFEND} - -(** - * Iterate through names of available protocols. - * @note it is recommanded to use av_protocol_next() instead of this - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -{$IF (LIBAVFORMAT_VERSION_MAJOR < 54)} -function url_is_streamed(s: PAVIOContext): cint; -begin - Result := s^.is_streamed; -end; -{$IFEND} - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - -end. diff --git a/src/lib/ffmpeg-0.7/avutil.pas b/src/lib/ffmpeg-0.7/avutil.pas deleted file mode 100644 index 8746d545..00000000 --- a/src/lib/ffmpeg-0.7/avutil.pas +++ /dev/null @@ -1,198 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 50.43.0 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 50; - LIBAVUTIL_MAX_VERSION_MINOR = 43; - LIBAVUTIL_MAX_VERSION_RELEASE = 0; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 50; - LIBAVUTIL_MIN_VERSION_MINOR = 43; - LIBAVUTIL_MIN_VERSION_RELEASE = 0; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, - AVMEDIA_TYPE_NB - ); - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1< - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 50.43.0 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; - AV_DICT_DONT_STRDUP_VAL = 8; - AV_DICT_DONT_OVERWRITE = 16; ///< Don't overwrite existing entries. - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.7/libavutil/error.pas b/src/lib/ffmpeg-0.7/libavutil/error.pas deleted file mode 100644 index 382f40bf..00000000 --- a/src/lib/ffmpeg-0.7/libavutil/error.pas +++ /dev/null @@ -1,124 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 50.43.0 - * - *) - -(** - * @file - * error code definitions - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - AVERROR_INVALIDDATA = AVERROR_SIGN * EINVAL; (**< Invalid data found when processing input *) - AVERROR_IO = AVERROR_SIGN * EIO; (**< I/O error *) - AVERROR_NOENT = AVERROR_SIGN * ENOENT; (**< No such file or directory. *) - AVERROR_NOFMT = AVERROR_SIGN * EILSEQ; (**< unknown format *) - AVERROR_NOMEM = AVERROR_SIGN * ENOMEM; (**< not enough memory *) - AVERROR_NOTSUPP = AVERROR_SIGN * ENOSYS; (**< Operation not supported. *) - AVERROR_NUMEXPECTED = AVERROR_SIGN * EDOM; (**< Number syntax expected in filename. *) - AVERROR_UNKNOWN = AVERROR_SIGN * EINVAL; (**< Unknown error *) - - AVERROR_EOF = AVERROR_SIGN * EPIPE; (**< End of file. *) - - // Note: function calls as constant-initializers are invalid - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in Libav, patches welcome - - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) - -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.7/libavutil/log.pas b/src/lib/ffmpeg-0.7/libavutil/log.pas deleted file mode 100644 index 38c4c6ad..00000000 --- a/src/lib/ffmpeg-0.7/libavutil/log.pas +++ /dev/null @@ -1,188 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 50.43.0 - * - *) - -(** - * @file - * log - *) - -type -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for loging is stored. - * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such - * parent context. And a av_log() implementation could then display the parent context - * can be NULL of course - *) - parent_log_context_offset: cint; - - (** - * A function for extended searching, e.g. in possible - * children objects. - *) - opt_find: function(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; cdecl; - end; - - -const - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -#ifdef __GNUC__ -void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); -#else -void av_log(void*, int level, const char *fmt, ...); -#endif -**} - -type - va_list = pointer; - -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; dummy: va_list); - cdecl; external av__util; -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -function av_default_item_name (ctx: pointer): PAnsiChar; - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.7/libavutil/mathematics.pas b/src/lib/ffmpeg-0.7/libavutil/mathematics.pas deleted file mode 100644 index 85c7a3ac..00000000 --- a/src/lib/ffmpeg-0.7/libavutil/mathematics.pas +++ /dev/null @@ -1,98 +0,0 @@ -(* - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 50.43.0 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = 0.0/0.0; - INFINITY = 1.0/0.0; - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5 ///< Round to nearest and halfway cases away from zero. - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.7/libavutil/mem.pas b/src/lib/ffmpeg-0.7/libavutil/mem.pas deleted file mode 100644 index b68dd310..00000000 --- a/src/lib/ffmpeg-0.7/libavutil/mem.pas +++ /dev/null @@ -1,111 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 50.43.0 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -type - FF_INTERNAL_MEM_TYPE = cuint; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: FF_INTERNAL_MEM_TYPE): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: FF_INTERNAL_MEM_TYPE): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: FF_INTERNAL_MEM_TYPE): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * @param tab_ptr Pointer to the array. - * @param nb_ptr Pointer to the number of elements in the array. - * @param elem Element to be added. - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: PCint; elem: pointer); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.7/libavutil/opt.pas b/src/lib/ffmpeg-0.7/libavutil/opt.pas deleted file mode 100644 index cea97763..00000000 --- a/src/lib/ffmpeg-0.7/libavutil/opt.pas +++ /dev/null @@ -1,259 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 50.43.0 - * - *) - -type - TAVOptionType = ( - FF_OPT_TYPE_FLAGS, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (dbl: cdouble); - 1: (str: PAnsiChar); - (* TODO those are unused now *) - 2: (i64: cint64); - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR(ENOENT) if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; -function av_set_q(obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; -function av_set_int(obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; -function av_get_double(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.7/libavutil/pixfmt.pas b/src/lib/ffmpeg-0.7/libavutil/pixfmt.pas deleted file mode 100644 index d47ef354..00000000 --- a/src/lib/ffmpeg-0.7/libavutil/pixfmt.pas +++ /dev/null @@ -1,207 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 50.43.0 - * - *) - -(** - * @file - * Pixel format - *) - -type -(** - * Pixel format. Notes: - * - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * Note, make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - PIX_FMT_NONE= -1, - PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - PIX_FMT_GRAY8, ///< Y , 8bpp - PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - PIX_FMT_XVMC_MPEG2_IDCT, - PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus - //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored seperately - //is better - PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - - PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - PIX_FMT_Y400A = PIX_FMT_GRAY8A; - -{$ifdef WORDS_BIGENDIAN} - PIX_FMT_RGB32 = PIX_FMT_ARGB; - PIX_FMT_RGB32_1 = PIX_FMT_RGBA; - PIX_FMT_BGR32 = PIX_FMT_ABGR; - PIX_FMT_BGR32_1 = PIX_FMT_BGRA; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16BE; - PIX_FMT_RGB48 = PIX_FMT_RGB48BE; - PIX_FMT_RGB565 = PIX_FMT_RGB565BE; - PIX_FMT_RGB555 = PIX_FMT_RGB555BE; - PIX_FMT_RGB444 = PIX_FMT_RGB444BE; - PIX_FMT_BGR48 = PIX_FMT_BGR48BE; - PIX_FMT_BGR565 = PIX_FMT_BGR565BE; - PIX_FMT_BGR555 = PIX_FMT_BGR555BE; - PIX_FMT_BGR444 = PIX_FMT_BGR444BE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9BE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9BE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10BE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10BE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10BE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16BE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16BE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16BE; -{$else} - PIX_FMT_RGB32 = PIX_FMT_BGRA; - PIX_FMT_RGB32_1 = PIX_FMT_ABGR; - PIX_FMT_BGR32 = PIX_FMT_RGBA; - PIX_FMT_BGR32_1 = PIX_FMT_ARGB; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16LE; - PIX_FMT_RGB48 = PIX_FMT_RGB48LE; - PIX_FMT_RGB565 = PIX_FMT_RGB565LE; - PIX_FMT_RGB555 = PIX_FMT_RGB555LE; - PIX_FMT_RGB444 = PIX_FMT_RGB444LE; - PIX_FMT_BGR48 = PIX_FMT_BGR48LE; - PIX_FMT_BGR565 = PIX_FMT_BGR565LE; - PIX_FMT_BGR555 = PIX_FMT_BGR555LE; - PIX_FMT_BGR444 = PIX_FMT_BGR444LE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9LE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9LE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10LE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10LE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10LE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16LE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16LE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16LE; -{$ENDIF} diff --git a/src/lib/ffmpeg-0.7/libavutil/samplefmt.pas b/src/lib/ffmpeg-0.7/libavutil/samplefmt.pas deleted file mode 100644 index 3335fa2d..00000000 --- a/src/lib/ffmpeg-0.7/libavutil/samplefmt.pas +++ /dev/null @@ -1,138 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 50.43.0 - * - *) - -type -(** - * all in native-endian format - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; deprecated; - cdecl; external av__util; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Fill channel data pointers and linesizes for samples with sample - * format sample_fmt. - * - * The pointers array is filled with the pointers to the samples data: - * for planar, set the start point of each plane's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The linesize array is filled with the aligned size of each samples - * plane, that is linesize[i] will contain the linesize of the plane i, - * and will be zero for all the unused planes. All linesize values are - * equal. - * - * @param pointers array to be filled with the pointer for each plane, may be NULL - * @param linesizes array to be filled with the linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_samples the number of samples in a single channel - * @param planar 1 if the samples layout is planar, 0 if it is packed - * @param nb_channels the number of channels - * @return the total size of the buffer, a negative - * error code in case of failure - *) -function av_samples_fill_arrays(pointers: OctArrayOfPcuint8; linesizes: OctArrayOfcint; - buf: Pcuint8; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; planar: cint; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and - * fill pointers and linesizes accordingly. - * The allocated samples buffer has to be freed by using - * av_freep(&pointers[0]). - * - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param planar 1 if the samples layout is planar, 0 if packed, - * @param align the value to use for buffer size alignment - * @return the size in bytes required for the samples buffer, a negative - * error code in case of failure - * @see av_samples_fill_arrays() - *) -function av_samples_alloc(pointers: OctArrayOfPcuint8; linesizes: OctArrayOfcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; planar: cint; - align: cint): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.7/rational.pas b/src/lib/ffmpeg-0.7/rational.pas deleted file mode 100644 index 371a6fd7..00000000 --- a/src/lib/ffmpeg-0.7/rational.pas +++ /dev/null @@ -1,190 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 50.43.0 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -type - (* - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b and -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) >> 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num >> 31) - (b.num >> 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -end. diff --git a/src/lib/ffmpeg-0.7/swscale.pas b/src/lib/ffmpeg-0.7/swscale.pas deleted file mode 100644 index 688be6dd..00000000 --- a/src/lib/ffmpeg-0.7/swscale.pas +++ /dev/null @@ -1,465 +0,0 @@ -(* - * Copyright (C) 2001-2003 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 0.14.1 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 0; - LIBSWSCALE_MAX_VERSION_MINOR = 11; - LIBSWSCALE_MAX_VERSION_RELEASE = 0; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} -// {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -const -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(** - * Returns the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Returns the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Returns the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$if FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; -{$ifend} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Returns a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Returns a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Returns a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocates an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initializes the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Frees the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$if FF_API_SWS_GETCONTEXT} -(** - * Allocates and returns a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$ifend} - -(** - * Scales the image slice in srcSlice and puts the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param context the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(context: PSwsContext; {const} srcSlice: PPCuint8Array; {const} srcStride: PCintArray; - srcSliceY: cint; srcSliceH: cint; {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -{$if LIBSWSCALE_VERSION_MAJOR < 1} -// deprecated. Use sws_scale() instead. -function sws_scale_ordered(context: PSwsContext; {const} src: PPCuint8Array; - srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - dst: PPCuint8Array; dstStride: PCintArray): cint; - cdecl; external sw__scale; deprecated; -{$ifend} - -(** - * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] - * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235 - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocates and returns an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Returns a normalized Gaussian curve used to filter stuff - * quality=3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocates and returns a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocates and returns a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scales all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scales all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocates and returns a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -{$if LIBSWSCALE_VERSION_MAJOR < 1} -(** - * @deprecated Use sws_printVec2() instead. - *) -procedure sws_printVec(a: PSwsVector); - cdecl; external sw__scale; deprecated; -{$ifend} - -(** - * Prints with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Checks if context can be reused, otherwise reallocates a new - * one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Converts an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: clong; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Converts an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: clong; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.7/test.h b/src/lib/ffmpeg-0.7/test.h deleted file mode 100644 index 6ea704f0..00000000 --- a/src/lib/ffmpeg-0.7/test.h +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include -#include "attributes.h" - -typedef struct AVRational{ - int num; ///< numerator - int den; ///< denominator -} AVRational; - -int av_cmp_q(AVRational a, AVRational b){ - int tmp; - - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} diff --git a/src/lib/ffmpeg-0.7/test.pp b/src/lib/ffmpeg-0.7/test.pp deleted file mode 100644 index 93ed8b46..00000000 --- a/src/lib/ffmpeg-0.7/test.pp +++ /dev/null @@ -1,48 +0,0 @@ - -unit test; -interface - -{ - Automatically converted by H2Pas 1.0.0 from test.h - The following command line parameters were used: - test.h -} - -{$IFDEF FPC} -{$PACKRECORDS C} -{$ENDIF} - - -{$include } -{$include } -{$include "attributes.h"} - {/< numerator } - {/< denominator } - - type - AVRational = record - num : longint; - den : longint; - end; -(* error - int tmp; - in declarator_list *) -(* error - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - in declarator_list *) -(* error - else if(b.den && a.den) return 0; - in declarator_list *) -(* error - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - in declarator_list *) -(* error - else return INT_MIN; - in declarator_list *) -(* error -} - -implementation - - -end. diff --git a/src/lib/ffmpeg-0.8/How to update the ffmpeg files.txt b/src/lib/ffmpeg-0.8/How to update the ffmpeg files.txt deleted file mode 100644 index 976d0eff..00000000 --- a/src/lib/ffmpeg-0.8/How to update the ffmpeg files.txt +++ /dev/null @@ -1,12 +0,0 @@ -how to update the ffmpeg files: - -1) rational.pas - error.pas -2) mathematics.pas - dict.pas - opt.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-0.8/ToDo.txt b/src/lib/ffmpeg-0.8/ToDo.txt deleted file mode 100644 index 2cd843f1..00000000 --- a/src/lib/ffmpeg-0.8/ToDo.txt +++ /dev/null @@ -1,7 +0,0 @@ -1) avutil.pas -inline function av_x_if_null - - avcodec.pas - avio.pas - swscale.pas - avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-0.8/avcodec.pas b/src/lib/ffmpeg-0.8/avcodec.pas deleted file mode 100644 index 5b72d222..00000000 --- a/src/lib/ffmpeg-0.8/avcodec.pas +++ /dev/null @@ -1,4609 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 53.7.0 - 53.35.0 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 53; - LIBAVCODEC_MAX_VERSION_MINOR = 35; - LIBAVCODEC_MAX_VERSION_RELEASE = 0; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 53; - LIBAVCODEC_MIN_VERSION_MINOR = 7; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const -{$ifndef FF_API_PALETTE_CONTROL} - FF_API_PALETTE_CONTROL = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_MM_FLAGS} - FF_API_MM_FLAGS = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_OPT_SHOW} - FF_API_OPT_SHOW = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_AUDIO_OLD} - FF_API_AUDIO_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_VIDEO_OLD} - FF_API_VIDEO_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_SUBTITLE_OLD} - FF_API_SUBTITLE_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_USE_LPC} - FF_API_USE_LPC = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_SET_STRING_OLD} - FF_API_SET_STRING_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_INOFFICIAL} - FF_API_INOFFICIAL = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_OLD_SAMPLE_FMT} - FF_API_OLD_SAMPLE_FMT = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_OLD_AUDIOCONVERT} - FF_API_OLD_AUDIOCONVERT = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_HURRY_UP} - FF_API_HURRY_UP = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_RATE_EMU} - FF_API_RATE_EMU = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_MB_Q} - FF_API_MB_Q = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_ANTIALIAS_ALGO} - FF_API_ANTIALIAS_ALGO = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_REQUEST_CHANNELS} - FF_API_REQUEST_CHANNELS = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_OPT_H} - FF_API_OPT_H = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_THREAD_INIT} - FF_API_THREAD_INIT = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_OLD_FF_PICT_TYPES} - FF_API_OLD_FF_PICT_TYPES = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_FLAC_GLOBAL_OPTS} - FF_API_FLAC_GLOBAL_OPTS = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_GET_PIX_FMT_NAME} - FF_API_GET_PIX_FMT_NAME = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -{$IF FF_API_OLD_AUDIOCONVERT} - {$I libavcodec/audioconvert.pas} -{$IFEND} - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. it is as close as possible to similar codecs. - *) -type - TCodecID = ( - CODEC_ID_NONE, - - //* video codecs */ - CODEC_ID_MPEG1VIDEO, - CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - CODEC_ID_MPEG2VIDEO_XVMC, - CODEC_ID_H261, - CODEC_ID_H263, - CODEC_ID_RV10, - CODEC_ID_RV20, - CODEC_ID_MJPEG, - CODEC_ID_MJPEGB, - CODEC_ID_LJPEG, - CODEC_ID_SP5X, - CODEC_ID_JPEGLS, - CODEC_ID_MPEG4, - CODEC_ID_RAWVIDEO, - CODEC_ID_MSMPEG4V1, - CODEC_ID_MSMPEG4V2, - CODEC_ID_MSMPEG4V3, - CODEC_ID_WMV1, - CODEC_ID_WMV2, - CODEC_ID_H263P, - CODEC_ID_H263I, - CODEC_ID_FLV1, - CODEC_ID_SVQ1, - CODEC_ID_SVQ3, - CODEC_ID_DVVIDEO, - CODEC_ID_HUFFYUV, - CODEC_ID_CYUV, - CODEC_ID_H264, - CODEC_ID_INDEO3, - CODEC_ID_VP3, - CODEC_ID_THEORA, - CODEC_ID_ASV1, - CODEC_ID_ASV2, - CODEC_ID_FFV1, - CODEC_ID_4XM, - CODEC_ID_VCR1, - CODEC_ID_CLJR, - CODEC_ID_MDEC, - CODEC_ID_ROQ, - CODEC_ID_INTERPLAY_VIDEO, - CODEC_ID_XAN_WC3, - CODEC_ID_XAN_WC4, - CODEC_ID_RPZA, - CODEC_ID_CINEPAK, - CODEC_ID_WS_VQA, - CODEC_ID_MSRLE, - CODEC_ID_MSVIDEO1, - CODEC_ID_IDCIN, - CODEC_ID_8BPS, - CODEC_ID_SMC, - CODEC_ID_FLIC, - CODEC_ID_TRUEMOTION1, - CODEC_ID_VMDVIDEO, - CODEC_ID_MSZH, - CODEC_ID_ZLIB, - CODEC_ID_QTRLE, - CODEC_ID_SNOW, - CODEC_ID_TSCC, - CODEC_ID_ULTI, - CODEC_ID_QDRAW, - CODEC_ID_VIXL, - CODEC_ID_QPEG, - CODEC_ID_PNG, - CODEC_ID_PPM, - CODEC_ID_PBM, - CODEC_ID_PGM, - CODEC_ID_PGMYUV, - CODEC_ID_PAM, - CODEC_ID_FFVHUFF, - CODEC_ID_RV30, - CODEC_ID_RV40, - CODEC_ID_VC1, - CODEC_ID_WMV3, - CODEC_ID_LOCO, - CODEC_ID_WNV1, - CODEC_ID_AASC, - CODEC_ID_INDEO2, - CODEC_ID_FRAPS, - CODEC_ID_TRUEMOTION2, - CODEC_ID_BMP, - CODEC_ID_CSCD, - CODEC_ID_MMVIDEO, - CODEC_ID_ZMBV, - CODEC_ID_AVS, - CODEC_ID_SMACKVIDEO, - CODEC_ID_NUV, - CODEC_ID_KMVC, - CODEC_ID_FLASHSV, - CODEC_ID_CAVS, - CODEC_ID_JPEG2000, - CODEC_ID_VMNC, - CODEC_ID_VP5, - CODEC_ID_VP6, - CODEC_ID_VP6F, - CODEC_ID_TARGA, - CODEC_ID_DSICINVIDEO, - CODEC_ID_TIERTEXSEQVIDEO, - CODEC_ID_TIFF, - CODEC_ID_GIF, - CODEC_ID_FFH264, - CODEC_ID_DXA, - CODEC_ID_DNXHD, - CODEC_ID_THP, - CODEC_ID_SGI, - CODEC_ID_C93, - CODEC_ID_BETHSOFTVID, - CODEC_ID_PTX, - CODEC_ID_TXD, - CODEC_ID_VP6A, - CODEC_ID_AMV, - CODEC_ID_VB, - CODEC_ID_PCX, - CODEC_ID_SUNRAST, - CODEC_ID_INDEO4, - CODEC_ID_INDEO5, - CODEC_ID_MIMIC, - CODEC_ID_RL2, - CODEC_ID_8SVX_EXP, - CODEC_ID_8SVX_FIB, - CODEC_ID_ESCAPE124, - CODEC_ID_DIRAC, - CODEC_ID_BFI, - CODEC_ID_CMV, - CODEC_ID_MOTIONPIXELS, - CODEC_ID_TGV, - CODEC_ID_TGQ, - CODEC_ID_TQI, - CODEC_ID_AURA, - CODEC_ID_AURA2, - CODEC_ID_V210X, - CODEC_ID_TMV, - CODEC_ID_V210, - CODEC_ID_DPX, - CODEC_ID_MAD, - CODEC_ID_FRWU, - CODEC_ID_FLASHSV2, - CODEC_ID_CDGRAPHICS, - CODEC_ID_R210, - CODEC_ID_ANM, - CODEC_ID_BINKVIDEO, - CODEC_ID_IFF_ILBM, - CODEC_ID_IFF_BYTERUN1, - CODEC_ID_KGV1, - CODEC_ID_YOP, - CODEC_ID_VP8, - CODEC_ID_PICTOR, - CODEC_ID_ANSI, - CODEC_ID_A64_MULTI, - CODEC_ID_A64_MULTI5, - CODEC_ID_R10K, - CODEC_ID_MXPEG, - CODEC_ID_LAGARITH, - CODEC_ID_PRORES, - CODEC_ID_JV, - CODEC_ID_DFA, - CODEC_ID_8SVX_RAW, - - //* various PCM "codecs" */ - CODEC_ID_PCM_S16LE= $10000, - CODEC_ID_PCM_S16BE, - CODEC_ID_PCM_U16LE, - CODEC_ID_PCM_U16BE, - CODEC_ID_PCM_S8, - CODEC_ID_PCM_U8, - CODEC_ID_PCM_MULAW, - CODEC_ID_PCM_ALAW, - CODEC_ID_PCM_S32LE, - CODEC_ID_PCM_S32BE, - CODEC_ID_PCM_U32LE, - CODEC_ID_PCM_U32BE, - CODEC_ID_PCM_S24LE, - CODEC_ID_PCM_S24BE, - CODEC_ID_PCM_U24LE, - CODEC_ID_PCM_U24BE, - CODEC_ID_PCM_S24DAUD, - CODEC_ID_PCM_ZORK, - CODEC_ID_PCM_S16LE_PLANAR, - CODEC_ID_PCM_DVD, - CODEC_ID_PCM_F32BE, - CODEC_ID_PCM_F32LE, - CODEC_ID_PCM_F64BE, - CODEC_ID_PCM_F64LE, - CODEC_ID_PCM_BLURAY, - CODEC_ID_PCM_LXF, - CODEC_ID_S302M, - - //* various ADPCM codecs */ - CODEC_ID_ADPCM_IMA_QT= $11000, - CODEC_ID_ADPCM_IMA_WAV, - CODEC_ID_ADPCM_IMA_DK3, - CODEC_ID_ADPCM_IMA_DK4, - CODEC_ID_ADPCM_IMA_WS, - CODEC_ID_ADPCM_IMA_SMJPEG, - CODEC_ID_ADPCM_MS, - CODEC_ID_ADPCM_4XM, - CODEC_ID_ADPCM_XA, - CODEC_ID_ADPCM_ADX, - CODEC_ID_ADPCM_EA, - CODEC_ID_ADPCM_G726, - CODEC_ID_ADPCM_CT, - CODEC_ID_ADPCM_SWF, - CODEC_ID_ADPCM_YAMAHA, - CODEC_ID_ADPCM_SBPRO_4, - CODEC_ID_ADPCM_SBPRO_3, - CODEC_ID_ADPCM_SBPRO_2, - CODEC_ID_ADPCM_THP, - CODEC_ID_ADPCM_IMA_AMV, - CODEC_ID_ADPCM_EA_R1, - CODEC_ID_ADPCM_EA_R3, - CODEC_ID_ADPCM_EA_R2, - CODEC_ID_ADPCM_IMA_EA_SEAD, - CODEC_ID_ADPCM_IMA_EA_EACS, - CODEC_ID_ADPCM_EA_XAS, - CODEC_ID_ADPCM_EA_MAXIS_XA, - CODEC_ID_ADPCM_IMA_ISS, - CODEC_ID_ADPCM_G722, - - //* AMR */ - CODEC_ID_AMR_NB= $12000, - CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - CODEC_ID_RA_144= $13000, - CODEC_ID_RA_288, - - //* various DPCM codecs */ - CODEC_ID_ROQ_DPCM= $14000, - CODEC_ID_INTERPLAY_DPCM, - CODEC_ID_XAN_DPCM, - CODEC_ID_SOL_DPCM, - - //* audio codecs */ - CODEC_ID_MP2= $15000, - CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - CODEC_ID_AAC, - CODEC_ID_AC3, - CODEC_ID_DTS, - CODEC_ID_VORBIS, - CODEC_ID_DVAUDIO, - CODEC_ID_WMAV1, - CODEC_ID_WMAV2, - CODEC_ID_MACE3, - CODEC_ID_MACE6, - CODEC_ID_VMDAUDIO, - CODEC_ID_SONIC, - CODEC_ID_SONIC_LS, - CODEC_ID_FLAC, - CODEC_ID_MP3ADU, - CODEC_ID_MP3ON4, - CODEC_ID_SHORTEN, - CODEC_ID_ALAC, - CODEC_ID_WESTWOOD_SND1, - CODEC_ID_GSM, ///< as in Berlin toast format - CODEC_ID_QDM2, - CODEC_ID_COOK, - CODEC_ID_TRUESPEECH, - CODEC_ID_TTA, - CODEC_ID_SMACKAUDIO, - CODEC_ID_QCELP, - CODEC_ID_WAVPACK, - CODEC_ID_DSICINAUDIO, - CODEC_ID_IMC, - CODEC_ID_MUSEPACK7, - CODEC_ID_MLP, - CODEC_ID_GSM_MS, { as found in WAV } - CODEC_ID_ATRAC3, - CODEC_ID_VOXWARE, - CODEC_ID_APE, - CODEC_ID_NELLYMOSER, - CODEC_ID_MUSEPACK8, - CODEC_ID_SPEEX, - CODEC_ID_WMAVOICE, - CODEC_ID_WMAPRO, - CODEC_ID_WMALOSSLESS, - CODEC_ID_ATRAC3P, - CODEC_ID_EAC3, - CODEC_ID_SIPR, - CODEC_ID_MP1, - CODEC_ID_TWINVQ, - CODEC_ID_TRUEHD, - CODEC_ID_MP4ALS, - CODEC_ID_ATRAC1, - CODEC_ID_BINKAUDIO_RDFT, - CODEC_ID_BINKAUDIO_DCT, - CODEC_ID_AAC_LATM, - CODEC_ID_QDMC, - CODEC_ID_CELT, - - //* subtitle codecs */ - CODEC_ID_DVD_SUBTITLE= $17000, - CODEC_ID_DVB_SUBTITLE, - CODEC_ID_TEXT, ///< raw UTF-8 text - CODEC_ID_XSUB, - CODEC_ID_SSA, - CODEC_ID_MOV_TEXT, - CODEC_ID_HDMV_PGS_SUBTITLE, - CODEC_ID_DVB_TELETEXT, - CODEC_ID_SRT, - CODEC_ID_MICRODVD, - - //* other specific kind of codecs (generally used for attachments) */ - CODEC_ID_TTF= $18000, - - CODEC_ID_PROBE= $19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it - - CODEC_ID_MPEG2TS= $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - CODEC_ID_FFMETADATA= $21000 ///< Dummy codec for streams containing only metadata information. - ); - -{$IF FF_API_OLD_SAMPLE_FMT} -type - TSampleFormat = TAVSampleFormat; - -const - SAMPLE_FMT_NONE = AV_SAMPLE_FMT_NONE; - SAMPLE_FMT_U8 = AV_SAMPLE_FMT_U8; - SAMPLE_FMT_S16 = AV_SAMPLE_FMT_S16; - SAMPLE_FMT_S32 = AV_SAMPLE_FMT_S32; - SAMPLE_FMT_FLT = AV_SAMPLE_FMT_FLT; - SAMPLE_FMT_DBL = AV_SAMPLE_FMT_DBL; - SAMPLE_FMT_NB = AV_SAMPLE_FMT_NB; -{$IFEND} - -{$IF FF_API_OLD_AUDIOCONVERT} - -const - {* Audio channel masks *} - CH_FRONT_LEFT = AV_CH_FRONT_LEFT; - CH_FRONT_RIGHT = AV_CH_FRONT_RIGHT; - CH_FRONT_CENTER = AV_CH_FRONT_CENTER; - CH_LOW_FREQUENCY = AV_CH_LOW_FREQUENCY; - CH_BACK_LEFT = AV_CH_BACK_LEFT; - CH_BACK_RIGHT = AV_CH_BACK_RIGHT; - CH_FRONT_LEFT_OF_CENTER = AV_CH_FRONT_LEFT_OF_CENTER; - CH_FRONT_RIGHT_OF_CENTER = AV_CH_FRONT_RIGHT_OF_CENTER; - CH_BACK_CENTER = AV_CH_BACK_CENTER; - CH_SIDE_LEFT = AV_CH_SIDE_LEFT; - CH_SIDE_RIGHT = AV_CH_SIDE_RIGHT; - CH_TOP_CENTER = AV_CH_TOP_CENTER; - CH_TOP_FRONT_LEFT = AV_CH_TOP_FRONT_LEFT; - CH_TOP_FRONT_CENTER = AV_CH_TOP_FRONT_CENTER; - CH_TOP_FRONT_RIGHT = AV_CH_TOP_FRONT_RIGHT; - CH_TOP_BACK_LEFT = AV_CH_TOP_BACK_LEFT; - CH_TOP_BACK_CENTER = AV_CH_TOP_BACK_CENTER; - CH_TOP_BACK_RIGHT = AV_CH_TOP_BACK_RIGHT; - CH_STEREO_LEFT = AV_CH_STEREO_LEFT; - CH_STEREO_RIGHT = AV_CH_STEREO_RIGHT; - -{** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *} - CH_LAYOUT_NATIVE = AV_CH_LAYOUT_NATIVE; - - {* Audio channel convenience macros *} - CH_LAYOUT_MONO = AV_CH_LAYOUT_MONO; - CH_LAYOUT_STEREO = AV_CH_LAYOUT_STEREO; - CH_LAYOUT_2_1 = AV_CH_LAYOUT_2_1; - CH_LAYOUT_SURROUND = AV_CH_LAYOUT_SURROUND; - CH_LAYOUT_4POINT0 = AV_CH_LAYOUT_4POINT0; - CH_LAYOUT_2_2 = AV_CH_LAYOUT_2_2; - CH_LAYOUT_QUAD = AV_CH_LAYOUT_QUAD; - CH_LAYOUT_5POINT0 = AV_CH_LAYOUT_5POINT0; - CH_LAYOUT_5POINT1 = AV_CH_LAYOUT_5POINT1; - CH_LAYOUT_5POINT0_BACK = AV_CH_LAYOUT_5POINT0_BACK; - CH_LAYOUT_5POINT1_BACK = AV_CH_LAYOUT_5POINT1_BACK; - CH_LAYOUT_7POINT0 = AV_CH_LAYOUT_7POINT0; - CH_LAYOUT_7POINT1 = AV_CH_LAYOUT_7POINT1; - CH_LAYOUT_7POINT1_WIDE = AV_CH_LAYOUT_7POINT1_WIDE; - CH_LAYOUT_STEREO_DOWNMIX = AV_CH_LAYOUT_STEREO_DOWNMIX; -{$IFEND} - -{* in bytes *} - AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio - -{** - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *} - FF_INPUT_BUFFER_PADDING_SIZE = 8; - -{** - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *} - FF_MIN_BUFFER_SIZE = 16384; - -type -{* - * motion estimation type. - *} - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - - TAVDiscard = ( - {* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *} - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - -{$IF FF_API_FLAC_GLOBAL_OPTS} -(** - * LPC analysis type - *) - TAVLPCType = ( - AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type - AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients - AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients - AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion - AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization - AV_LPC_TYPE_NB ///< Not part of ABI - ); -{$IFEND} - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -{* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*} - - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - CODEC_FLAG_PART = $0080; ///< Use data partitioning. - {** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *} - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_EXTERN_HUFF = $1000; ///< use external huffman table (for mjpeg) - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - {* Fx : Flag for h263+ extra options *} - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_H263P_UMV = $02000000; ///< Unlimited motion vector - CODEC_FLAG_CBP_RD = $04000000; ///< use rate distortion optimization for cbp - CODEC_FLAG_QP_RD = $08000000; ///< use rate distortion optimization for qp selectioon - CODEC_FLAG_H263P_AIV = $00000008; ///< H263 Alternative inter vlc - CODEC_FLAG_OBMC = $00000001; ///< OBMC - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_H263P_SLICE_STRUCT = $10000000; - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_SVCD_SCAN_OFFSET = $40000000; ///< will reserve space for SVCD scan offset user data - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_STRICT_GOP = $00000002; ///< strictly enforce GOP size - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_BPYRAMID = $00000010; ///< H.264 allow b-frames to be used as references - CODEC_FLAG2_WPRED = $00000020; ///< H.264 weighted biprediction for b-frames - CODEC_FLAG2_MIXED_REFS = $00000040; ///< H.264 multiple references per partition - CODEC_FLAG2_8X8DCT = $00000080; ///< H.264 high profile 8x8 transform - CODEC_FLAG2_FASTPSKIP = $00000100; ///< H.264 fast pskip - CODEC_FLAG2_AUD = $00000200; ///< H.264 access unit delimiters - CODEC_FLAG2_BRDO = $00000400; ///< b-frame rate-distortion optimization - CODEC_FLAG2_INTRA_VLC = $00000800; ///< use MPEG-2 intra VLC table - CODEC_FLAG2_MEMC_ONLY = $00001000; ///< only do ME/MC (I frames -> ref, P frame -> ME+MC) - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. - CODEC_FLAG2_SKIP_RD = $00004000; ///< RD optimal MB level residual skipping - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_NON_LINEAR_QUANT = $00010000; ///< Use MPEG-2 nonlinear quantizer. - CODEC_FLAG2_BIT_RESERVOIR = $00020000; ///< Use a bit reservoir when encoding if possible - CODEC_FLAG2_MBTREE = $00040000; ///< Use macroblock tree ratecontrol (x264 only) - CODEC_FLAG2_PSY = $00080000; ///< Use psycho visual optimizations. - CODEC_FLAG2_SSIM = $00100000; ///< Compute SSIM during encoding, error[] values are undefined. - CODEC_FLAG2_INTRA_REFRESH = $00200000; ///< Use periodic insertion of intra blocks instead of keyframes. - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - - (** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - (* if 'parse_only' field is true, then avcodec_parse_frame() can be used *) - CODEC_CAP_PARSE_ONLY = $0004; - CODEC_CAP_TRUNCATED = $0008; - - (* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - - (** - * codec has a non zero delay and needs to be feeded with NULL at the end to get the delayed data. - * if this is not set, the codec is guranteed to never be feeded with NULL data - *) - CODEC_CAP_DELAY = $0020; - - (** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - - (** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - - (** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - - (** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - - (** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - - (** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - - (** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - - (** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - - (** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - -{$IF FF_API_OLD_FF_PICT_TYPES} -(* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values *) - FF_I_TYPE = 1; ///< Intra - FF_P_TYPE = 2; ///< Predicted - FF_B_TYPE = 3; ///< Bi-dir predicted - FF_S_TYPE = 4; ///< S(GMC)-VOP MPEG4 - FF_SI_TYPE = 5; ///< Switching Intra - FF_SP_TYPE = 6; ///< Switching Predicted - FF_BI_TYPE = 7; -{$IFEND} - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - //FF_BUG_FAKE_SCALABILITY = 16 //Autodetection should work 100%. - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_ER_CAREFUL = 1; - FF_ER_COMPLIANT = 2; - FF_ER_AGGRESSIVE = 3; - FF_ER_VERY_AGGRESSIVE = 4; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_LIBMPEG2MMX = 4; - FF_IDCT_PS2 = 5; - FF_IDCT_MLIB = 6; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_H264 = 11; - FF_IDCT_VP3 = 12; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_CAVS = 15; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_WMV2 = 19; - FF_IDCT_FAAN = 20; - FF_IDCT_EA = 21; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - FF_IDCT_BINK = 24; - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - -{$IF FF_API_ANTIALIAS_ALGO} - FF_AA_AUTO = 0; - FF_AA_FASTINT = 1; //not implemented yet - FF_AA_INT = 2; - FF_AA_FLOAT = 3; -{$IFEND} - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - FF_PROFILE_H264_CONSTRAINED = (1<<9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1<<11); // 8+3; constraint_set3_flag - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_LEVEL_UNKNOWN = -99; - - X264_PART_I4X4 = $001; (* Analyse i4x4 *) - X264_PART_I8X8 = $002; (* Analyse i8x8 (requires 8x8 transform) *) - X264_PART_P8X8 = $010; (* Analyse p16x8, p8x16 and p8x8 *) - X264_PART_P4X4 = $020; (* Analyse p8x4, p4x8, p4x4 *) - X264_PART_B8X8 = $100; (* Analyse b16x8, b8x16 and b8x8 *) - - FF_COMPRESSION_DEFAULT = -1; - - FF_THREAD_FRAME = 1; //< Decode more than one frame at once - FF_THREAD_SLICE = 2; //< Decode more than one part of a single frame at once - - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type - TAVPacketSideDataType = (AV_PKT_DATA_PALETTE); - - PAVPacket = ^TAVPacket; - TAVPacket = record -(* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; -(* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - flags: cint; -(** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: pointer; - { - record - data: Pcuint8; - size: cint; - type_: TAVPacketSideDataType; - end; - } - side_data_elems: cint; - -(* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; - pos: cint64; // byte position in stream, -1 if unknown - -(* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; - -type - PAVCodecContext = ^TAVCodecContext; - - (** - * Audio Video Frame. - * New fields can be added to the end of FF_COMMON_FRAME with minor version - * bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. No fields should be added into AVFrame before or after - * FF_COMMON_FRAME! - * sizeof(AVFrame) must not be used outside libav*. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture planes. - * This might be different from the first allocated byte - * - encoding: - * - decoding: - *) - data: array [0..3] of pbyte; - linesize: array [0..3] of cint; - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..3] of pbyte; - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * buffer age (1->was last buffer and dint change, 2->..., ...). - * Set to INT_MAX if the buffer has not been used yet. - * - encoding: unused - * - decoding: MUST be set by get_buffer(). - *) - age: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: byte; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..3] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * - *) - qscale_type: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * reordered pts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * reordered sample aspect ratio for the video frame, 0/1 if unknown\unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * format of the frame, -1 if unknown or unset - * It should be cast to the corresponding enum (enum PixelFormat - * for video, enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - end; {TAVFrame} - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PQuadIntArray = ^TQuadIntArray; - TQuadIntArray = array [0..3] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - -{$IF FF_API_PALETTE_CONTROL} -(** - * AVPaletteControl - * This structure defines a method for communicating palette changes - * between and demuxer and a decoder. - * - * @deprecated Use AVPacket to send palette changes instead. - * This is totally broken. - *) - PAVPaletteControl = ^TAVPaletteControl; - TAVPaletteControl = record - (* demuxer sets this to 1 to indicate the palette has changed; - * decoder resets to 0 *) - palette_changed: cint; - - (* 4-byte ARGB palette entries, stored in native byte order; note that - * the individual palette components should be on a 8-bit scale; if - * the palette data comes from a IBM VGA native format, the component - * data is probably 6 bits in size and needs to be scaled *) - palette: array [0..AVPALETTE_COUNT - 1] of cuint; - end; {deprecated;} -{$IFEND} - - (** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context - *) - av_class: PAVClass; - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * Some codecs need additional format info. It is stored here. - * If any muxer uses this then ALL demuxers/parsers AND encoders for the - * specific codec MUST set it correctly otherwise stream copy breaks. - * In general use of this field by muxers is not recommanded. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. (FIXME: Is this OK?) - *) - sub_id: cint; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid prolems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - * Note: For compatibility it is possible to set this instead of - * coded_width/height before decoding. - *) - width, height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overriden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PQuadIntArray; - y: cint; type_: cint; height: cint); cdecl; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Samples per packet, initialized when calling 'init'. - *) - frame_size: cint; - frame_number: cint; ///< audio or video frame number - - (** - * Number of frames the decoded output will be delayed relative to - * the encoded input. - * - encoding: Set by libavcodec. - * - decoding: unused - *) - delay: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - codec: PAVCodec; - - priv_data: pointer; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - codec_name: array [0..31] of AnsiChar; - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec_id: TCodecID; (* see CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger then 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - luma_elim_threshold: cint; - - (** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - chroma_elim_threshold: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Error recognization; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Called at the beginning of each frame to get a buffer for it. - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - parse_only: cint; (* - decoding only: if true, only parsing is done - (function avcodec_parse_frame()). The frame - data is returned. Only MPEG codecs support this now. *) - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override: PRcOverride; - rc_override_count: cint; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - rc_buffer_aggressivity: cfloat; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * dsp_mask could be add used to disable unwanted CPU features - * CPU features (i.e. MMX, SSE. ...) - * - * With the FORCE flag you may instead enable given CPU features. - * (Dangerous: Usable in case of misdetection, improper usage however will - * result into program crash.) - *) - dsp_mask: cuint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..3] of cuint64; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - *) - color_table_id: cint; - - (** - * internal_buffer count - * Don't touch, used by libavcodec default_get_buffer(). - *) - internal_buffer_count: cint; - - (** - * internal_buffers - * Don't touch, used by libavcodec default_get_buffer(). - *) - internal_buffer: pointer; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - { - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - realloc: function (s: PAVCodecContext; buf: Pbyte; buf_size: cint): Pbyte; cdecl; - } - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: array [0..3] of AnsiChar; //cuint; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - -{$IF FF_API_PALETTE_CONTROL} - (** - * palette control structure - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by user. - *) - palctrl: PAVPaletteControl; -{$IFEND} - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - inter_threshold: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - -{$IF FF_API_ANTIALIAS_ALGO} - (** - * MP3 antialias algorithm, see FF_AA_* below. - * - encoding: unused - * - decoding: Set by user. - *) - antialias_algo: cint; {deprecated} -{$IFEND} - - (** - * quantizer noise shaping - * - encoding: Set by user. - * - decoding: unused - *) - quantizer_noise_shaping: cint; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; - - (** - * Bitstream width / height, may be different from width/height if lowres - * or other things are used. - * - encoding: unused - * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. - *) - coded_width, coded_height: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * constant rate factor - quality-based VBR - values ~correspond to qps - * - encoding: Set by user. - * - decoding: unused - *) - crf: cfloat; - - (** - * constant quantization parameter rate control method - * - encoding: Set by user. - * - decoding: unused - *) - cqp: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Influences how often B-frames are used. - * - encoding: Set by user. - * - decoding: unused - *) - bframebias: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * Reduce fluctuations in qp (before curve compression). - * - encoding: Set by user. - * - decoding: unused - *) - complexityblur: cfloat; - - (** - * in-loop deblocking filter alphac0 parameter - * alpha is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockalpha: cint; - - (** - * in-loop deblocking filter beta parameter - * beta is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockbeta: cint; - - (** - * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4 - * - encoding: Set by user. - * - decoding: unused - *) - partitions: cint; - - (** - * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto) - * - encoding: Set by user. - * - decoding: unused - *) - directpred: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjusts sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - -{$IF FF_API_FLAC_GLOBAL_OPTS} - (** - * @defgroup flac_opts FLAC options - * @deprecated Use FLAC encoder private options instead. - * @{ - *) - - (** - * LPC coefficient precision - used by FLAC encoder - * - encoding: Set by user. - * - decoding: unused - *) - lpc_coeff_precision: cint; {deprecated} - - (** - * search method for selecting prediction order - * - encoding: Set by user. - * - decoding: unused - *) - prediction_order_method: cint; {deprecated} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_partition_order: cint; {deprecated} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_partition_order: cint; {deprecated} -{$IFEND} - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user. - * - decoding: unused - *) - timecode_frame_start: cint64; - -{$IF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; -{$IFEND} - - (** - * Percentage of dynamic range compression to be applied by the decoder. - * The default value is 1.0, corresponding to full compression. - * - encoding: unused - * - decoding: Set by user. - *) - drc_scale: cfloat; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * This field is applicable only when sample_fmt is AV_SAMPLE_FMT_S32. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - channel_layout: cint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cint64; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * explicit P-frame weighted prediction analysis method - * 0: off - * 1: fast blind weighting (one reference duplicate with -1 offset) - * 2: smart weighting (full fade detection analysis) - * - encoding: Set by user. - * - decoding: unused - *) - weighted_p_pred: cint; - - (** - * AQ mode - * 0: Disabled - * 1: Variance AQ (complexity mask) - * 2: Auto-variance AQ (experimental) - * - encoding: Set by user - * - decoding: unused - *) - aq_mode: cint; - - (** - * AQ strength - * Reduces blocking and blurring in flat and textured areas. - * - encoding: Set by user - * - decoding: unused - *) - aq_strength: cfloat; - - (** - * PSY RD - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_rd: cfloat; - - (** - * PSY trellis - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_trellis: cfloat; - - (** - * RC lookahead - * Number of frames for frametype and ratecontrol lookahead - * - encoding: Set by user - * - decoding: unused - *) - rc_lookahead: cint; - - (** - * Constant rate factor maximum - * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse - * than crf_max, even if doing so would violate VBV restrictions. - * - encoding: Set by user. - * - decoding: unused - *) - crf_max: cfloat; - - log_level_offset: cint; - -{$IF FF_API_FLAC_GLOBAL_OPTS} - (** - * Determines which LPC analysis algorithm to use. - * - encoding: Set by user - * - decoding: unused - *) - lpc_type: TAVLPCType; {deprecated} - - (** - * Number of passes to use for Cholesky factorization during LPC analysis - * - encoding: Set by user - * - decoding: unused - *) - lpc_passes: cint; {deprecated} -{$IFEND} - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - - (** - * Whether this is a copy of the context which had init() called on it. - * This is used by multithreading - shared tables and picture pointers - * should be freed from the original context only. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - is_copy: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - -(** - * AVCodec. - *) - TAVCodec = record - name: PAnsiChar; - type_: TAVMediaType; - id: TCodecID; - priv_data_size: cint; - init: function (avctx: PAVCodecContext): cint; cdecl; - encode: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; data: pointer): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - next: PAVCodec; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (** - * @defgroup framethreading Frame-level threading support functions. - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See CODEC_ID_xxx - *) - id: TCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..3] of PByteArray; - linesize: array [0..3] of cint; ///< number of bytes per line - end; {TAVPicture} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The pressentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(* packet functions *) - -(** - * @deprecated use NULL instead - *) -procedure av_destruct_packet_nofree(pkt: PAVPacket); - cdecl; external av__codec; deprecated; - -(* - * Default packet destructor. - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): Pcuint8; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): Pcuint8; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(* resample.c *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occured - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields. - * The fields of the given AVPicture are filled in by using the 'ptr' address - * which points to the image data buffer. Depending on the specified picture - * format, one or multiple image data pointers and line sizes will be set. - * If a planar format is specified, several pointers will be set pointing to - * the different picture planes and the line sizes of the different planes - * will be stored in the lines_sizes array. - * Call with ptr == NULL to get the required size for the ptr buffer. - * - * @param picture AVPicture whose fields are to be filled in - * @param ptr Buffer which will contain or contains the actual image data - * @param pix_fmt The format in which the picture data is stored. - * @param width the width of the image in pixels - * @param height the height of the image in pixels - * @return size of the image data in bytes - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer. - * The data is stored compactly, without any gaps for alignment or padding - * which may be applied by avpicture_fill(). - * - * \see avpicture_get_size() - * - * @param[in] src AVPicture containing image data - * @param[in] pix_fmt The format in which the picture data is stored. - * @param[in] width the width of the image in pixels. - * @param[in] height the height of the image in pixels. - * @param[out] dest A buffer into which picture data will be copied. - * @param[in] dest_size The size of 'dest'. - * @return The number of bytes written to dest, or a negative value (error code) on error. - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Note that this returns the size of a compact representation as generated - * by avpicture_layout, which can be smaller than the size required for e.g. - * avpicture_fill. - * - * @param pix_fmt the given picture format - * @param width the width of the image - * @param height the height of the image - * @return Image data size in bytes or -1 on error (e.g. too large dimensions). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -{$IF FF_API_GET_PIX_FMT_NAME} -(** - * Return the short name for a pixel format. - * - * \see av_get_pix_fmt(), av_get_pix_fmt_string(). - * @deprecated Deprecated in favor of av_get_pix_fmt_name(). - *) -function avcodec_get_pix_fmt_name(pix_fmt: TAVPixelFormat): PAnsiChar; - cdecl; external av__codec; deprecated; -{$IFEND} - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; {**< loss due to resolution change *} - FF_LOSS_DEPTH = $0002; {**< loss due to color depth change *} - FF_LOSS_COLORSPACE = $0004; {**< loss due to color space conversion *} - FF_LOSS_ALPHA = $0008; {**< loss of alpha bits *} - FF_LOSS_COLORQUANT = $0010; {**< loss due to color quantization *} - FF_LOSS_CHROMA = $0020; {**< loss of chroma (e.g. RGB to gray conversion) *} - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur. - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_mask parameter. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24); - * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint64; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): TAVPixelFormat; - cdecl; external av__codec; - -const - FF_ALPHA_TRANSP = $0001; {* image has some totally transparent pixels *} - FF_ALPHA_SEMI_TRANSP = $0002; {* image has some transparent pixels *} - -(** - * Tell if an image really has transparent alpha values. - * @return ored mask of FF_ALPHA_xxx constants - *) -function img_get_alpha_info (src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; - cdecl; external av__codec; - -(* deinterlace a picture *) -(* deinterlace - if not supported return -1 *) -function avpicture_deinterlace (dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; - cdecl; external av__codec; - -(* external high level API *) - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Initialize libavcodec. - * - * @warning This function must be called before any other libavcodec - * function. - * - * @warning This function is not thread-safe. - *) -procedure avcodec_init(); - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @see avcodec_init(), avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id CodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: PAVCodec); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context3(codec: PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param pic The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults (pic: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct can be deallocated by simply calling av_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PQuadIntArray); - cdecl; external av__codec; - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -{$IF FF_API_THREAD_INIT} -(** - * @deprecated Set s->thread_count before calling avcodec_open() instead of calling this. - *) -function avcodec_thread_init(s: PAVCodecContext; thread_count: cint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context(); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context(); - * - * if (avcodec_open(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Some codecs have a delay between input and output, these need to be - * fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Frees all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -function avcodec_parse_frame(avctx: PAVCodecContext; pdata: PPointer; - data_size_ptr: PCint; - buf: PByteArray; buf_size: cint): cint; - cdecl; external av__codec; - -(** - * Encode an audio frame from samples into buf. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for PCM audio the user will know how much space is needed - * because it depends on the value passed in buf_size as described - * below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For PCM audio the number of samples read from samples is equal to - * buf_size * input_sample_size / output_sample_size. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; - -(** - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -procedure avcodec_default_free_buffers(s: PAVCodecContext); - cdecl; external av__codec; - -(* misc useful functions *) - -{$IF FF_API_OLD_FF_PICT_TYPES} -(** - * Return a single letter to describe the given picture type pict_type. - * - * @param[in] pict_type the picture type - * @return A single character representing the picture type. - * @deprecated Use av_get_picture_type_char() instead. - *) -function av_get_pict_type_char(pict_type: cint): AnsiChar; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TCodecID): cint; - cdecl; external av__codec; - -{$IF FF_API_OLD_SAMPLE_FMT} -(** - * @deprecated Use av_get_bits_per_sample_fmt() instead. - *) -function av_get_bits_per_sample_format(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (*! - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Copy image src to dst. Wraps av_picture_data_copy() above. - *) -procedure av_picture_copy(dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - top_band: cint; - left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; - src: {const} PAVPicture; - height: cint; - width: cint; - pix_fmt: TAVPixelFormat; - padtop: cint; - padbottom: cint; - padleft: cint; - padright: - cint; - color: PCint): cint; - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); - cdecl; external av__codec; - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.8/avformat.pas b/src/lib/ffmpeg-0.8/avformat.pas deleted file mode 100644 index 75ea31d0..00000000 --- a/src/lib/ffmpeg-0.8/avformat.pas +++ /dev/null @@ -1,1714 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 0.8 libavformat/avformat.h - * Min. version: 53.4.0 - * Max. version: 53.21.1 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 0.8x - * This file has been created with the previous ffmpeg headers as a basis - * by removing all unneeded conditionals. - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 53; - LIBAVFORMAT_MAX_VERSION_MINOR = 21; - LIBAVFORMAT_MAX_VERSION_RELEASE = 1; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 53; - LIBAVFORMAT_MIN_VERSION_MINOR = 4; - LIBAVFORMAT_MIN_VERSION_RELEASE = 0; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -type - PAVFile = Pointer; - -(* - * Public Metadata API. - * The metadata API allows libavformat to export metadata tags to a client - * application using a sequence of key/value pairs. Like all strings in FFmpeg, - * metadata must be stored as UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * Important concepts to keep in mind: - * 1. Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * 2. Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * 3. Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * a) language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * b) sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * 4. Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - * album -- name of the set this work belongs to - * album_artist -- main creator of the set/album, if different from artist. - * e.g. "Various Artists" for compilation albums. - * artist -- main creator of the work - * comment -- any additional description of the file. - * composer -- who composed the work, if different from artist. - * copyright -- name of copyright holder. - * creation_time-- date when the file was created, preferably in ISO 8601. - * date -- date when the work was created, preferably in ISO 8601. - * disc -- number of a subset, e.g. disc in a multi-disc collection. - * encoder -- name/settings of the software/hardware that produced the file. - * encoded_by -- person/group who created the file. - * filename -- original name of the file. - * genre -- . - * language -- main language in which the work is performed, preferably - * in ISO 639-2 format. Multiple languages can be specified by - * separating them with commas. - * performer -- artist who performed the work, if different from artist. - * E.g for "Also sprach Zarathustra", artist would be "Richard - * Strauss" and performer "London Philharmonic Orchestra". - * publisher -- name of the label/publisher. - * service_name -- name of the service in broadcasting (channel name). - * service_provider -- name of the service provider in broadcasting. - * title -- name of the work. - * track -- number of this work in the set, can be in form current/total. - * variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - *) - -{$IF FF_API_OLD_METADATA2} -(** - * @defgroup old_metadata Old metadata API - * The following functions are deprecated, use - * their equivalents from libavutil/dict.h instead. - * @ - *) - -const - AV_METADATA_MATCH_CASE = AV_DICT_MATCH_CASE; - AV_METADATA_IGNORE_SUFFIX = AV_DICT_IGNORE_SUFFIX; - AV_METADATA_DONT_STRDUP_KEY = AV_DICT_DONT_STRDUP_KEY; - AV_METADATA_DONT_STRDUP_VAL = AV_DICT_DONT_STRDUP_VAL; - AV_METADATA_DONT_OVERWRITE = AV_DICT_DONT_OVERWRITE; - -type - PAVMetadataTag = ^TAVMetadataTag; - TAVMetadataTag = record - key: PAnsiChar; - value: PAnsiChar; - end; - - PAVMetadata = Pointer; - PAVDictionary = PAVMetadata; - PAVDictionaryEntry = PAVMetadata; - -(** - * Get a metadata element with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found tag or NULL, changing key or value leads to undefined behavior. - *) -function av_metadata_get(m: PAVDictionary; key: {const} PAnsiChar; - prev: {const} PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__format; - -(** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped depending on flags) - * @param value tag value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_metadata_set2(var pm: PAVDictionary; key: {const} PAnsiChar; value: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; - -(** - * Copy metadata from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting metadata in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_metadata_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__format; deprecated; - -(** - * Free all the memory allocated for an AVDictionary struct. - *) -procedure av_metadata_free(var m: PAVDictionary); - cdecl; external av__format; deprecated; - -{$IFEND} - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PByteIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - - //! Demuxer will use url_fopen, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - - AVFMT_NOOUTPUTLOOP = -1; - AVFMT_INFINITEOUTPUTLOOP = 0; - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_RTP_HINT = $0040; ///< Add RTP hinting to the output file - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVFormatParameters = ^TAVFormatParameters; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - TAVFormatParameters = record - time_base: TAVRational; - sample_rate: cint; - channels: cint; - width: cint; - height: cint; - pix_fmt: TAVPixelFormat; - channel: cint; (**< Used to select DV channel. *) - standard: PAnsiChar; (**< TV standard, NTSC, PAL, SECAM *) - { Delphi does not support bit fields -> use bf_flags instead - unsigned int mpeg2ts_raw:1; (**< Force raw MPEG-2 transport stream output, if possible. *) - unsigned int mpeg2ts_compute_pcr:1; (**< Compute exact PCR for each transport - stream packet (only meaningful if - mpeg2ts_raw is TRUE). *) - unsigned int initial_pause:1; (**< Do not begin to play the stream - immediately (RTSP only). *) - unsigned int prealloced_context:1; - } - bf_flags: byte; // 0:mpeg2ts_raw/1:mpeg2ts_compute_pcr/2:initial_pause/3:prealloced_context - end; - - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - (* output support *) - audio_codec: TCodecID; (**< default audio codec *) - video_codec: TCodecID; (**< default video codec *) - write_header: function (c: PAVFormatContext): cint; cdecl; - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER - *) - flags: cint; - (** - * Currently only used to set pixel format if not YUV420P. - *) - set_parameters: function (c: PAVFormatContext; f: PAVFormatParameters): cint; cdecl; - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - subtitle_codec: TCodecID; (**< default subtitle codec *) - - {const} metadata_conv: PAVMetadataConv; - - (* private fields *) - next: PAVOutputFormat; - end; - - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. 'ap' if non-NULL contains - * additional parameters. Only used in raw format right - * now. 'av_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'av_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Gets the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - (** - * General purpose read-only value that the format can use. - *) - value: cint; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - codec_tag: {const} PPAVCodecTag; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - {const} metadata_conv: PAVMetadataConv; - - (* private fields *) - next: PAVInputFormat; - end; - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - id: cint; (**< format-specific stream ID *) - codec: PAVCodecContext; (**< codec context *) - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - *) - r_frame_rate: TAVRational; - priv_data: pointer; - - (* internal data used in av_find_stream_info() *) - first_dts: cint64; - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * time base should be 1/framerate and timestamp increments should be 1. - *) - time_base: TAVRational; - pts_wrap_bits: cint; (* number of bits in pts (used for wrapping control) *) - (* ffmpeg.c private use *) - stream_copy: cint; (**< If set, just copy stream. *) - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - //FIXME move stuff to a flags field? - (** - * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. - * MN:dunno if thats the right place, for it - *) - quality: cfloat; - - (** - * Decoding: pts of the first frame of the stream, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - cur_dts: cint64; - last_IP_duration: cint; - last_IP_pts: cint64; - (* av_seek_frame() support *) - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVMetadata; - - {* Intended mostly for av_read_frame() support. Not supposed to be used by *} - {* external applications; try to use something else if at all possible. *} - cur_ptr: {const} PCuint8; - cur_len: cint; - cur_pkt: TAVPacket; - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - - (** - * Number of packets to buffer for codec probing - * NOT PART OF PUBLIC API - *) - probe_packets: cint; - - (** - * last packet in packet_buffer for this stream when muxing. - * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav* - *) - last_in_packet_buffer: PAVPacketList; - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - end; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*. - *) - TAVFormatContext = record - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - (* Can only be iformat or oformat, not both at the same time. *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - priv_data: pointer; - - pb: PByteIOContext; - - nb_streams: cuint; - streams: PPAVStream; - filename: array [0..1023] of AnsiChar; (* input or output filename *) - (* stream info *) - timestamp: cint64; - - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - (* private data for pts handling (do not modify directly). *) - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - (** - * decoding: total file size, 0 if unknown - *) - file_size: cint64; - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - (* av_read_frame() support *) - cur_st: PAVStream; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - mux_rate: cint; - packet_size: cuint; - preload: cint; - max_delay: cint; - - (** - * number of times to loop output in formats that support it - *) - loop_output: cint; - - flags: cint; - loop_input: cint; - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * Maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in av_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen : cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer: PAVPacketList; - raw_packet_buffer_end: PAVPacketList; - - packet_buffer_end: PAVPacketList; - - metadata: PAVMetadata; - - (** - * Remaining size available for raw_packet_buffer, in bytes. - * NOT PART OF PUBLIC API - *) - raw_packet_buffer_remaining_size: cint; - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - end; - - (** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id : cint; - flags : cint; - discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index : PCardinal; - nb_stream_indexes : PCardinal; - metadata : PAVMetadata; - end; - - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. If one of the tables is NULL, then - * tags are converted to/from ffmpeg generic tag names. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) -procedure av_metadata_conv(ctx: PAVFormatContext; {const} d_conv: PAVMetadataConv; - {const} s_conv: PAVMetadataConv); - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -function av_guess_image2_codec(filename: {const} PAnsiChar): TCodecID; - cdecl; external av__format; - -(* XXX: Use automatic init with either ELF sections or C file parser *) -(* modules. *) - -(* utils.c *) -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; - -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TAVMediaType): TCodecID; - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - *) -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - *) -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -(** - * Get the CodecID for the given codec tag tag. - * If no codec id is found returns CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; - cdecl; external av__format; - -(* media file input *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Allocate all the structures needed to read an input stream. - * This does not open the needed codecs for decoding the stream[s]. - *) -function av_open_input_stream(var ic_ptr: PAVFormatContext; - pb: PByteIOContext; filename: PAnsiChar; - fmt: PAVInputFormat; ap: PAVFormatParameters): cint; - cdecl; external av__format; - -(** - * Open a media file as input. The codecs are not opened. Only the file - * header (if present) is read. - * - * @param ic_ptr The opened media file handle is put here. - * @param filename filename to open - * @param fmt If non-NULL, force the file format to use. - * @param buf_size optional buffer size (zero if default is OK) - * @param ap Additional parameters needed when opening the file - * (NULL if default). - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_open_input_file(var ic_ptr: PAVFormatContext; filename: PAnsiChar; - fmt: PAVInputFormat; buf_size: cint; - ap: PAVFormatParameters): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; {const} filename: PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * - * The returned packet is valid - * until the next av_read_frame() or until av_close_input_file() and - * must be freed with av_free_packet. For video, the packet contains - * exactly one frame. For audio, it contains an cint number of - * frames if each frame has a known fixed size (e.g. PCM or ADPCM - * data). If the audio frames have a variable size (e.g. MPEG audio), - * then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in byte and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * - * @param stream_index index of the stream which is used as time base reference. - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Free a AVFormatContext allocated by av_open_input_stream. - * @param s context to free - *) -procedure av_close_input_stream(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * Add a new chapter. - * This function is NOT part of the public API - * and should ONLY be used by demuxers. - * - * @param s media file handle - * @param id unique ID for this chapter - * @param start chapter start time in time_base units - * @param end chapter end time in time_base units - * @param title chapter title - * - * @return AVChapter or NULL on error - *) -function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; - start, end_: cint64; title: {const} PAnsiChar): PAVChapter; - cdecl; external av__format; - -(** - * Set the pts for a given stream. - * - * @param s stream - * @param pts_wrap_bits number of bits effectively used by the pts - * (used for wrap control, 33 is the value for MPEG) - * @param pts_num numerator to convert to seconds (MPEG: 1) - * @param pts_den denominator to convert to seconds (MPEG: 90000) - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Ensure the index uses less memory than the maximum specified in - * AVFormatContext.max_index_size by discarding entries if it grows - * too large. - * This function is not part of the public API and should only be called - * by demuxers. - *) -procedure ff_reduce_index(s: PAVFormatContext; stream_index: cint); - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Perform a binary search using av_index_search_timestamp() and - * AVInputFormat.read_timestamp(). - * This is not supposed to be called directly by a user application, - * but by demuxers. - * @param target_ts target timestamp in the time base of the given stream - * @param stream_index stream number - *) -function av_seek_frame_binary(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Update cur_dts of all streams based on the given timestamp and AVStream. - * - * Stream ref_st unchanged, others set cur_dts in their native time base. - * Only needed for timestamp wrapping or if (dts not set and pts!=dts). - * @param timestamp new dts expressed in time_base of param ref_st - * @param ref_st reference stream giving time_base of param timestamp - *) -procedure av_update_cur_dts(s: PAVFormatContext; ref_st: PAVStream; - timestamp: cint64); - cdecl; external av__format; - -type - TReadTimestampFunc = function (pavfc: PAVFormatContext; - arg2: cint; arg3: Pint64; arg4: cint64): cint64; cdecl; - -(** - * Perform a binary search using read_timestamp(). - * This is not supposed to be called directly by a user application, - * but by demuxers. - * @param target_ts target timestamp in the time base of the given stream - * @param stream_index stream number - *) -function av_gen_search(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; pos_min: cint64; - pos_max: cint64; pos_limit: cint64; - ts_min: cint64; ts_max: cint64; - flags: cint; ts_ret: Pint64; - read_timestamp: TReadTimestampFunc): cint64; - cdecl; external av__format; - -(** - * media file output - *) -function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -(** - * Allocate the stream private data and write the stream header to an - * output media file. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_header(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * The packet shall contain one audio or video frame. - * The packet must be correctly interleaved according to the container - * specification, if not then av_interleaved_write_frame must be used. - * - * @param s media file handle - * @param pkt The packet, which contains the stream_index, buf/buf_size, - * dts/pts, ... - * @return < 0 on error, = 0 if OK, 1 if end of stream wanted - *) -function av_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet, which contains the stream_index, buf/buf_size, - * dts/pts, ... - * @return < 0 on error, = 0 if OK, 1 if end of stream wanted - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Interleave a packet per dts in an output media file. - * - * Packets with pkt->destruct == av_destruct_packet will be freed inside this - * function, so they cannot be used after it. Note that calling av_free_packet() - * on them is still safe. - * - * @param s media file handle - * @param out the interleaved packet will be output here - * @param pkt the input packet - * @param flush 1 if no further packets are available as input and all - * remaining packets should be output - * @return 1 if a packet was output, 0 if no packet could be output, - * < 0 if an error occurred - *) -function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; - pkt: PAVPacket; flush: cint): cint; - cdecl; external av__format; - -(** - * Add packet to AVFormatContext->packet_buffer list, determining its - * interleaved position using compare() function argument. - * - * This function is not part of the public API and should only be called - * by muxers using their own interleave function. - *) -{ -procedure ff_interleave_add_packet(s: PAVFormatContext; - pkt: PAVPacket; - compare: function(para1: PAVFormatContext; - para2: PAVPacket; - para3: PAVPacket): cint); - cdecl; external av__format; -} - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to av_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -procedure dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Parse datestr and return a corresponding number of microseconds. - * @param datestr String representing a date or a duration. - * - If a date the syntax is: - * @code - * now|{[{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z|z]} - * @endcode - * If the value is "now" it takes the current time. - * Time is localtime unless Z is appended, in which case it is - * interpreted as UTC. - * If the year-month-day part is not specified it takes the current - * year-month-day. - * Returns the number of microseconds since 1st of January, 1970 up to - * the time of the parsed date or INT64_MIN if datestr cannot be - * successfully parsed. - * - If a duration the syntax is: - * @code - * [-]HH[:MM[:SS[.m...]]] - * [-]S+[.m...] - * @endcode - * @return the number of microseconds contained in a time interval - * with the specified duration or INT64_MIN if datestr cannot be - * successfully parsed. - * @param duration Flag which tells how to interpret datestr, if - * not zero datestr is interpreted as a duration, otherwise as a - * date. - *) -function parse_date(datestr: PAnsiChar; duration: cint): cint64; - cdecl; external av__format; - -(** - * Get the current time in microseconds. - *) -function av_gettime(): cint64; - cdecl; external av__format; - -(* ffm-specific for ffserver *) -const - FFM_PACKET_SIZE = 4096; - -function ffm_read_write_index(fd: cint): cint64; - cdecl; external av__format; - -function ffm_write_write_index(fd: cint; pos: cint64): cint; - cdecl; external av__format; - -procedure ffm_set_write_index(s: PAVFormatContext; pos: cint64; file_size: cint64); - cdecl; external av__format; - -(** - * Attempt to find a specific tag in a URL. - * - * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done. - * Return 1 if found. - *) -function find_info_tag(arg: PAnsiChar; arg_size: cint; tag1: PAnsiChar; info: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buff buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PByteArray; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.8/avio.pas b/src/lib/ffmpeg-0.8/avio.pas deleted file mode 100644 index 4a85d708..00000000 --- a/src/lib/ffmpeg-0.8/avio.pas +++ /dev/null @@ -1,862 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 52.110.0 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_MAX_STREAMS = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA2 = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - FF_API_URL_RESETBUF = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_REGISTER_PROTOCOL = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_GUESS_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_UDP_GET_FILE = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_URL_SPLIT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_ALLOC_FORMAT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARSE_FRAME_PARAM = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_READ_SEEK = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_LAVF_UNUSED = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARAMETERS_CODEC_ID = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_FIRST_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_SYMVER = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_INDEX_BUILT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_DUMP_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PARSE_DATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FIND_INFO_TAG = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_GUESS_IMG2_CODEC = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_SDP_CREATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FLAG_RTP_HINT = (LIBAVFORMAT_VERSION_MAJOR < 54); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - URL_PROTOCOL_FLAG_NESTED_SCHEME = 1; (*< The protocol name can be the first part of a nested protocol scheme *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - -type -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) -{$IF FF_API_OLD_AVIO} - is_streamed: cint; { deprecated } -{$IFEND} - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - end; - -(* unbuffered I/O *) - -{$IF FF_API_OLD_AVIO} - PURLProtocol = ^TURLProtocol; - -(** - * URL Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(URLContext) must not be used outside libav*. - * @deprecated This struct will be made private - *) - PPURLContext = ^PURLContext; - PURLContext = ^TURLContext; - TURLContext = record - av_class: {const} PAVClass; ///< information for av_log(). Set by url_open(). - prot: PURLProtocol; - flags: cint; - is_streamed: cint; (**< true if streamed (no seek possible), default = false *) - max_packet_size: cint; (**< if non zero, the stream is packetized with this max packet size *) - priv_data: pointer; - filename: PAnsiChar; (**< specified URL *) - is_connected: cint; - end; - -(** - * @deprecated This struct is to be made private. Use the higher-level - * AVIOContext-based API instead. - *) - TURLProtocol = record - name: PAnsiChar; - url_open: function (h: PURLContext; url: {const} PAnsiChar; flags: cint): cint; cdecl; - url_read: function (h: PURLContext; buf: PByteArray; size: cint): cint; cdecl; - url_write: function (h: PURLContext; {const} buf: PByteArray; size: cint): cint; cdecl; - url_seek: function (h: PURLContext; pos: cint64; whence: cint): cint64; cdecl; - url_close: function (h: PURLContext): cint; cdecl; - next: PURLProtocol; - url_read_pause: function (h: PURLContext; pause: cint): cint; cdecl; - url_read_seek: function (h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - url_get_file_handle: function (h: PURLContext): cint; cdecl; - priv_data_size: cint; - {const} priv_data_class: PAVClass; - flags: cint; - url_check: function (h: PURLContext; mask: cint): cint; cdecl; - end; - - PURLPollEntry = ^TURLPollEntry; - TURLPollEntry = record - handle: PURLContext; - events: cint; - revents: cint; - end; - -(* not implemented *) -function url_poll(poll_table: PURLPollEntry; n: cint; timeout: cint): cint; - cdecl; external av__format; deprecated; - -const -(** - * @defgroup open_modes URL open modes - * The flags argument to url_open and cosins must be one of the following - * constants, optionally ORed with other flags. - * @ - *) - URL_RDONLY = 1; (**< read-only *) - URL_WRONLY = 2; (**< write-only *) - URL_RDWR = URL_RDONLY or URL_WRONLY; (**< read-write *) -(** - * @ - *) - -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - URL_FLAG_NONBLOCK = 4; - -type - PURLInterruptCB = ^TURLInterruptCB; - TURLInterruptCB = function (): cint; cdecl; - -{ -var - url_interrupt_cb: PURLInterruptCB; cvar; external: av__format; -} - -(** - * @defgroup old_url_funcs Old url_* functions - * @deprecated use the buffered API based on AVIOContext instead - * @{ - *) -function url_open_protocol(puc: PPURLContext; up: PURLProtocol; - url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_alloc(h: PPURLContext; {const} url: PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_connect(h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_open(h: PPointer; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_read (h: PURLContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_read_complete (h: PURLContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_write (h: PURLContext; {const} buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_seek (h: PURLContext; pos: cint64; whence: cint): cint64; - cdecl; external av__format; deprecated; -function url_close (h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_filesize (h: PURLContext): cint64; - cdecl; external av__format; deprecated; -function url_get_file_handle(h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_get_max_packet_size(h: PURLContext): cint; - cdecl; external av__format; deprecated; -procedure url_get_filename(h: PURLContext; buf: PAnsiChar; buf_size: cint); - cdecl; external av__format; deprecated; -function av_url_read_pause(h: PURLContext; pause: cint): cint; - cdecl; external av__format; deprecated; -function av_url_read_seek(h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; deprecated; -procedure url_set_interrupt_cb (interrupt_cb: TURLInterruptCB); - cdecl; external av__format; deprecated; - -(** - * returns the next registered protocol after the given protocol (the first if - * NULL is given), or NULL if protocol is the last one. - *) -function av_protocol_next(p: PURLProtocol): PURLProtocol; - cdecl; external av__format; - -(** - * Register the URLProtocol protocol. - * - * @param size the size of the URLProtocol struct referenced - *) -function av_register_protocol2(protocol: PURLProtocol; size: cint): cint; - cdecl; external av__format; deprecated; -(** - * @ - *) - -type - PByteIOContext = PAVIOContext; { deprecated } - TByteIOContext = TAVIOContext; { deprecated } - -function init_put_byte(s: PAVIOContext; - buffer: PByteArray; - buffer_size: cint; write_flag: cint; - opaque: pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): cint; - cdecl; external av__format; deprecated; -function av_alloc_put_byte( - buffer: PByteArray; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; deprecated; - -(** - * @defgroup old_avio_funcs Old put_/get_*() functions - * @deprecated use the avio_ -prefixed functions instead. - * @{ - *) -function get_buffer(s: PAVIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function get_partial_buffer(s: PAVIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function get_byte(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function get_le16(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le24(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le32(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le64(s: PAVIOContext): cuint64; - cdecl; external av__format; deprecated; -function get_be16(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be24(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be32(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be64(s: PAVIOContext): cuint64; - cdecl; external av__format; deprecated; - -procedure put_byte(s: PAVIOContext; b: cint); - cdecl; external av__format; deprecated; -procedure put_nbyte(s: PAVIOContext; b: cint; count: cint); - cdecl; external av__format; deprecated; -procedure put_buffer (s: PAVIOContext; buf: {const} PByteArray; size: cint); - cdecl; external av__format; deprecated; -procedure put_le64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; deprecated; -procedure put_be64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; deprecated; -procedure put_le32(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be32(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_le24(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be24(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_le16(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be16(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_tag(s: PAVIOContext; tag: {const} PAnsiChar); - cdecl; external av__format; deprecated; -(** - * @ - *) - -function av_url_read_fpause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; deprecated; -function av_url_read_fseek(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; deprecated; - -(** - * @defgroup old_url_f_funcs Old url_f* functions - * @deprecated use the avio_ -prefixed functions instead. - * @{ - *) -function url_fopen(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_fclose(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_fseek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; deprecated; -function url_fskip(s: PAVIOContext; offset: cint64): cint; - cdecl; external av__format; deprecated; -function url_ftell(s: PAVIOContext): cint64; - cdecl; external av__format; deprecated; -function url_fsize(s: PAVIOContext): cint64; - cdecl; external av__format; deprecated; -const - URL_EOF = -1; -(** @note return URL_EOF (-1) if EOF *) -function url_fgetc(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_setbufsize (s: PAVIOContext; buf_size: cint): cint; - cdecl; external av__format; deprecated; -function url_fprintf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; deprecated; -procedure put_flush_packet (s: PAVIOContext); - cdecl; external av__format; deprecated; -function url_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_open_dyn_packet_buf(var s: PAVIOContext; max_packet_size: cint): cint; - cdecl; external av__format; deprecated; -function url_close_dyn_buf(s: PAVIOContext; pbuffer:PPointer): cint; - cdecl; external av__format; deprecated; -function url_fdopen (var s: PAVIOContext; h: PURLContext): cint; - cdecl; external av__format; deprecated; -(** - * @ - *) - -function url_ferror(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -function udp_set_remote_url(h: PURLContext; uri: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; -function udp_get_local_port(h: PURLContext): cint; - cdecl; external av__format; deprecated; - -type - Tupdate_checksum = function (c: culong; p: Pcuint8; len: cuint): culong; cdecl; -procedure init_checksum(s: PAVIOContext; - update_checksum: Tupdate_checksum; - checksum: culong); - cdecl; external av__format; deprecated; -function get_checksum(s: PAVIOContext): culong; - cdecl; external av__format; deprecated; -procedure put_strz(s: PAVIOContext; buf: {const} PAnsiChar); - cdecl; external av__format; deprecated; -(** @note unlike fgets, the EOL character is not returned and a whole - line is parsed. return NULL if first char read was EOF *) -function url_fgets(s: PAVIOContext; buf: PAnsiChar; buf_size: cint): PAnsiChar; - cdecl; external av__format; deprecated; -(** - * @deprecated use avio_get_str instead - *) -function get_strz(s: PAVIOContext; buf: PAnsiChar; maxlen: cint): PAnsiChar; - cdecl; external av__format; deprecated; -(** - * @deprecated Use AVIOContext.seekable field directly. - *) -function url_is_streamed(s: PAVIOContext): cint; {$IFDEF HasInline}inline;{$ENDIF} deprecated; - -function url_fileno(s: PAVIOContext): PURLContext; - cdecl; external av__format; deprecated; - -(** - * @deprecated use AVIOContext.max_packet_size directly. - *) -function url_fget_max_packet_size (s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -function url_open_buf(var s: PAVIOContext; buf: PAnsiChar; buf_size: cint; flags: cint): cint; - cdecl; external av__format; deprecated; - -(** return the written or read size *) -function url_close_buf(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -(** - * Return a non-zero value if the resource indicated by url - * exists, 0 otherwise. - * @deprecated Use avio_check instead. - *) -function url_exist(url: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; -{$IFEND} // FF_API_OLD_AVIO - -(** - * Return AVIO_FLAG_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - * - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * The callback is called in blocking functions to test regulary if - * asynchronous interruption is needed. AVERROR_EXIT is returned - * in this case by the interrupted function. 'NULL' means no interrupt - * callback is given. - *) -procedure avio_set_interrupt_cb(interrupt_cb: Pointer); - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const - (** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - - (** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonble - * means that can be extreemly slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @defgroup avio_read Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @defgroup open_modes URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @ - *) - -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = AVIO_FLAG_READ or AVIO_FLAG_WRITE; (**< read-write *) -(** - * @ - *) - -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) -const - AVIO_FLAG_NONBLOCK = 8; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * @return 0 on success, an AVERROR < 0 on error. - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * @note it is recommanded to use av_protocol_next() instead of this - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -{$IF (LIBAVFORMAT_VERSION_MAJOR < 54)} -function url_is_streamed(s: PAVIOContext): cint; -begin - Result := s^.is_streamed; -end; -{$IFEND} - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - -end. diff --git a/src/lib/ffmpeg-0.8/avutil.pas b/src/lib/ffmpeg-0.8/avutil.pas deleted file mode 100644 index c726fa4d..00000000 --- a/src/lib/ffmpeg-0.8/avutil.pas +++ /dev/null @@ -1,191 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 51.22.1 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 51; - LIBAVUTIL_MAX_VERSION_MINOR = 22; - LIBAVUTIL_MAX_VERSION_RELEASE = 2; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 51; - LIBAVUTIL_MIN_VERSION_MINOR = 9; - LIBAVUTIL_MIN_VERSION_RELEASE = 1; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, - AVMEDIA_TYPE_NB - ); - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1< - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 51.9.1 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; - AV_DICT_DONT_STRDUP_VAL = 8; - AV_DICT_DONT_OVERWRITE = 16; ///< Don't overwrite existing entries. - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.8/libavutil/error.pas b/src/lib/ffmpeg-0.8/libavutil/error.pas deleted file mode 100644 index 100d4bb4..00000000 --- a/src/lib/ffmpeg-0.8/libavutil/error.pas +++ /dev/null @@ -1,115 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 51.9.1 - * - *) - -(** - * @file - * error code definitions - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) - -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.8/libavutil/log.pas b/src/lib/ffmpeg-0.8/libavutil/log.pas deleted file mode 100644 index eda1e2cc..00000000 --- a/src/lib/ffmpeg-0.8/libavutil/log.pas +++ /dev/null @@ -1,188 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 51.9.1 - * - *) - -(** - * @file - * log - *) - -type -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for loging is stored. - * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such - * parent context. And a av_log() implementation could then display the parent context - * can be NULL of course - *) - parent_log_context_offset: cint; - - (** - * A function for extended searching, e.g. in possible - * children objects. - *) - opt_find: function(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; cdecl; - end; - - -const - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -#ifdef __GNUC__ -void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); -#else -void av_log(void*, int level, const char *fmt, ...); -#endif -**} - -type - va_list = pointer; - -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; dummy: va_list); - cdecl; external av__util; -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -function av_default_item_name (ctx: pointer): PAnsiChar; - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.8/libavutil/mathematics.pas b/src/lib/ffmpeg-0.8/libavutil/mathematics.pas deleted file mode 100644 index 36768a55..00000000 --- a/src/lib/ffmpeg-0.8/libavutil/mathematics.pas +++ /dev/null @@ -1,98 +0,0 @@ -(* - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 51.9.1 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = 0.0/0.0; - INFINITY = 1.0/0.0; - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5 ///< Round to nearest and halfway cases away from zero. - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.8/libavutil/mem.pas b/src/lib/ffmpeg-0.8/libavutil/mem.pas deleted file mode 100644 index 73bbf976..00000000 --- a/src/lib/ffmpeg-0.8/libavutil/mem.pas +++ /dev/null @@ -1,153 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 51.9.1 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -{ available only in 0.8.5 - 0.8.10 -function av_realloc_f(ptr: pointer; nelem: size_t; size: size_t): pointer; - cdecl; external av__util; -} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -(* available only in 0.8.5 - 0.8.10 -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} -*) - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * @param tab_ptr Pointer to the array. - * @param nb_ptr Pointer to the number of elements in the array. - * @param elem Element to be added. - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: PCint; elem: pointer); - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -{ available only in 0.8.5 - 0.8.10 -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -} -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} diff --git a/src/lib/ffmpeg-0.8/libavutil/opt.pas b/src/lib/ffmpeg-0.8/libavutil/opt.pas deleted file mode 100644 index 16bf0f26..00000000 --- a/src/lib/ffmpeg-0.8/libavutil/opt.pas +++ /dev/null @@ -1,259 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 51.9.1 - * - *) - -type - TAVOptionType = ( - FF_OPT_TYPE_FLAGS, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (dbl: cdouble); - 1: (str: PAnsiChar); - (* TODO those are unused now *) - 2: (i64: cint64); - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR(ENOENT) if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; -function av_set_q(obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; -function av_set_int(obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; -function av_get_double(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.8/libavutil/pixfmt.pas b/src/lib/ffmpeg-0.8/libavutil/pixfmt.pas deleted file mode 100644 index 552d4474..00000000 --- a/src/lib/ffmpeg-0.8/libavutil/pixfmt.pas +++ /dev/null @@ -1,207 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 51.9.1 - * - *) - -(** - * @file - * Pixel format - *) - -type -(** - * Pixel format. Notes: - * - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * Note, make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - PIX_FMT_NONE= -1, - PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - PIX_FMT_GRAY8, ///< Y , 8bpp - PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - PIX_FMT_XVMC_MPEG2_IDCT, - PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus - //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored seperately - //is better - PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - - PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - PIX_FMT_Y400A = PIX_FMT_GRAY8A; - -{$ifdef WORDS_BIGENDIAN} - PIX_FMT_RGB32 = PIX_FMT_ARGB; - PIX_FMT_RGB32_1 = PIX_FMT_RGBA; - PIX_FMT_BGR32 = PIX_FMT_ABGR; - PIX_FMT_BGR32_1 = PIX_FMT_BGRA; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16BE; - PIX_FMT_RGB48 = PIX_FMT_RGB48BE; - PIX_FMT_RGB565 = PIX_FMT_RGB565BE; - PIX_FMT_RGB555 = PIX_FMT_RGB555BE; - PIX_FMT_RGB444 = PIX_FMT_RGB444BE; - PIX_FMT_BGR48 = PIX_FMT_BGR48BE; - PIX_FMT_BGR565 = PIX_FMT_BGR565BE; - PIX_FMT_BGR555 = PIX_FMT_BGR555BE; - PIX_FMT_BGR444 = PIX_FMT_BGR444BE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9BE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9BE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10BE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10BE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10BE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16BE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16BE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16BE; -{$else} - PIX_FMT_RGB32 = PIX_FMT_BGRA; - PIX_FMT_RGB32_1 = PIX_FMT_ABGR; - PIX_FMT_BGR32 = PIX_FMT_RGBA; - PIX_FMT_BGR32_1 = PIX_FMT_ARGB; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16LE; - PIX_FMT_RGB48 = PIX_FMT_RGB48LE; - PIX_FMT_RGB565 = PIX_FMT_RGB565LE; - PIX_FMT_RGB555 = PIX_FMT_RGB555LE; - PIX_FMT_RGB444 = PIX_FMT_RGB444LE; - PIX_FMT_BGR48 = PIX_FMT_BGR48LE; - PIX_FMT_BGR565 = PIX_FMT_BGR565LE; - PIX_FMT_BGR555 = PIX_FMT_BGR555LE; - PIX_FMT_BGR444 = PIX_FMT_BGR444LE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9LE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9LE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10LE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10LE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10LE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16LE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16LE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16LE; -{$ENDIF} diff --git a/src/lib/ffmpeg-0.8/libavutil/samplefmt.pas b/src/lib/ffmpeg-0.8/libavutil/samplefmt.pas deleted file mode 100644 index c37a3740..00000000 --- a/src/lib/ffmpeg-0.8/libavutil/samplefmt.pas +++ /dev/null @@ -1,138 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 51.9.1 - * - *) - -type -(** - * all in native-endian format - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; deprecated; - cdecl; external av__util; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Fill channel data pointers and linesizes for samples with sample - * format sample_fmt. - * - * The pointers array is filled with the pointers to the samples data: - * for planar, set the start point of each plane's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The linesize array is filled with the aligned size of each samples - * plane, that is linesize[i] will contain the linesize of the plane i, - * and will be zero for all the unused planes. All linesize values are - * equal. - * - * @param pointers array to be filled with the pointer for each plane, may be NULL - * @param linesizes array to be filled with the linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_samples the number of samples in a single channel - * @param planar 1 if the samples layout is planar, 0 if it is packed - * @param nb_channels the number of channels - * @return the total size of the buffer, a negative - * error code in case of failure - *) -function av_samples_fill_arrays(pointers: OctArrayOfPcuint8; linesizes: OctArrayOfcint; - buf: Pcuint8; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; planar: cint; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and - * fill pointers and linesizes accordingly. - * The allocated samples buffer has to be freed by using - * av_freep(&pointers[0]). - * - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param planar 1 if the samples layout is planar, 0 if packed, - * @param align the value to use for buffer size alignment - * @return the size in bytes required for the samples buffer, a negative - * error code in case of failure - * @see av_samples_fill_arrays() - *) -function av_samples_alloc(pointers: OctArrayOfPcuint8; linesizes: OctArrayOfcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; planar: cint; - align: cint): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.8/rational.pas b/src/lib/ffmpeg-0.8/rational.pas deleted file mode 100644 index d3601ec5..00000000 --- a/src/lib/ffmpeg-0.8/rational.pas +++ /dev/null @@ -1,190 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 51.9.1 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -type - (* - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b and -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) >> 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num >> 31) - (b.num >> 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -end. diff --git a/src/lib/ffmpeg-0.8/swscale.pas b/src/lib/ffmpeg-0.8/swscale.pas deleted file mode 100644 index 923dbf18..00000000 --- a/src/lib/ffmpeg-0.8/swscale.pas +++ /dev/null @@ -1,467 +0,0 @@ -(* - * Copyright (C) 2001-2003 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.1.0 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 0; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -const -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(** - * Returns the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Returns the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Returns the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Returns a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Returns a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Returns a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocates an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initializes the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Frees the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IF FF_API_SWS_GETCONTEXT} -(** - * Allocates and returns a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scales the image slice in srcSlice and puts the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param context the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(context: PSwsContext; {const} srcSlice: PPCuint8Array; {const} srcStride: PCintArray; - srcSliceY: cint; srcSliceH: cint; {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -{$if LIBSWSCALE_VERSION_MAJOR < 1} -(** - * @deprecated. Use sws_scale() instead. - *) -function sws_scale_ordered(context: PSwsContext; {const} src: PPCuint8Array; - srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - dst: PPCuint8Array; dstStride: PCintArray): cint; - cdecl; external sw__scale; deprecated; -{$ifend} - -(** - * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] - * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235 - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocates and returns an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Returns a normalized Gaussian curve used to filter stuff - * quality=3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocates and returns a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocates and returns a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scales all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scales all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocates and returns a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -{$if LIBSWSCALE_VERSION_MAJOR < 1} -(** - * @deprecated Use sws_printVec2() instead. - *) -procedure sws_printVec(a: PSwsVector); - cdecl; external sw__scale; deprecated; -{$ifend} - -(** - * Prints with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Checks if context can be reused, otherwise reallocates a new - * one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Converts an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Converts an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.9/How to update the ffmpeg files.txt b/src/lib/ffmpeg-0.9/How to update the ffmpeg files.txt deleted file mode 100644 index 57c49fee..00000000 --- a/src/lib/ffmpeg-0.9/How to update the ffmpeg files.txt +++ /dev/null @@ -1,18 +0,0 @@ -how to update the ffmpeg files: - -1) rational.pas - error.pas -2) mathematics.pas - dict.pas - opt.pas - cpu.pas - log.pas - mem.pas - pixfmt.pas - samplefmt.pas -3) avutil.pas -4) avcodec.pas - audioconvert.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-0.9/ToDo.txt b/src/lib/ffmpeg-0.9/ToDo.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/src/lib/ffmpeg-0.9/avcodec.pas b/src/lib/ffmpeg-0.9/avcodec.pas deleted file mode 100644 index b766f290..00000000 --- a/src/lib/ffmpeg-0.9/avcodec.pas +++ /dev/null @@ -1,5007 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 53.42.0 - 53.42.4 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 53; - LIBAVCODEC_MAX_VERSION_MINOR = 42; - LIBAVCODEC_MAX_VERSION_RELEASE = 4; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 53; - LIBAVCODEC_MIN_VERSION_MINOR = 42; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const -{$ifndef FF_API_PALETTE_CONTROL} - FF_API_PALETTE_CONTROL = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_MM_FLAGS} - FF_API_MM_FLAGS = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_OPT_SHOW} - FF_API_OPT_SHOW = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_AUDIO_OLD} - FF_API_AUDIO_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_VIDEO_OLD} - FF_API_VIDEO_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_SUBTITLE_OLD} - FF_API_SUBTITLE_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_USE_LPC} - FF_API_USE_LPC = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_SET_STRING_OLD} - FF_API_SET_STRING_OLD = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_INOFFICIAL} - FF_API_INOFFICIAL = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_OLD_SAMPLE_FMT} - FF_API_OLD_SAMPLE_FMT = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_OLD_AUDIOCONVERT} - FF_API_OLD_AUDIOCONVERT = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_HURRY_UP} - FF_API_HURRY_UP = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_RATE_EMU} - FF_API_RATE_EMU = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_MB_Q} - FF_API_MB_Q = LIBAVCODEC_VERSION_MAJOR < 53; -{$endif} -{$ifndef FF_API_ANTIALIAS_ALGO} - FF_API_ANTIALIAS_ALGO = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_REQUEST_CHANNELS} - FF_API_REQUEST_CHANNELS = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_OPT_H} - FF_API_OPT_H = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_THREAD_INIT} - FF_API_THREAD_INIT = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_OLD_FF_PICT_TYPES} - FF_API_OLD_FF_PICT_TYPES = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_FLAC_GLOBAL_OPTS} - FF_API_FLAC_GLOBAL_OPTS = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} -{$ifndef FF_API_GET_PIX_FMT_NAME} - FF_API_GET_PIX_FMT_NAME = LIBAVCODEC_VERSION_MAJOR < 54; -{$endif} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -{$IF FF_API_OLD_AUDIOCONVERT} - {$I libavcodec/audioconvert.pas} -{$IFEND} - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independantly add CodecIDs without producing conflicts. - *) -type - TCodecID = ( - CODEC_ID_NONE, - - //* video codecs */ - CODEC_ID_MPEG1VIDEO, - CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - CODEC_ID_MPEG2VIDEO_XVMC, - CODEC_ID_H261, - CODEC_ID_H263, - CODEC_ID_RV10, - CODEC_ID_RV20, - CODEC_ID_MJPEG, - CODEC_ID_MJPEGB, - CODEC_ID_LJPEG, - CODEC_ID_SP5X, - CODEC_ID_JPEGLS, - CODEC_ID_MPEG4, - CODEC_ID_RAWVIDEO, - CODEC_ID_MSMPEG4V1, - CODEC_ID_MSMPEG4V2, - CODEC_ID_MSMPEG4V3, - CODEC_ID_WMV1, - CODEC_ID_WMV2, - CODEC_ID_H263P, - CODEC_ID_H263I, - CODEC_ID_FLV1, - CODEC_ID_SVQ1, - CODEC_ID_SVQ3, - CODEC_ID_DVVIDEO, - CODEC_ID_HUFFYUV, - CODEC_ID_CYUV, - CODEC_ID_H264, - CODEC_ID_INDEO3, - CODEC_ID_VP3, - CODEC_ID_THEORA, - CODEC_ID_ASV1, - CODEC_ID_ASV2, - CODEC_ID_FFV1, - CODEC_ID_4XM, - CODEC_ID_VCR1, - CODEC_ID_CLJR, - CODEC_ID_MDEC, - CODEC_ID_ROQ, - CODEC_ID_INTERPLAY_VIDEO, - CODEC_ID_XAN_WC3, - CODEC_ID_XAN_WC4, - CODEC_ID_RPZA, - CODEC_ID_CINEPAK, - CODEC_ID_WS_VQA, - CODEC_ID_MSRLE, - CODEC_ID_MSVIDEO1, - CODEC_ID_IDCIN, - CODEC_ID_8BPS, - CODEC_ID_SMC, - CODEC_ID_FLIC, - CODEC_ID_TRUEMOTION1, - CODEC_ID_VMDVIDEO, - CODEC_ID_MSZH, - CODEC_ID_ZLIB, - CODEC_ID_QTRLE, - CODEC_ID_SNOW, - CODEC_ID_TSCC, - CODEC_ID_ULTI, - CODEC_ID_QDRAW, - CODEC_ID_VIXL, - CODEC_ID_QPEG, - CODEC_ID_PNG, - CODEC_ID_PPM, - CODEC_ID_PBM, - CODEC_ID_PGM, - CODEC_ID_PGMYUV, - CODEC_ID_PAM, - CODEC_ID_FFVHUFF, - CODEC_ID_RV30, - CODEC_ID_RV40, - CODEC_ID_VC1, - CODEC_ID_WMV3, - CODEC_ID_LOCO, - CODEC_ID_WNV1, - CODEC_ID_AASC, - CODEC_ID_INDEO2, - CODEC_ID_FRAPS, - CODEC_ID_TRUEMOTION2, - CODEC_ID_BMP, - CODEC_ID_CSCD, - CODEC_ID_MMVIDEO, - CODEC_ID_ZMBV, - CODEC_ID_AVS, - CODEC_ID_SMACKVIDEO, - CODEC_ID_NUV, - CODEC_ID_KMVC, - CODEC_ID_FLASHSV, - CODEC_ID_CAVS, - CODEC_ID_JPEG2000, - CODEC_ID_VMNC, - CODEC_ID_VP5, - CODEC_ID_VP6, - CODEC_ID_VP6F, - CODEC_ID_TARGA, - CODEC_ID_DSICINVIDEO, - CODEC_ID_TIERTEXSEQVIDEO, - CODEC_ID_TIFF, - CODEC_ID_GIF, -{$IF LIBAVCODEC_VERSION_MAJOR = 53} - CODEC_ID_FFH264, -{$IFEND} - CODEC_ID_DXA, - CODEC_ID_DNXHD, - CODEC_ID_THP, - CODEC_ID_SGI, - CODEC_ID_C93, - CODEC_ID_BETHSOFTVID, - CODEC_ID_PTX, - CODEC_ID_TXD, - CODEC_ID_VP6A, - CODEC_ID_AMV, - CODEC_ID_VB, - CODEC_ID_PCX, - CODEC_ID_SUNRAST, - CODEC_ID_INDEO4, - CODEC_ID_INDEO5, - CODEC_ID_MIMIC, - CODEC_ID_RL2, -{$IF LIBAVCODEC_VERSION_MAJOR = 53} - CODEC_ID_8SVX_EXP, - CODEC_ID_8SVX_FIB, -{$IFEND} - CODEC_ID_ESCAPE124, - CODEC_ID_DIRAC, - CODEC_ID_BFI, - CODEC_ID_CMV, - CODEC_ID_MOTIONPIXELS, - CODEC_ID_TGV, - CODEC_ID_TGQ, - CODEC_ID_TQI, - CODEC_ID_AURA, - CODEC_ID_AURA2, - CODEC_ID_V210X, - CODEC_ID_TMV, - CODEC_ID_V210, - CODEC_ID_DPX, - CODEC_ID_MAD, - CODEC_ID_FRWU, - CODEC_ID_FLASHSV2, - CODEC_ID_CDGRAPHICS, - CODEC_ID_R210, - CODEC_ID_ANM, - CODEC_ID_BINKVIDEO, - CODEC_ID_IFF_ILBM, - CODEC_ID_IFF_BYTERUN1, - CODEC_ID_KGV1, - CODEC_ID_YOP, - CODEC_ID_VP8, - CODEC_ID_PICTOR, - CODEC_ID_ANSI, - CODEC_ID_A64_MULTI, - CODEC_ID_A64_MULTI5, - CODEC_ID_R10K, - CODEC_ID_MXPEG, - CODEC_ID_LAGARITH, - CODEC_ID_PRORES, - CODEC_ID_JV, - CODEC_ID_DFA, - CODEC_ID_WMV3IMAGE, - CODEC_ID_VC1IMAGE, -{$IF LIBAVCODEC_VERSION_MAJOR = 53} - CODEC_ID_G723_1_DEPRECATED, - CODEC_ID_G729_DEPRECATED, -{$IFEND} - CODEC_ID_UTVIDEO_DEPRECATED, - CODEC_ID_BMV_VIDEO, - CODEC_ID_VBLE, - CODEC_ID_DXTORY, - CODEC_ID_UTVIDEO = $800, -// CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), -// CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - - //* various PCM "codecs" */ -// CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - CODEC_ID_PCM_S16LE= $10000, - CODEC_ID_PCM_S16BE, - CODEC_ID_PCM_U16LE, - CODEC_ID_PCM_U16BE, - CODEC_ID_PCM_S8, - CODEC_ID_PCM_U8, - CODEC_ID_PCM_MULAW, - CODEC_ID_PCM_ALAW, - CODEC_ID_PCM_S32LE, - CODEC_ID_PCM_S32BE, - CODEC_ID_PCM_U32LE, - CODEC_ID_PCM_U32BE, - CODEC_ID_PCM_S24LE, - CODEC_ID_PCM_S24BE, - CODEC_ID_PCM_U24LE, - CODEC_ID_PCM_U24BE, - CODEC_ID_PCM_S24DAUD, - CODEC_ID_PCM_ZORK, - CODEC_ID_PCM_S16LE_PLANAR, - CODEC_ID_PCM_DVD, - CODEC_ID_PCM_F32BE, - CODEC_ID_PCM_F32LE, - CODEC_ID_PCM_F64BE, - CODEC_ID_PCM_F64LE, - CODEC_ID_PCM_BLURAY, - CODEC_ID_PCM_LXF, - CODEC_ID_S302M, - CODEC_ID_PCM_S8_PLANAR, - - //* various ADPCM codecs */ - CODEC_ID_ADPCM_IMA_QT = $11000, - CODEC_ID_ADPCM_IMA_WAV, - CODEC_ID_ADPCM_IMA_DK3, - CODEC_ID_ADPCM_IMA_DK4, - CODEC_ID_ADPCM_IMA_WS, - CODEC_ID_ADPCM_IMA_SMJPEG, - CODEC_ID_ADPCM_MS, - CODEC_ID_ADPCM_4XM, - CODEC_ID_ADPCM_XA, - CODEC_ID_ADPCM_ADX, - CODEC_ID_ADPCM_EA, - CODEC_ID_ADPCM_G726, - CODEC_ID_ADPCM_CT, - CODEC_ID_ADPCM_SWF, - CODEC_ID_ADPCM_YAMAHA, - CODEC_ID_ADPCM_SBPRO_4, - CODEC_ID_ADPCM_SBPRO_3, - CODEC_ID_ADPCM_SBPRO_2, - CODEC_ID_ADPCM_THP, - CODEC_ID_ADPCM_IMA_AMV, - CODEC_ID_ADPCM_EA_R1, - CODEC_ID_ADPCM_EA_R3, - CODEC_ID_ADPCM_EA_R2, - CODEC_ID_ADPCM_IMA_EA_SEAD, - CODEC_ID_ADPCM_IMA_EA_EACS, - CODEC_ID_ADPCM_EA_XAS, - CODEC_ID_ADPCM_EA_MAXIS_XA, - CODEC_ID_ADPCM_IMA_ISS, - CODEC_ID_ADPCM_G722, - - //* AMR */ - CODEC_ID_AMR_NB = $12000, - CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - CODEC_ID_RA_144= $13000, - CODEC_ID_RA_288, - - //* various DPCM codecs */ - CODEC_ID_ROQ_DPCM = $14000, - CODEC_ID_INTERPLAY_DPCM, - CODEC_ID_XAN_DPCM, - CODEC_ID_SOL_DPCM, - - //* audio codecs */ - CODEC_ID_MP2 = $15000, - CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - CODEC_ID_AAC, - CODEC_ID_AC3, - CODEC_ID_DTS, - CODEC_ID_VORBIS, - CODEC_ID_DVAUDIO, - CODEC_ID_WMAV1, - CODEC_ID_WMAV2, - CODEC_ID_MACE3, - CODEC_ID_MACE6, - CODEC_ID_VMDAUDIO, -{$IF LIBAVCODEC_VERSION_MAJOR = 53} - CODEC_ID_SONIC, - CODEC_ID_SONIC_LS, -{$IFEND} - CODEC_ID_FLAC, - CODEC_ID_MP3ADU, - CODEC_ID_MP3ON4, - CODEC_ID_SHORTEN, - CODEC_ID_ALAC, - CODEC_ID_WESTWOOD_SND1, - CODEC_ID_GSM, ///< as in Berlin toast format - CODEC_ID_QDM2, - CODEC_ID_COOK, - CODEC_ID_TRUESPEECH, - CODEC_ID_TTA, - CODEC_ID_SMACKAUDIO, - CODEC_ID_QCELP, - CODEC_ID_WAVPACK, - CODEC_ID_DSICINAUDIO, - CODEC_ID_IMC, - CODEC_ID_MUSEPACK7, - CODEC_ID_MLP, - CODEC_ID_GSM_MS, { as found in WAV } - CODEC_ID_ATRAC3, - CODEC_ID_VOXWARE, - CODEC_ID_APE, - CODEC_ID_NELLYMOSER, - CODEC_ID_MUSEPACK8, - CODEC_ID_SPEEX, - CODEC_ID_WMAVOICE, - CODEC_ID_WMAPRO, - CODEC_ID_WMALOSSLESS, - CODEC_ID_ATRAC3P, - CODEC_ID_EAC3, - CODEC_ID_SIPR, - CODEC_ID_MP1, - CODEC_ID_TWINVQ, - CODEC_ID_TRUEHD, - CODEC_ID_MP4ALS, - CODEC_ID_ATRAC1, - CODEC_ID_BINKAUDIO_RDFT, - CODEC_ID_BINKAUDIO_DCT, - CODEC_ID_AAC_LATM, - CODEC_ID_QDMC, - CODEC_ID_CELT, -{$IF LIBAVCODEC_VERSION_MAJOR > 53} - CODEC_ID_G723_1_DEPRECATED, - CODEC_ID_G729_DEPRECATED, - CODEC_ID_8SVX_EXP, - CODEC_ID_8SVX_FIB, -{$IFEND} - CODEC_ID_BMV_AUDIO, - CODEC_ID_G729 = $15800, - CODEC_ID_G723_1= $15801, -// CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), - - //* subtitle codecs */ -// CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - CODEC_ID_DVD_SUBTITLE= $17000, - CODEC_ID_DVB_SUBTITLE, - CODEC_ID_TEXT, ///< raw UTF-8 text - CODEC_ID_XSUB, - CODEC_ID_SSA, - CODEC_ID_MOV_TEXT, - CODEC_ID_HDMV_PGS_SUBTITLE, - CODEC_ID_DVB_TELETEXT, - CODEC_ID_SRT, -// CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - - //* other specific kind of codecs (generally used for attachments) */ -// CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - CODEC_ID_TTF= $18000, -// CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), -// CODEC_ID_XBIN = MKBETAG('X','B','I','N'), -// CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - - CODEC_ID_PROBE = $19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it - - CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - - CODEC_ID_G2M = $0047324D, - CODEC_ID_IDF = $00494446, - CODEC_ID_8SVX_RAW = $38535658, - CODEC_ID_BINTEXT = $42545854, - CODEC_ID_ESCAPE130 = $45313330, - CODEC_ID_XBIN = $5842494E, - CODEC_ID_MICRODVD = $6D445644 - - ); - -{$IF FF_API_OLD_SAMPLE_FMT} -type - TSampleFormat = TAVSampleFormat; - -const - SAMPLE_FMT_NONE = AV_SAMPLE_FMT_NONE; - SAMPLE_FMT_U8 = AV_SAMPLE_FMT_U8; - SAMPLE_FMT_S16 = AV_SAMPLE_FMT_S16; - SAMPLE_FMT_S32 = AV_SAMPLE_FMT_S32; - SAMPLE_FMT_FLT = AV_SAMPLE_FMT_FLT; - SAMPLE_FMT_DBL = AV_SAMPLE_FMT_DBL; - SAMPLE_FMT_NB = AV_SAMPLE_FMT_NB; -{$IFEND} - -{$IF FF_API_OLD_AUDIOCONVERT} - -const - {* Audio channel masks *} - CH_FRONT_LEFT = AV_CH_FRONT_LEFT; - CH_FRONT_RIGHT = AV_CH_FRONT_RIGHT; - CH_FRONT_CENTER = AV_CH_FRONT_CENTER; - CH_LOW_FREQUENCY = AV_CH_LOW_FREQUENCY; - CH_BACK_LEFT = AV_CH_BACK_LEFT; - CH_BACK_RIGHT = AV_CH_BACK_RIGHT; - CH_FRONT_LEFT_OF_CENTER = AV_CH_FRONT_LEFT_OF_CENTER; - CH_FRONT_RIGHT_OF_CENTER = AV_CH_FRONT_RIGHT_OF_CENTER; - CH_BACK_CENTER = AV_CH_BACK_CENTER; - CH_SIDE_LEFT = AV_CH_SIDE_LEFT; - CH_SIDE_RIGHT = AV_CH_SIDE_RIGHT; - CH_TOP_CENTER = AV_CH_TOP_CENTER; - CH_TOP_FRONT_LEFT = AV_CH_TOP_FRONT_LEFT; - CH_TOP_FRONT_CENTER = AV_CH_TOP_FRONT_CENTER; - CH_TOP_FRONT_RIGHT = AV_CH_TOP_FRONT_RIGHT; - CH_TOP_BACK_LEFT = AV_CH_TOP_BACK_LEFT; - CH_TOP_BACK_CENTER = AV_CH_TOP_BACK_CENTER; - CH_TOP_BACK_RIGHT = AV_CH_TOP_BACK_RIGHT; - CH_STEREO_LEFT = AV_CH_STEREO_LEFT; - CH_STEREO_RIGHT = AV_CH_STEREO_RIGHT; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - CH_LAYOUT_NATIVE = AV_CH_LAYOUT_NATIVE; - - {* Audio channel convenience macros *} - CH_LAYOUT_MONO = AV_CH_LAYOUT_MONO; - CH_LAYOUT_STEREO = AV_CH_LAYOUT_STEREO; - CH_LAYOUT_2_1 = AV_CH_LAYOUT_2_1; - CH_LAYOUT_SURROUND = AV_CH_LAYOUT_SURROUND; - CH_LAYOUT_4POINT0 = AV_CH_LAYOUT_4POINT0; - CH_LAYOUT_2_2 = AV_CH_LAYOUT_2_2; - CH_LAYOUT_QUAD = AV_CH_LAYOUT_QUAD; - CH_LAYOUT_5POINT0 = AV_CH_LAYOUT_5POINT0; - CH_LAYOUT_5POINT1 = AV_CH_LAYOUT_5POINT1; - CH_LAYOUT_5POINT0_BACK = AV_CH_LAYOUT_5POINT0_BACK; - CH_LAYOUT_5POINT1_BACK = AV_CH_LAYOUT_5POINT1_BACK; - CH_LAYOUT_7POINT0 = AV_CH_LAYOUT_7POINT0; - CH_LAYOUT_7POINT1 = AV_CH_LAYOUT_7POINT1; - CH_LAYOUT_7POINT1_WIDE = AV_CH_LAYOUT_7POINT1_WIDE; - CH_LAYOUT_STEREO_DOWNMIX = AV_CH_LAYOUT_STEREO_DOWNMIX; -{$IFEND} - -// not disabled for the moment KMS 05/2013 -//{$IFDEF FF_API_OLD_DECODE_AUDIO} -{* in bytes *} - AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio -//{$ENDIF} - -(** - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 16; - -(** - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - - TAVDiscard = ( - {* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *} - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_YCGCO = 8, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - -{$IF FF_API_FLAC_GLOBAL_OPTS} -(** - * LPC analysis type - *) - TAVLPCType = ( - AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type - AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients - AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients - AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion - AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization - AV_LPC_TYPE_NB ///< Not part of ABI - ); -{$IFEND} - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -{* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*} - - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - (** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - {* Fx : Flag for h263+ extra options *} - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_CBP_RD = $04000000; ///< use rate distortion optimization for cbp - CODEC_FLAG_QP_RD = $08000000; ///< use rate distortion optimization for qp selectioon - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_STRICT_GOP = $00000002; ///< strictly enforce GOP size - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_SKIP_RD = $00004000; ///< RD optimal MB level residual skipping - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe -(** - * @defgroup deprecated_flags Deprecated codec flags - * Use corresponding private codec options instead. - * @{ - *) -{$IFDEF FF_API_MPEGVIDEO_GLOBAL_OPTS} - CODEC_FLAG_OBMC = $00000001; ///< OBMC - CODEC_FLAG_H263P_AIV = $00000008; ///< H.263 alternative inter VLC - CODEC_FLAG_PART = $0080; ///< Use data partitioning. - CODEC_FLAG_ALT_SCAN = $00100000; ///< Use alternate scan. - CODEC_FLAG_H263P_UMV = $02000000; ///< unlimited motion vector - CODEC_FLAG_H263P_SLICE_STRUCT = $10000000; - CODEC_FLAG_SVCD_SCAN_OFFSET = $40000000; ///< Will reserve space for SVCD scan offset user data. - CODEC_FLAG2_INTRA_VLC = $00000800; ///< Use MPEG-2 intra VLC table. - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. - CODEC_FLAG2_NON_LINEAR_QUANT = $00010000; ///< Use MPEG-2 nonlinear quantizer. -{$ENDIF} -{$IFDEF FF_API_MJPEG_GLOBAL_OPTS} - CODEC_FLAG_EXTERN_HUFF = $1000; ///< Use external Huffman table (for MJPEG). -{$ENDIF} -{$IFDEF FF_API_X264_GLOBAL_OPTS} - CODEC_FLAG2_BPYRAMID = $00000010; ///< H.264 allow b-frames to be used as references - CODEC_FLAG2_WPRED = $00000020; ///< H.264 weighted biprediction for b-frames - CODEC_FLAG2_MIXED_REFS = $00000040; ///< H.264 multiple references per partition - CODEC_FLAG2_8X8DCT = $00000080; ///< H.264 high profile 8x8 transform - CODEC_FLAG2_FASTPSKIP = $00000100; ///< H.264 fast pskip - CODEC_FLAG2_AUD = $00000200; ///< H.264 access unit delimiters - CODEC_FLAG2_BRDO = $00000400; ///< b-frame rate-distortion optimization - CODEC_FLAG2_MBTREE = $00040000; ///< Use macroblock tree ratecontrol (x264 only) - CODEC_FLAG2_PSY = $00080000; ///< Use psycho visual optimizations. - CODEC_FLAG2_SSIM = $00100000; ///< Compute SSIM during encoding, error[] values are undefined. - CODEC_FLAG2_INTRA_REFRESH = $00200000; ///< Use periodic insertion of intra blocks instead of keyframes. -{$ENDIF} -{$IFDEF FF_API_SNOW_GLOBAL_OPTS} - CODEC_FLAG2_MEMC_ONLY = $00001000; ///< only do ME/MC (I frames -> ref, P frame -> ME+MC) -{$ENDIF} -{$IFDEF FF_API_LAME_GLOBAL_OPTS} - CODEC_FLAG2_BIT_RESERVOIR = $00020000; ///< Use a bit reservoir when encoding if possible -{$ENDIF} - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - - (** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; -{$IFDEF FF_API_PARSE_FRAME} - (* if 'parse_only' field is true, then avcodec_parse_frame() can be used *) - CODEC_CAP_PARSE_ONLY = $0004; -{$ENDIF} - CODEC_CAP_TRUNCATED = $0008; - - (* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - - (** - * Codec has a nonzero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. If this is not set, the codec is guaranteed to never be fed - * with NULL data. - *) - CODEC_CAP_DELAY = $0020; - - (** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - - (** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - - (** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - - (** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - - (** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - - (** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - - (** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - - (** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - - (** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - -{$IF FF_API_OLD_FF_PICT_TYPES} -(* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values *) - FF_I_TYPE = 1; ///< Intra - FF_P_TYPE = 2; ///< Predicted - FF_B_TYPE = 3; ///< Bi-dir predicted - FF_S_TYPE = 4; ///< S(GMC)-VOP MPEG4 - FF_SI_TYPE = 5; ///< Switching Intra - FF_SP_TYPE = 6; ///< Switching Predicted - FF_BI_TYPE = 7; -{$IFEND} - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - //FF_BUG_FAKE_SCALABILITY = 16 //Autodetection should work 100%. - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_ER_CAREFUL = 1; - FF_ER_COMPLIANT = 2; - FF_ER_AGGRESSIVE = 3; - FF_ER_VERY_AGGRESSIVE = 4; - FF_ER_EXPLODE = 5; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_LIBMPEG2MMX = 4; - FF_IDCT_PS2 = 5; - FF_IDCT_MLIB = 6; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_H264 = 11; - FF_IDCT_VP3 = 12; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_CAVS = 15; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_WMV2 = 19; - FF_IDCT_FAAN = 20; - FF_IDCT_EA = 21; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - FF_IDCT_BINK = 24; - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - -{$IF FF_API_ANTIALIAS_ALGO} - FF_AA_AUTO = 0; - FF_AA_FASTINT = 1; //not implemented yet - FF_AA_INT = 2; - FF_AA_FLOAT = 3; -{$IFEND} - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - FF_PROFILE_H264_CONSTRAINED = (1<<9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1<<11); // 8+3; constraint_set3_flag - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_LEVEL_UNKNOWN = -99; - - X264_PART_I4X4 = $001; (* Analyse i4x4 *) - X264_PART_I8X8 = $002; (* Analyse i8x8 (requires 8x8 transform) *) - X264_PART_P8X8 = $010; (* Analyse p16x8, p8x16 and p8x8 *) - X264_PART_P4X4 = $020; (* Analyse p8x4, p4x8, p4x4 *) - X264_PART_B8X8 = $100; (* Analyse b16x8, b8x16 and b8x8 *) - - FF_COMPRESSION_DEFAULT = -1; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; - AV_EF_BUFFER = 4; - AV_EF_EXPLODE = 8; - - AV_EF_CAREFUL = 65536; - AV_EF_COMPLIANT = 131072; - AV_EF_AGGRESSIVE = 262144; - - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type - TAVPacketSideDataType = (AV_PKT_DATA_PALETTE); - - PAVPacket = ^TAVPacket; - TAVPacket = record -(* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; -(* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; -(** - * A combination of AV_PKT_FLAG values - *) - flags: cint; -(** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: pointer; - { - record - data: Pcuint8; - size: cint; - type_: TAVPacketSideDataType; - end; - } - side_data_elems: cint; - -(* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; - pos: cint64; // byte position in stream, -1 if unknown - -(* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - -{$IFDEF FF_API_DATA_POINTERS} - AV_NUM_DATA_POINTERS = 4; -{$ELSE} - AV_NUM_DATA_POINTERS = 8; -{$ENDIF} - -type - PAVCodecContext = ^TAVCodecContext; - - (** - * Audio Video Frame. - * New fields can be added to the end of AVFRAME with minor version - * bumps. Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - * Removal, reordering and changes in the remaining cases require - * a major version bump. - * sizeof(AVFrame) must not be used outside libavcodec. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user (video only) - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * buffer age (1->was last buffer and dint change, 2->..., ...). - * Set to INT_MAX if the buffer has not been used yet. - * - encoding: unused - * - decoding: MUST be set by get_buffer(). - *) - age: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: byte; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * - *) - qscale_type: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * reordered pts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: unused - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: unused - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: PPointer; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * reordered sample aspect ratio for the video frame, 0/1 if unknown\unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * format of the frame, -1 if unknown or unset - * It should be cast to the corresponding enum (enum PixelFormat - * for video, enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - end; {TAVFrame} - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - -{$IF FF_API_PALETTE_CONTROL} -(** - * AVPaletteControl - * This structure defines a method for communicating palette changes - * between and demuxer and a decoder. - * - * @deprecated Use AVPacket to send palette changes instead. - * This is totally broken. - *) - PAVPaletteControl = ^TAVPaletteControl; - TAVPaletteControl = record - (* demuxer sets this to 1 to indicate the palette has changed; - * decoder resets to 0 *) - palette_changed: cint; - - (* 4-byte ARGB palette entries, stored in native byte order; note that - * the individual palette components should be on a 8-bit scale; if - * the palette data comes from a IBM VGA native format, the component - * data is probably 6 bits in size and needs to be scaled *) - palette: array [0..AVPALETTE_COUNT - 1] of cuint; - end; {deprecated;} -{$IFEND} - - (** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * Some codecs need additional format info. It is stored here. - * If any muxer uses this then ALL demuxers/parsers AND encoders for the - * specific codec MUST set it correctly otherwise stream copy breaks. - * In general use of this field by muxers is not recommanded. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. (FIXME: Is this OK?) - *) - sub_id: cint; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid prolems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - * Note: For compatibility it is possible to set this instead of - * coded_width/height before decoding. - *) - width, height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overriden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Samples per packet, initialized when calling 'init'. - *) - frame_size: cint; - frame_number: cint; ///< audio or video frame number - - (** - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - codec: PAVCodec; - - priv_data: pointer; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - codec_name: array [0..31] of AnsiChar; - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec_id: TCodecID; (* see CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger then 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - luma_elim_threshold: cint; - - (** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - chroma_elim_threshold: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - -{$IFDEF FF_API_ER} - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; {deprecated} -{$ENDIF} - - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - -{$IFDEF FF_API_PARSE_FRAME} - (** - * If true, only parsing is done. The frame data is returned. - * Only MPEG audio decoders support this now. - * - encoding: unused - * - decoding: Set by user - *) - parse_only: cint; {deprecated} -{$ENDIF} - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override: PRcOverride; - rc_override_count: cint; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - rc_buffer_aggressivity: cfloat; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * dsp_mask could be add used to disable unwanted CPU features - * CPU features (i.e. MMX, SSE. ...) - * - * With the FORCE flag you may instead enable given CPU features. - * (Dangerous: Usable in case of misdetection, improper usage however will - * result into program crash.) - *) - dsp_mask: cuint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - *) - color_table_id: cint; - -{$IFDEF FF_API_INTERNAL_CONTEXT} - (** - * internal_buffer count - * Don't touch, used by libavcodec default_get_buffer(). - * @deprecated this field was moved to an internal context - *) - internal_buffer_count: cint; {deprecated} - - (** - * internal_buffers - * Don't touch, used by libavcodec default_get_buffer(). - * @deprecated this field was moved to an internal context - *) - internal_buffer: pointer; {deprecated} -{$ENDIF} - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - { - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - realloc: function (s: PAVCodecContext; buf: Pbyte; buf_size: cint): Pbyte; cdecl; - } - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: array [0..3] of AnsiChar; //cuint; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - -{$IF FF_API_PALETTE_CONTROL} - (** - * palette control structure - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by user. - *) - palctrl: PAVPaletteControl; -{$IFEND} - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - inter_threshold: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - -{$IF FF_API_ANTIALIAS_ALGO} - (** - * MP3 antialias algorithm, see FF_AA_* below. - * - encoding: unused - * - decoding: Set by user. - *) - antialias_algo: cint; {deprecated} -{$IFEND} - - (** - * quantizer noise shaping - * - encoding: Set by user. - * - decoding: unused - *) - quantizer_noise_shaping: cint; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; - - (** - * Bitstream width / height, may be different from width/height if lowres enabled. - * - encoding: unused - * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. - *) - coded_width, coded_height: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - -{$IFDEF FF_API_X264_GLOBAL_OPTS} - (** - * constant rate factor - quality-based VBR - values ~correspond to qps - * - encoding: Set by user. - * - decoding: unused - * @deprecated use 'crf' libx264 private option - *) - crf: cfloat; {deprecated} - - (** - * constant quantization parameter rate control method - * - encoding: Set by user. - * - decoding: unused - * @deprecated use 'cqp' libx264 private option - *) - cqp: cint; {deprecated} -{$ENDIF} - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - -{$IFDEF FF_API_X264_GLOBAL_OPTS} - (** - * Influences how often B-frames are used. - * - encoding: Set by user. - * - decoding: unused - *) - bframebias: cint; {deprecated} -{$ENDIF} - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - -{$IFDEF FF_API_X264_GLOBAL_OPTS} - (** - * Reduce fluctuations in qp (before curve compression). - * - encoding: Set by user. - * - decoding: unused - *) - complexityblur: cfloat; {deprecated} - - (** - * in-loop deblocking filter alphac0 parameter - * alpha is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockalpha: cint; {deprecated} - - (** - * in-loop deblocking filter beta parameter - * beta is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockbeta: cint; {deprecated} - - (** - * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4 - * - encoding: Set by user. - * - decoding: unused - *) - partitions: cint; {deprecated} - - (** - * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto) - * - encoding: Set by user. - * - decoding: unused - *) - directpred: cint; {deprecated} -{$ENDIF} - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjusts sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - -{$IF FF_API_FLAC_GLOBAL_OPTS} - (** - * @defgroup flac_opts FLAC options - * @deprecated Use FLAC encoder private options instead. - * @{ - *) - - (** - * LPC coefficient precision - used by FLAC encoder - * - encoding: Set by user. - * - decoding: unused - *) - lpc_coeff_precision: cint; {deprecated} - - (** - * search method for selecting prediction order - * - encoding: Set by user. - * - decoding: unused - *) - prediction_order_method: cint; {deprecated} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_partition_order: cint; {deprecated} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_partition_order: cint; {deprecated} -{$IFEND} - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - -{$IF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - -{$IFDEF FF_API_DRC_SCALE} - (** - * Percentage of dynamic range compression to be applied by the decoder. - * The default value is 1.0, corresponding to full compression. - * - encoding: unused - * - decoding: Set by user. - * @deprecated use AC3 decoder private option instead. - *) - drc_scale: cfloat; {deprecated} -{$ENDIF} - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * This field is applicable only when sample_fmt is AV_SAMPLE_FMT_S32. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - -{$IFDEF FF_API_X264_GLOBAL_OPTS} - (** - * explicit P-frame weighted prediction analysis method - * 0: off - * 1: fast blind weighting (one reference duplicate with -1 offset) - * 2: smart weighting (full fade detection analysis) - * - encoding: Set by user. - * - decoding: unused - *) - weighted_p_pred: cint; {deprecated} - - (** - * AQ mode - * 0: Disabled - * 1: Variance AQ (complexity mask) - * 2: Auto-variance AQ (experimental) - * - encoding: Set by user - * - decoding: unused - *) - aq_mode: cint; {deprecated} - - (** - * AQ strength - * Reduces blocking and blurring in flat and textured areas. - * - encoding: Set by user - * - decoding: unused - *) - aq_strength: cfloat; {deprecated} - - (** - * PSY RD - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_rd: cfloat; {deprecated} - - (** - * PSY trellis - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_trellis: cfloat; {deprecated} - - (** - * RC lookahead - * Number of frames for frametype and ratecontrol lookahead - * - encoding: Set by user - * - decoding: unused - *) - rc_lookahead: cint; {deprecated} - - (** - * Constant rate factor maximum - * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse - * than crf_max, even if doing so would violate VBV restrictions. - * - encoding: Set by user. - * - decoding: unused - *) - crf_max: cfloat; {deprecated} -{$ENDIF} - - log_level_offset: cint; - -{$IF FF_API_FLAC_GLOBAL_OPTS} - (** - * Determines which LPC analysis algorithm to use. - * - encoding: Set by user - * - decoding: unused - *) - lpc_type: TAVLPCType; {deprecated} - - (** - * Number of passes to use for Cholesky factorization during LPC analysis - * - encoding: Set by user - * - decoding: unused - *) - lpc_passes: cint; {deprecated} -{$IFEND} - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - -{$IFDEF FF_API_INTERNAL_CONTEXT} - (** - * Whether this is a copy of the context which had init() called on it. - * This is used by multithreading - shared tables and picture pointers - * should be freed from the original context only. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - * - * @deprecated this field has been moved to an internal context - *) - is_copy: cint; {deprecated} -{$ENDIF} - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: pointer; - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - -(** - * AVCodec. - *) - TAVCodec = record - name: PAnsiChar; - type_: TAVMediaType; - id: TCodecID; - priv_data_size: cint; - init: function (avctx: PAVCodecContext): cint; cdecl; - encode: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; data: pointer): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - next: PAVCodec; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (** - * @defgroup framethreading Frame-level threading support functions. - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See CODEC_ID_xxx - *) - id: TCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The pressentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(* packet functions *) - -(** - * @deprecated use NULL instead - *) -procedure av_destruct_packet_nofree(pkt: PAVPacket); - cdecl; external av__codec; deprecated; - -(* - * Default packet destructor. - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): Pcuint8; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): Pcuint8; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(* resample.c *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occured - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields. - * The fields of the given AVPicture are filled in by using the 'ptr' address - * which points to the image data buffer. Depending on the specified picture - * format, one or multiple image data pointers and line sizes will be set. - * If a planar format is specified, several pointers will be set pointing to - * the different picture planes and the line sizes of the different planes - * will be stored in the lines_sizes array. - * Call with ptr == NULL to get the required size for the ptr buffer. - * - * @param picture AVPicture whose fields are to be filled in - * @param ptr Buffer which will contain or contains the actual image data - * @param pix_fmt The format in which the picture data is stored. - * @param width the width of the image in pixels - * @param height the height of the image in pixels - * @return size of the image data in bytes - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer. - * The data is stored compactly, without any gaps for alignment or padding - * which may be applied by avpicture_fill(). - * - * @see avpicture_get_size() - * - * @param[in] src AVPicture containing image data - * @param[in] pix_fmt The format in which the picture data is stored. - * @param[in] width the width of the image in pixels. - * @param[in] height the height of the image in pixels. - * @param[out] dest A buffer into which picture data will be copied. - * @param[in] dest_size The size of 'dest'. - * @return The number of bytes written to dest, or a negative value (error code) on error. - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Note that this returns the size of a compact representation as generated - * by avpicture_layout, which can be smaller than the size required for e.g. - * avpicture_fill. - * - * @param pix_fmt the given picture format - * @param width the width of the image - * @param height the height of the image - * @return Image data size in bytes or -1 on error (e.g. too large dimensions). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TCodecID): PAnsiChar; - cdecl; external av__codec; - -{$IF FF_API_GET_PIX_FMT_NAME} -(** - * Return the short name for a pixel format. - * - * \see av_get_pix_fmt(), av_get_pix_fmt_string(). - * @deprecated Deprecated in favor of av_get_pix_fmt_name(). - *) -function avcodec_get_pix_fmt_name(pix_fmt: TAVPixelFormat): PAnsiChar; - cdecl; external av__codec; deprecated; -{$IFEND} - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; {**< loss due to resolution change *} - FF_LOSS_DEPTH = $0002; {**< loss due to color depth change *} - FF_LOSS_COLORSPACE = $0004; {**< loss due to color space conversion *} - FF_LOSS_ALPHA = $0008; {**< loss of alpha bits *} - FF_LOSS_COLORQUANT = $0010; {**< loss due to color quantization *} - FF_LOSS_CHROMA = $0020; {**< loss of chroma (e.g. RGB to gray conversion) *} - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur - * (maximum loss for an invalid dst_pix_fmt). - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_mask parameter. - * - * Note, only the first 64 pixel formats will fit in pix_fmt_mask. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << PIX_FMT_YUV422P) | (1 << PIX_FMT_RGB24); - * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint64; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format and a selection of two destination pixel formats. When converting from - * one pixel format to another, information loss may occur. For example, when converting - * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when - * converting from some formats to other formats. avcodec_find_best_pix_fmt2() selects which of - * the given pixel formats should be used to suffer the least amount of loss. - * - * If one of the destination formats is PIX_FMT_NONE the other pixel format (if valid) will be - * returned. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * dst_pix_fmt1= PIX_FMT_RGB24; - * dst_pix_fmt2= PIX_FMT_GRAY8; - * dst_pix_fmt3= PIX_FMT_RGB8; - * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. - * dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); - * dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from - * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from - * @param[in] src_pix_fmt Source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. - * NULL or value of zero means we care about all losses. Out: the loss - * that occurs when converting from src to selected dst pixel format. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF FF_API_GET_ALPHA_INFO} -const - FF_ALPHA_TRANSP = $0001; {* image has some totally transparent pixels *} - FF_ALPHA_SEMI_TRANSP = $0002; {* image has some transparent pixels *} - -(** - * Tell if an image really has transparent alpha values. - * @return ored mask of FF_ALPHA_xxx constants - *) -function img_get_alpha_info (src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; {deprecated} - cdecl; external av__codec; -{$ENDIF} - -(* deinterlace a picture *) -(* deinterlace - if not supported return -1 *) -function avpicture_deinterlace (dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; - cdecl; external av__codec; - -(* external high level API *) - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -{$IFDEF FF_API_AVCODEC_INIT} -(** - * @deprecated this function is called automatically from avcodec_register() - * and avcodec_register_all(), there is no need to call it manually - *) -procedure avcodec_init(); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id CodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -{$IFDEF FF_API_ALLOC_CONTEXT} -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - * @deprecated use avcodec_get_context_defaults3 - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: PAVCodec); - cdecl; external av__codec; - -{$IFDEF FF_API_ALLOC_CONTEXT} -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - * - * @deprecated use avcodec_alloc_context3() - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param pic The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults (pic: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct can be deallocated by simply calling av_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -{$IF FF_API_THREAD_INIT} -(** - * @deprecated Set s->thread_count before calling avcodec_open2() instead of calling this. - *) -function avcodec_thread_init(s: PAVCodecContext; thread_count: cint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -{$IFDEF FF_API_AVCODEC_OPEN} -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec;; deprecated; -{$ENDIF} - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -// not disabled for the moment KMS 05/2013 -//{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -//{$ENDIF} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The - * decoder may, however, only utilize part of the buffer by - * setting AVFrame.nb_samples to a smaller value in the - * output frame. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Frees all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * Encode an audio frame from samples into buf. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for PCM audio the user will know how much space is needed - * because it depends on the value passed in buf_size as described - * below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For PCM audio the number of samples read from samples is equal to - * buf_size * input_sample_size / output_sample_size. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; - -(** - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -procedure avcodec_default_free_buffers(s: PAVCodecContext); - cdecl; external av__codec; - -(* misc useful functions *) - -{$IF FF_API_OLD_FF_PICT_TYPES} -(** - * Return a single letter to describe the given picture type pict_type. - * - * @param[in] pict_type the picture type - * @return A single character representing the picture type. - * @deprecated Use av_get_picture_type_char() instead. - *) -function av_get_pict_type_char(pict_type: cint): AnsiChar; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TCodecID): cint; - cdecl; external av__codec; - -{$IF FF_API_OLD_SAMPLE_FMT} -(** - * @deprecated Use av_get_bits_per_sample_fmt() instead. - *) -function av_get_bits_per_sample_format(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Copy image src to dst. Wraps av_picture_data_copy() above. - *) -procedure av_picture_copy(dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - top_band: cint; - left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; - src: {const} PAVPicture; - height: cint; - width: cint; - pix_fmt: TAVPixelFormat; - padtop: cint; - padbottom: cint; - padleft: cint; - padright: - cint; - color: PCint): cint; - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.9/avformat.pas b/src/lib/ffmpeg-0.9/avformat.pas deleted file mode 100644 index d8f7a3c0..00000000 --- a/src/lib/ffmpeg-0.9/avformat.pas +++ /dev/null @@ -1,2115 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 0.9 libavformat/avformat.h - * Min. version: 53.24.0 - * Max. version: 53.24.2 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 0.9x - * This file has been created with the previous ffmpeg headers as a basis - * by removing all unneeded conditionals. - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 53; - LIBAVFORMAT_MAX_VERSION_MINOR = 24; - LIBAVFORMAT_MAX_VERSION_RELEASE = 2; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 53; - LIBAVFORMAT_MIN_VERSION_MINOR = 24; - LIBAVFORMAT_MIN_VERSION_RELEASE = 0; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -type - PAVFile = Pointer; - -(* - * Public Metadata API. - * The metadata API allows libavformat to export metadata tags to a client - * application using a sequence of key/value pairs. Like all strings in FFmpeg, - * metadata must be stored as UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * Important concepts to keep in mind: - * 1. Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * 2. Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * 3. Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * a) language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * b) sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * 4. Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - * album -- name of the set this work belongs to - * album_artist -- main creator of the set/album, if different from artist. - * e.g. "Various Artists" for compilation albums. - * artist -- main creator of the work - * comment -- any additional description of the file. - * composer -- who composed the work, if different from artist. - * copyright -- name of copyright holder. - * creation_time-- date when the file was created, preferably in ISO 8601. - * date -- date when the work was created, preferably in ISO 8601. - * disc -- number of a subset, e.g. disc in a multi-disc collection. - * encoder -- name/settings of the software/hardware that produced the file. - * encoded_by -- person/group who created the file. - * filename -- original name of the file. - * genre -- . - * language -- main language in which the work is performed, preferably - * in ISO 639-2 format. Multiple languages can be specified by - * separating them with commas. - * performer -- artist who performed the work, if different from artist. - * E.g for "Also sprach Zarathustra", artist would be "Richard - * Strauss" and performer "London Philharmonic Orchestra". - * publisher -- name of the label/publisher. - * service_name -- name of the service in broadcasting (channel name). - * service_provider -- name of the service provider in broadcasting. - * title -- name of the work. - * track -- number of this work in the set, can be in form current/total. - * variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - *) - -{$IF FF_API_OLD_METADATA2} -(** - * @defgroup old_metadata Old metadata API - * The following functions are deprecated, use - * their equivalents from libavutil/dict.h instead. - * @ - *) - -const - AV_METADATA_MATCH_CASE = AV_DICT_MATCH_CASE; - AV_METADATA_IGNORE_SUFFIX = AV_DICT_IGNORE_SUFFIX; - AV_METADATA_DONT_STRDUP_KEY = AV_DICT_DONT_STRDUP_KEY; - AV_METADATA_DONT_STRDUP_VAL = AV_DICT_DONT_STRDUP_VAL; - AV_METADATA_DONT_OVERWRITE = AV_DICT_DONT_OVERWRITE; - -type - PAVMetadataTag = ^TAVMetadataTag; - TAVMetadataTag = record - key: PAnsiChar; - value: PAnsiChar; - end; - - PAVMetadata = Pointer; - PAVDictionary = PAVMetadata; - PAVDictionaryEntry = PAVMetadata; - -(** - * Get a metadata element with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found tag or NULL, changing key or value leads to undefined behavior. - *) -function av_metadata_get(m: PAVDictionary; key: {const} PAnsiChar; - prev: {const} PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__format; - -(** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped depending on flags) - * @param value tag value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_metadata_set2(var pm: PAVDictionary; key: {const} PAnsiChar; value: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PByteIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - - //! Demuxer will use url_fopen, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fallback to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fallback to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_TS_NONSTRICT = $8000000; (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - - AVFMT_NOOUTPUTLOOP = -1; - AVFMT_INFINITEOUTPUTLOOP = 0; - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_RTP_HINT = $0040; ///< Add RTP hinting to the output file - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - MAX_STD_TIMEBASES = (60*12+5); - - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVFormatParameters = ^TAVFormatParameters; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - TAVFormatParameters = record - time_base: TAVRational; - sample_rate: cint; - channels: cint; - width: cint; - height: cint; - pix_fmt: TAVPixelFormat; - channel: cint; (**< Used to select DV channel. *) - standard: PAnsiChar; (**< TV standard, NTSC, PAL, SECAM *) - { Delphi does not support bit fields -> use bf_flags instead - unsigned int mpeg2ts_raw:1; (**< Force raw MPEG-2 transport stream output, if possible. *) - unsigned int mpeg2ts_compute_pcr:1; (**< Compute exact PCR for each transport - stream packet (only meaningful if - mpeg2ts_raw is TRUE). *) - unsigned int initial_pause:1; (**< Do not begin to play the stream - immediately (RTSP only). *) - unsigned int prealloced_context:1; - } - bf_flags: byte; // 0:mpeg2ts_raw/1:mpeg2ts_compute_pcr/2:initial_pause/3:prealloced_context - end; - - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - (* output support *) - audio_codec: TCodecID; (**< default audio codec *) - video_codec: TCodecID; (**< default video codec *) - write_header: function (c: PAVFormatContext): cint; cdecl; - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS - *) - flags: cint; - - dummy: pointer; - - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - subtitle_codec: TCodecID; (**< default subtitle codec *) - -{$IF FF_API_OLD_METADATA2} - {const} metadata_conv: PAVMetadataConv; -{$IFEND} - - {const} priv_class: PAVClass; ///< AVClass for the private context - - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - *) - query_codec: function (id: TCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (* private fields *) - next: PAVOutputFormat; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @{ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. 'ap' if non-NULL contains - * additional parameters. Only used in raw format right - * now. 'av_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext; - ap: PAVFormatParameters): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'av_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - -{$IF FF_API_READ_SEEK} - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; {deprecated;} -{$IFEND} - - (** - * Gets the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - (** - * General purpose read-only value that the format can use. - *) - value: cint; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - codec_tag: {const} PPAVCodecTag; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - {const} metadata_conv: PAVMetadataConv; - - (* private fields *) - next: PAVInputFormat; - end; - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - duration_error: array[0..1] of array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - codec_info_duration: cint64; - nb_decoded_frames: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - id: cint; (**< format-specific stream ID *) - codec: PAVCodecContext; (**< codec context *) - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - *) - r_frame_rate: TAVRational; - priv_data: pointer; - -{$IFDEF FF_API_REORDER_PRIVATE} - (* internal data used in av_find_stream_info() *) - first_dts: cint64; -{$ENDIF} - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * time base should be 1/framerate and timestamp increments should be 1. - *) - time_base: TAVRational; -{$IFDEF FF_API_REORDER_PRIVATE} - pts_wrap_bits: cint; (* number of bits in pts (used for wrapping control) *) -{$ENDIF} -{$IFDEF FF_API_STREAM_COPY} - (* ffmpeg.c private use *) - stream_copy: cint; (**< If set, just copy stream. *) {deprecated} -{$ENDIF} - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. -{$IFDEF FF_API_AVSTREAM_QUALITY} - //FIXME move stuff to a flags field? - (** - * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. - * MN:dunno if thats the right place, for it - *) - quality: cfloat; {deprecated} -{$ENDIF} - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - -{$IFDEF FF_API_REORDER_PRIVATE} - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - cur_dts: cint64; - last_IP_duration: cint; - last_IP_pts: cint64; - (* av_seek_frame() support *) - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; -{$ENDIF} - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - -{$IFDEF FF_API_REORDER_PRIVATE} - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; -{$ENDIF} - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVMetadata; - -{$IFDEF FF_API_REORDER_PRIVATE} - {* Intended mostly for av_read_frame() support. Not supposed to be used by *} - {* external applications; try to use something else if at all possible. *} - cur_ptr: {const} PCuint8; - cur_len: cint; - cur_pkt: TAVPacket; - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - - (** - * Number of packets to buffer for codec probing - * NOT PART OF PUBLIC API - *) - probe_packets: cint; - - (** - * last packet in packet_buffer for this stream when muxing. - * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav* - *) - last_in_packet_buffer: PAVPacketList; -{$ENDIF} - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - (** - * flag to indicate that probing is requested - * NOT PART OF PUBLIC API - *) - request_probe: cint; -{$IFNDEF FF_API_REORDER_PRIVATE} - {const} cur_ptr: PByte; - cur_len: cint; - cur_pkt: TAVPacket; - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - first_dts: cint64; - cur_dts: cint64; - last_IP_duration: cint; - last_IP_pts: cint64; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) -{$ENDIF} - end; - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and AVOptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * Can only be iformat or oformat, not both at the same time. - * - * decoding: set by avformat_open_input(). - * encoding: set by the user. - *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - *) - priv_data: pointer; - - (* - * I/O context. - * - * decoding: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * encoding: set by the user. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PByteIOContext; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * decoding: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * encoding: streams are created by the user before avformat_write_header(). - *) - nb_streams: cuint; - streams: PPAVStream; - - filename: array [0..1023] of AnsiChar; (* input or output filename *) - (* stream info *) -{$IFDEF FF_API_TIMESTAMP} - (** - * @deprecated use 'creation_time' metadata tag instead - *) - timestamp: cint64; {deprecated} -{$ENDIF} - - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) -{$IFDEF FF_API_REORDER_PRIVATE} - (* private data for pts handling (do not modify directly). *) - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; -{$ENDIF} - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - -{$IFDEF FF_API_FILESIZE} - (** - * decoding: total file size, 0 if unknown - *) - file_size: cint64; -{$ENDIF} - - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - -{$IFDEF FF_API_REORDER_PRIVATE} - (* av_read_frame() support *) - cur_st: PAVStream; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) -{$ENDIF} - -{$IFDEF FF_API_MUXRATE} - (** - * use mpeg muxer private options instead - *) - mux_rate: cint; {deprecated} -{$ENDIF} - packet_size: cuint; -{$IFDEF FF_API_PRELOAD} - preload: cint; {deprecated} -{$ENDIF} - max_delay: cint; - -{$IFDEF FF_API_LOOP_OUTPUT} - (** - * number of times to loop output in formats that support it - * - * @deprecated use the 'loop' private option in the gif muxer. - *) - loop_output: cint; -{$ENDIF} - - flags: cint; -{$IFDEF FF_API_LOOP_INPUT} - (** - * @deprecated, use the 'loop' img2 demuxer private option. - *) - loop_input: cint; {deprecated} -{$ENDIF} - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * decoding: maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in avformat_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen : cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Flags to enable debugging. - *) - debug: cint; - -{$IFDEF FF_API_REORDER_PRIVATE} - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer: PAVPacketList; - raw_packet_buffer_end: PAVPacketList; - - packet_buffer_end: PAVPacketList; -{$ENDIF} - - metadata: PAVMetadata; - -{$IFDEF FF_API_REORDER_PRIVATE} - (** - * Remaining size available for raw_packet_buffer, in bytes. - * NOT PART OF PUBLIC API - *) - raw_packet_buffer_remaining_size: cint; -{$ENDIF} - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - (** - * decoding: number of frames used to probe fps - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * decoding: set by the user before avformat_open_input(). - * encoding: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) -{$IFNDEF FF_API_REORDER_PRIVATE} - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_read_frame() support *) - cur_st: PAVStream; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) -{$ENDIF} - end; - - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; - -{$IF FF_API_OLD_METADATA2} -(** - * This function is provided for compatibility reason and currently does nothing. - *) -procedure av_metadata_conv(ctx: PAVFormatContext; const d_conv: PAVMetadataConv; - const s_conv: PAVMetadataConv); - cdecl; external av__format; deprecated; - -(** - * Copy metadata from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting metadata in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_metadata_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__format; deprecated; - -(** - * Free all the memory allocated for an AVDictionary struct. - *) -procedure av_metadata_free(var m: PAVDictionary); - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -function av_guess_image2_codec(filename: {const} PAnsiChar): TCodecID; - cdecl; external av__format; - -(* XXX: Use automatic init with either ELF sections or C file parser *) -(* modules. *) - -(* utils.c *) -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; - -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TAVMediaType): TCodecID; - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - *) -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - *) -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -(** - * Get the CodecID for the given codec tag tag. - * If no codec id is found returns CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -{$IF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @{ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -{$IFDEF FF_API_FORMAT_PARAMETERS} -(** - * Allocate all the structures needed to read an input stream. - * This does not open the needed codecs for decoding the stream[s]. - *) -function av_open_input_stream(var ic_ptr: PAVFormatContext; - pb: PByteIOContext; filename: PAnsiChar; - fmt: PAVInputFormat; ap: PAVFormatParameters): cint; - cdecl; external av__format; deprecated; - -(** - * Open a media file as input. The codecs are not opened. Only the file - * header (if present) is read. - * - * @param ic_ptr The opened media file handle is put here. - * @param filename filename to open - * @param fmt If non-NULL, force the file format to use. - * @param buf_size optional buffer size (zero if default is OK) - * @param ap Additional parameters needed when opening the file - * (NULL if default). - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_open_input_file(var ic_ptr: PAVFormatContext; filename: PAnsiChar; - fmt: PAVInputFormat; buf_size: cint; - ap: PAVFormatParameters): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; {const} filename: PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext; ap: TAVFormatParameters): cint; - cdecl; external av__format; - -{$IFDEF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * - * The returned packet is valid - * until the next av_read_frame() or until av_close_input_file() and - * must be freed with av_free_packet. For video, the packet contains - * exactly one frame. For audio, it contains an cint number of - * frames if each frame has a known fixed size (e.g. PCM or ADPCM - * data). If the audio frames have a variable size (e.g. MPEG audio), - * then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in byte and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * - * @param stream_index index of the stream which is used as time base reference. - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Free a AVFormatContext allocated by av_open_input_stream. - * @param s context to free - *) -procedure av_close_input_stream(s: PAVFormatContext); - cdecl; external av__format; - -{$IFDEF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -{$IFDEF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$ENDIF} - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: PAVCodec): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -{$IFDEF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; deprecated; -{$ENDIF} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_SEEK_PUBLIC} -function av_seek_frame_binary(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; flags: cint): cint; - cdecl; external av__format; deprecated; -procedure av_update_cur_dts(s: PAVFormatContext; ref_st: PAVStream; - timestamp: cint64); - cdecl; external av__format; deprecated; - -type - TReadTimestampFunc = function (pavfc: PAVFormatContext; - arg2: cint; arg3: Pint64; arg4: cint64): cint64; cdecl; {deprecated} - -function av_gen_search(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; pos_min: cint64; - pos_max: cint64; pos_limit: cint64; - ts_min: cint64; ts_max: cint64; - flags: cint; ts_ret: Pint64; - read_timestamp: TReadTimestampFunc): cint64; - cdecl; external av__format; deprecated; -{$ENDIF} - -{$IFDEF FF_API_FORMAT_PARAMETERS} -(** - * @deprecated pass the options to avformat_write_header directly. - *) -function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already openened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -{$IFDEF FF_API_FORMAT_PARAMETERS} -(** - * Allocate the stream private data and write the stream header to an - * output media file. - * @note: this sets stream time-bases, if possible to stream->codec->time_base - * but for some formats it might also be some other time base - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - * - * @deprecated use avformat_write_header. - *) -function av_write_header(s: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Write a packet to an output media file. - * - * The packet shall contain one audio or video frame. - * The packet must be correctly interleaved according to the container - * specification, if not then av_interleaved_write_frame must be used. - * - * @param s media file handle - * @param pkt The packet, which contains the stream_index, buf/buf_size, - * dts/pts, ... - * @return < 0 on error, = 0 if OK, 1 if end of stream wanted - *) -function av_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet, which contains the stream_index, buf/buf_size, - * dts/pts, ... - * @return < 0 on error, = 0 if OK, 1 if end of stream wanted - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Interleave a packet per dts in an output media file. - * - * Packets with pkt->destruct == av_destruct_packet will be freed inside this - * function, so they cannot be used after it. Note that calling av_free_packet() - * on them is still safe. - * - * @param s media file handle - * @param out the interleaved packet will be output here - * @param pkt the input packet - * @param flush 1 if no further packets are available as input and all - * remaining packets should be output - * @return 1 if a packet was output, 0 if no packet could be output, - * < 0 if an error occurred - *) -function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; - pkt: PAVPacket; flush: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to av_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; -(** - * @} - *) - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param dts[out] DTS of the last packet output for the stream, in stream - * time_base units - * @param wall[out] absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - -{$IFDEF FF_API_DUMP_FORMAT} -(** - * @deprecated Deprecated in favor of av_dump_format(). - *) -procedure dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar; - is_output: cint); - cdecl; external av__format; deprecated; -{$ENDIF} - -procedure av_dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -{$IFDEF FF_API_PARSE_DATE} -(** - * Parse datestr and return a corresponding number of microseconds. - * - * @param datestr String representing a date or a duration. - * See av_parse_time() for the syntax of the provided string. - * @deprecated in favor of av_parse_time() - *) -function parse_date(datestr: PAnsiChar; duration: cint): cint64; {deprecated} - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Get the current time in microseconds. - *) -function av_gettime(): cint64; - cdecl; external av__format; - -{$IFDEF FF_API_FIND_INFO_TAG} -(** - * @deprecated use av_find_info_tag in libavutil instead. - *) -function find_info_tag(arg: PAnsiChar; arg_size: cint; tag1: PAnsiChar; info: PAnsiChar): cint; - cdecl; external av__format; -{$ENDIF} - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_SDP_CREATE} -function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PByteArray; size: cint): cint; - cdecl; external av__format; -{$ENDIF} - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: PAVOutputFormat; codec_id: TCodecID; std_compliance: cint): cint; - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.9/avio.pas b/src/lib/ffmpeg-0.9/avio.pas deleted file mode 100644 index 166a600d..00000000 --- a/src/lib/ffmpeg-0.9/avio.pas +++ /dev/null @@ -1,923 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 52.110.0 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_MAX_STREAMS = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA2 = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - FF_API_URL_RESETBUF = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_REGISTER_PROTOCOL = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_GUESS_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_UDP_GET_FILE = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_URL_SPLIT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_ALLOC_FORMAT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARSE_FRAME_PARAM = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_READ_SEEK = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_LAVF_UNUSED = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_PARAMETERS_CODEC_ID = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_FIRST_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_SYMVER = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_INDEX_BUILT = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_DUMP_FORMAT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PARSE_DATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FIND_INFO_TAG = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_GUESS_IMG2_CODEC = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_SDP_CREATE = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 54); - FF_API_FLAG_RTP_HINT = (LIBAVFORMAT_VERSION_MAJOR < 54); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - URL_PROTOCOL_FLAG_NESTED_SCHEME = 1; (*< The protocol name can be the first part of a nested protocol scheme *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PAVIOContext = ^TAVIOContext; - TAVIOContext = record -{$IF FF_API_OLD_AVIO} - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: PAVClass; -{$IFEND} - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) -{$IF FF_API_OLD_AVIO} - is_streamed: cint; { deprecated } -{$IFEND} - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - end; - -(* unbuffered I/O *) - -{$IF FF_API_OLD_AVIO} - PURLProtocol = ^TURLProtocol; - -(** - * URL Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(URLContext) must not be used outside libav*. - * @deprecated This struct will be made private - *) - PPURLContext = ^PURLContext; - PURLContext = ^TURLContext; - TURLContext = record - av_class: {const} PAVClass; ///< information for av_log(). Set by url_open(). - prot: PURLProtocol; - flags: cint; - is_streamed: cint; (**< true if streamed (no seek possible), default = false *) - max_packet_size: cint; (**< if non zero, the stream is packetized with this max packet size *) - priv_data: pointer; - filename: PAnsiChar; (**< specified URL *) - is_connected: cint; - interrupt_callback: TAVIOInterruptCB; - end; - -(** - * @deprecated This struct is to be made private. Use the higher-level - * AVIOContext-based API instead. - *) - TURLProtocol = record - name: PAnsiChar; - url_open: function (h: PURLContext; url: {const} PAnsiChar; flags: cint): cint; cdecl; - url_read: function (h: PURLContext; buf: PByteArray; size: cint): cint; cdecl; - url_write: function (h: PURLContext; {const} buf: PByteArray; size: cint): cint; cdecl; - url_seek: function (h: PURLContext; pos: cint64; whence: cint): cint64; cdecl; - url_close: function (h: PURLContext): cint; cdecl; - next: PURLProtocol; - url_read_pause: function (h: PURLContext; pause: cint): cint; cdecl; - url_read_seek: function (h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - url_get_file_handle: function (h: PURLContext): cint; cdecl; - priv_data_size: cint; - {const} priv_data_class: PAVClass; - flags: cint; - url_check: function (h: PURLContext; mask: cint): cint; cdecl; - end; - - PURLPollEntry = ^TURLPollEntry; - TURLPollEntry = record - handle: PURLContext; - events: cint; - revents: cint; - end; - -(* not implemented *) -function url_poll(poll_table: PURLPollEntry; n: cint; timeout: cint): cint; - cdecl; external av__format; deprecated; - -const -(** - * @defgroup open_modes URL open modes - * The flags argument to url_open and cosins must be one of the following - * constants, optionally ORed with other flags. - * @ - *) - URL_RDONLY = 1; (**< read-only *) - URL_WRONLY = 2; (**< write-only *) - URL_RDWR = URL_RDONLY or URL_WRONLY; (**< read-write *) -(** - * @ - *) - -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - URL_FLAG_NONBLOCK = 4; - -type - PURLInterruptCB = ^TURLInterruptCB; - TURLInterruptCB = function (): cint; cdecl; - -{ -var - url_interrupt_cb: PURLInterruptCB; cvar; external: av__format; -} - -(** - * @defgroup old_url_funcs Old url_* functions - * @deprecated use the buffered API based on AVIOContext instead - * @{ - * @ingroup lavf_io - *) -function url_open_protocol(puc: PPURLContext; up: PURLProtocol; - url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_alloc(h: PPURLContext; {const} url: PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_connect(h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_open(h: PPointer; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_read (h: PURLContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_read_complete (h: PURLContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_write (h: PURLContext; {const} buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function url_seek (h: PURLContext; pos: cint64; whence: cint): cint64; - cdecl; external av__format; deprecated; -function url_close (h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_filesize (h: PURLContext): cint64; - cdecl; external av__format; deprecated; -function url_get_file_handle(h: PURLContext): cint; - cdecl; external av__format; deprecated; -function url_get_max_packet_size(h: PURLContext): cint; - cdecl; external av__format; deprecated; -procedure url_get_filename(h: PURLContext; buf: PAnsiChar; buf_size: cint); - cdecl; external av__format; deprecated; -function av_url_read_pause(h: PURLContext; pause: cint): cint; - cdecl; external av__format; deprecated; -function av_url_read_seek(h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; deprecated; -procedure url_set_interrupt_cb (interrupt_cb: TURLInterruptCB); - cdecl; external av__format; deprecated; - -(** - * returns the next registered protocol after the given protocol (the first if - * NULL is given), or NULL if protocol is the last one. - *) -function av_protocol_next(p: PURLProtocol): PURLProtocol; - cdecl; external av__format; - -(** - * Register the URLProtocol protocol. - * - * @param size the size of the URLProtocol struct referenced - *) -function av_register_protocol2(protocol: PURLProtocol; size: cint): cint; - cdecl; external av__format; deprecated; -(** - * @ - *) - -type - PByteIOContext = PAVIOContext; { deprecated } - TByteIOContext = TAVIOContext; { deprecated } - -function init_put_byte(s: PAVIOContext; - buffer: PByteArray; - buffer_size: cint; - write_flag: cint; - opaque: pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): cint; - cdecl; external av__format; deprecated; -function av_alloc_put_byte( - buffer: PByteArray; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; deprecated; - -(** - * @defgroup old_avio_funcs Old put_/get_*() functions - * @deprecated use the avio_ -prefixed functions instead. - * @{ - *) -function get_buffer(s: PAVIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function get_partial_buffer(s: PAVIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; deprecated; -function get_byte(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function get_le16(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le24(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le32(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_le64(s: PAVIOContext): cuint64; - cdecl; external av__format; deprecated; -function get_be16(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be24(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be32(s: PAVIOContext): cuint; - cdecl; external av__format; deprecated; -function get_be64(s: PAVIOContext): cuint64; - cdecl; external av__format; deprecated; - -procedure put_byte(s: PAVIOContext; b: cint); - cdecl; external av__format; deprecated; -procedure put_nbyte(s: PAVIOContext; b: cint; count: cint); - cdecl; external av__format; deprecated; -procedure put_buffer (s: PAVIOContext; buf: {const} PByteArray; size: cint); - cdecl; external av__format; deprecated; -procedure put_le64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; deprecated; -procedure put_be64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; deprecated; -procedure put_le32(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be32(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_le24(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be24(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_le16(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_be16(s: PAVIOContext; val: cuint); - cdecl; external av__format; deprecated; -procedure put_tag(s: PAVIOContext; tag: {const} PAnsiChar); - cdecl; external av__format; deprecated; -(** - * @ - *) - -function av_url_read_fpause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; deprecated; -function av_url_read_fseek(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; deprecated; - -(** - * @defgroup old_url_f_funcs Old url_f* functions - * @deprecated use the avio_ -prefixed functions instead. - * @{ - *) -function url_fopen(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; deprecated; -function url_fclose(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_fseek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; deprecated; -function url_fskip(s: PAVIOContext; offset: cint64): cint; - cdecl; external av__format; deprecated; -function url_ftell(s: PAVIOContext): cint64; - cdecl; external av__format; deprecated; -function url_fsize(s: PAVIOContext): cint64; - cdecl; external av__format; deprecated; -const - URL_EOF = -1; -(** @note return URL_EOF (-1) if EOF *) -function url_fgetc(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_setbufsize (s: PAVIOContext; buf_size: cint): cint; - cdecl; external av__format; deprecated; -function url_fprintf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; deprecated; -procedure put_flush_packet (s: PAVIOContext); - cdecl; external av__format; deprecated; -function url_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; deprecated; -function url_open_dyn_packet_buf(var s: PAVIOContext; max_packet_size: cint): cint; - cdecl; external av__format; deprecated; -function url_close_dyn_buf(s: PAVIOContext; pbuffer:PPointer): cint; - cdecl; external av__format; deprecated; -function url_fdopen (var s: PAVIOContext; h: PURLContext): cint; - cdecl; external av__format; deprecated; -(** - * @ - *) - -function url_ferror(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -function udp_set_remote_url(h: PURLContext; uri: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; -function udp_get_local_port(h: PURLContext): cint; - cdecl; external av__format; deprecated; - -type - Tupdate_checksum = function (c: culong; p: Pcuint8; len: cuint): culong; cdecl; -procedure init_checksum(s: PAVIOContext; - update_checksum: Tupdate_checksum; - checksum: culong); - cdecl; external av__format; deprecated; -function get_checksum(s: PAVIOContext): culong; - cdecl; external av__format; deprecated; -procedure put_strz(s: PAVIOContext; buf: {const} PAnsiChar); - cdecl; external av__format; deprecated; -(** @note unlike fgets, the EOL character is not returned and a whole - line is parsed. return NULL if first char read was EOF *) -function url_fgets(s: PAVIOContext; buf: PAnsiChar; buf_size: cint): PAnsiChar; - cdecl; external av__format; deprecated; -(** - * @deprecated use avio_get_str instead - *) -function get_strz(s: PAVIOContext; buf: PAnsiChar; maxlen: cint): PAnsiChar; - cdecl; external av__format; deprecated; -(** - * @deprecated Use AVIOContext.seekable field directly. - *) -function url_is_streamed(s: PAVIOContext): cint; {$IFDEF HasInline}inline;{$ENDIF} deprecated; - -function url_fileno(s: PAVIOContext): PURLContext; - cdecl; external av__format; deprecated; - -(** - * @deprecated use AVIOContext.max_packet_size directly. - *) -function url_fget_max_packet_size (s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -function url_open_buf(var s: PAVIOContext; buf: PAnsiChar; buf_size: cint; flags: cint): cint; - cdecl; external av__format; deprecated; - -(** return the written or read size *) -function url_close_buf(s: PAVIOContext): cint; - cdecl; external av__format; deprecated; - -(** - * Return a non-zero value if the resource indicated by url - * exists, 0 otherwise. - * @deprecated Use avio_check instead. - *) -function url_exist(url: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; -{$IFEND} // FF_API_OLD_AVIO - -(** - * Return AVIO_FLAG_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - * - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_OLD_INTERRUPT_CB} -(** - * The callback is called in blocking functions to test regulary if - * asynchronous interruption is needed. AVERROR_EXIT is returned - * in this case by the interrupted function. 'NULL' means no interrupt - * callback is given. - * @deprecated Use interrupt_callback in AVFormatContext/avio_open2 - * instead. - *) -procedure avio_set_interrupt_cb(interrupt_cb: Pointer); - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const - (** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - - (** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonble - * means that can be extreemly slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @ - *) - -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = AVIO_FLAG_READ or AVIO_FLAG_WRITE; (**< read-write *) -(** - * @ - *) - -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) -const - AVIO_FLAG_NONBLOCK = 8; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: {PPAVIOContext} pointer; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * @return 0 on success, an AVERROR < 0 on error. - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * @note it is recommanded to use av_protocol_next() instead of this - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -{$IF (LIBAVFORMAT_VERSION_MAJOR < 54)} -function url_is_streamed(s: PAVIOContext): cint; -begin - Result := s^.is_streamed; -end; -{$IFEND} - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - -end. diff --git a/src/lib/ffmpeg-0.9/avutil.pas b/src/lib/ffmpeg-0.9/avutil.pas deleted file mode 100644 index a2ce6b95..00000000 --- a/src/lib/ffmpeg-0.9/avutil.pas +++ /dev/null @@ -1,263 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 51.32.0 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 51; - LIBAVUTIL_MAX_VERSION_MINOR = 32; - LIBAVUTIL_MAX_VERSION_RELEASE = 0; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 51; - LIBAVUTIL_MIN_VERSION_MINOR = 32; - LIBAVUTIL_MIN_VERSION_RELEASE = 0; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1<= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -end. diff --git a/src/lib/ffmpeg-0.9/libavcodec/audioconvert.pas b/src/lib/ffmpeg-0.9/libavcodec/audioconvert.pas deleted file mode 100644 index fea0f7cf..00000000 --- a/src/lib/ffmpeg-0.9/libavcodec/audioconvert.pas +++ /dev/null @@ -1,140 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/audioconvert.h - * avutil version 50.43.0 - * - *) - -(** - * @file - * audio conversion routines - *) - -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -(** - * Return a channel layout id that matches name, 0 if no match. - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionnally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - + Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-0.9/libavutil/cpu.pas b/src/lib/ffmpeg-0.9/libavutil/cpu.pas deleted file mode 100644 index d268c4ec..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/cpu.pas +++ /dev/null @@ -1,73 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 51.32.0 - * - *) - -(** - * @file - * CPU specific - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - AV_CPU_FLAG_IWMMXT = $0100; ///< XScale IWMMXT - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - -(** - * Return the flags which specify extensions supported by the CPU. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(* The following CPU-specific functions shall not be called directly. *) -function ff_get_cpu_flags_arm(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_ppc(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_x86(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.9/libavutil/dict.pas b/src/lib/ffmpeg-0.9/libavutil/dict.pas deleted file mode 100644 index 75a79c06..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/dict.pas +++ /dev/null @@ -1,93 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 51.32.0 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() and children. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() and chilren. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.9/libavutil/error.pas b/src/lib/ffmpeg-0.9/libavutil/error.pas deleted file mode 100644 index 9f4abb68..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/error.pas +++ /dev/null @@ -1,116 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 51.32.0 - * - *) - -(** - * @file - * error code definitions - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) - -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.9/libavutil/log.pas b/src/lib/ffmpeg-0.9/libavutil/log.pas deleted file mode 100644 index b60d6731..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/log.pas +++ /dev/null @@ -1,203 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 51.32.0 - * - *) - -(** - * @file - * log - *) - -type -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for loging is stored. - * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such - * parent context. And a av_log() implementation could then display the parent context - * can be NULL of course - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - -end; - -const - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; dummy: va_list); - cdecl; external av__util; -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -function av_default_item_name (ctx: pointer): PAnsiChar; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.9/libavutil/mathematics.pas b/src/lib/ffmpeg-0.9/libavutil/mathematics.pas deleted file mode 100644 index 07e533cb..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/mathematics.pas +++ /dev/null @@ -1,98 +0,0 @@ -(* - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 51.32.0 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = 0.0/0.0; - INFINITY = 1.0/0.0; - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5 ///< Round to nearest and halfway cases away from zero. - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.9/libavutil/mem.pas b/src/lib/ffmpeg-0.9/libavutil/mem.pas deleted file mode 100644 index c511eda5..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/mem.pas +++ /dev/null @@ -1,147 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 51.32.0 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * @param tab_ptr Pointer to the array. - * @param nb_ptr Pointer to the number of elements in the array. - * @param elem Element to be added. - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: PCint; elem: pointer); - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} diff --git a/src/lib/ffmpeg-0.9/libavutil/opt1.pas b/src/lib/ffmpeg-0.9/libavutil/opt1.pas deleted file mode 100644 index 4b03b916..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/opt1.pas +++ /dev/null @@ -1,545 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 51.32.0 - * - *) - -(** - * @defgroup avoptions AVOptions - * @ingroup lavu_data - * @{ - * AVOptions provide a generic system to declare options on arbitrary structs - * ("objects"). An option can have a help text, a type and a range of possible - * values. Options may then be enumerated, read and written to. - * - * @section avoptions_implement Implementing AVOptions - * This section describes how to add AVOptions capabilities to a struct. - * - * All AVOptions-related information is stored in an AVClass. Therefore - * the first member of the struct must be a pointer to an AVClass describing it. - * The option field of the AVClass must be set to a NULL-terminated static array - * of AVOptions. Each AVOption must have a non-empty name, a type, a default - * value and for number-type AVOptions also a range of allowed values. It must - * also declare an offset in bytes from the start of the struct, where the field - * associated with this AVOption is located. Other fields in the AVOption struct - * should also be set when applicable, but are not required. - * - * The following example illustrates an AVOptions-enabled struct: - * @code - * typedef struct test_struct { - * AVClass *class; - * int int_opt; - * char *str_opt; - * uint8_t *bin_opt; - * int bin_len; - * } test_struct; - * - * static const AVOption options[] = { - * { "test_int", "This is a test option of int type.", offsetof(test_struct, int_opt), - * AV_OPT_TYPE_INT, { -1 }, INT_MIN, INT_MAX }, - * { "test_str", "This is a test option of string type.", offsetof(test_struct, str_opt), - * AV_OPT_TYPE_STRING }, - * { "test_bin", "This is a test option of binary type.", offsetof(test_struct, bin_opt), - * AV_OPT_TYPE_BINARY }, - * { NULL }, - * }; - * - * static const AVClass test_class = { - * .class_name = "test class", - * .item_name = av_default_item_name, - * .option = options, - * .version = LIBAVUTIL_VERSION_INT, - * }; - * @endcode - * - * Next, when allocating your struct, you must ensure that the AVClass pointer - * is set to the correct value. Then, av_opt_set_defaults() must be called to - * initialize defaults. After that the struct is ready to be used with the - * AVOptions API. - * - * When cleaning up, you may use the av_opt_free() function to automatically - * free all the allocated string and binary options. - * - * Continuing with the above example: - * - * @code - * test_struct *alloc_test_struct(void) - * { - * test_struct *ret = av_malloc(sizeof(*ret)); - * ret->class = &test_class; - * av_opt_set_defaults(ret); - * return ret; - * } - * void free_test_struct(test_struct **foo) - * { - * av_opt_free(*foo); - * av_freep(foo); - * } - * @endcode - * - * @subsection avoptions_implement_nesting Nesting - * It may happen that an AVOptions-enabled struct contains another - * AVOptions-enabled struct as a member (e.g. AVCodecContext in - * libavcodec exports generic options, while its priv_data field exports - * codec-specific options). In such a case, it is possible to set up the - * parent struct to export a child's options. To do that, simply - * implement AVClass.child_next() and AVClass.child_class_next() in the - * parent struct's AVClass. - * Assuming that the test_struct from above now also contains a - * child_struct field: - * - * @code - * typedef struct child_struct { - * AVClass *class; - * int flags_opt; - * } child_struct; - * static const AVOption child_opts[] = { - * { "test_flags", "This is a test option of flags type.", - * offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX }, - * { NULL }, - * }; - * static const AVClass child_class = { - * .class_name = "child class", - * .item_name = av_default_item_name, - * .option = child_opts, - * .version = LIBAVUTIL_VERSION_INT, - * }; - * - * void *child_next(void *obj, void *prev) - * { - * test_struct *t = obj; - * if (!prev && t->child_struct) - * return t->child_struct; - * return NULL - * } - * const AVClass child_class_next(const AVClass *prev) - * { - * return prev ? NULL : &child_class; - * } - * @endcode - * Putting child_next() and child_class_next() as defined above into - * test_class will now make child_struct's options accessible through - * test_struct (again, proper setup as described above needs to be done on - * child_struct right after it is created). - * - * From the above example it might not be clear why both child_next() - * and child_class_next() are needed. The distinction is that child_next() - * iterates over actually existing objects, while child_class_next() - * iterates over all possible child classes. E.g. if an AVCodecContext - * was initialized to use a codec which has private options, then its - * child_next() will return AVCodecContext.priv_data and finish - * iterating. OTOH child_class_next() on AVCodecContext.av_class will - * iterate over all available codecs with private options. - * - * @subsection avoptions_implement_named_constants Named constants - * It is possible to create named constants for options. Simply set the unit - * field of the option the constants should apply to to a string and - * create the constants themselves as options of type AV_OPT_TYPE_CONST - * with their unit field set to the same string. - * Their default_val field should contain the value of the named - * constant. - * For example, to add some named constants for the test_flags option - * above, put the following into the child_opts array: - * @code - * { "test_flags", "This is a test option of flags type.", - * offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX, "test_unit" }, - * { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { 16 }, 0, 0, "test_unit" }, - * @endcode - * - * @section avoptions_use Using AVOptions - * This section deals with accessing options in an AVOptions-enabled struct. - * Such structs in FFmpeg are e.g. AVCodecContext in libavcodec or - * AVFormatContext in libavformat. - * - * @subsection avoptions_use_examine Examining AVOptions - * The basic functions for examining options are av_opt_next(), which iterates - * over all options defined for one object, and av_opt_find(), which searches - * for an option with the given name. - * - * The situation is more complicated with nesting. An AVOptions-enabled struct - * may have AVOptions-enabled children. Passing the AV_OPT_SEARCH_CHILDREN flag - * to av_opt_find() will make the function search children recursively. - * - * For enumerating there are basically two cases. The first is when you want to - * get all options that may potentially exist on the struct and its children - * (e.g. when constructing documentation). In that case you should call - * av_opt_child_class_next() recursively on the parent struct's AVClass. The - * second case is when you have an already initialized struct with all its - * children and you want to get all options that can be actually written or read - * from it. In that case you should call av_opt_child_next() recursively (and - * av_opt_next() on each result). - * - * @subsection avoptions_use_get_set Reading and writing AVOptions - * When setting options, you often have a string read directly from the - * user. In such a case, simply passing it to av_opt_set() is enough. For - * non-string type options, av_opt_set() will parse the string according to the - * option type. - * - * Similarly av_opt_get() will read any option type and convert it to a string - * which will be returned. Do not forget that the string is allocated, so you - * have to free it with av_free(). - * - * In some cases it may be more convenient to put all options into an - * AVDictionary and call av_opt_set_dict() on it. A specific case of this - * are the format/codec open functions in lavf/lavc which take a dictionary - * filled with option as a parameter. This allows to set some options - * that cannot be set otherwise, since e.g. the input file format is not known - * before the file is actually opened. - *) - -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128 -{$ENDIF} -); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (dbl: cdouble); - 1: (str: {const} PAnsiChar); - (* TODO those are unused now *) - 2: (i64: cint64); - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR(ENOENT) if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q(obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int(obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -{$IFDEF FF_API_OLD_AVOPTIONS} -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @{ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.9/libavutil/opt2.pas b/src/lib/ffmpeg-0.9/libavutil/opt2.pas deleted file mode 100644 index 46a1a0ce..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/opt2.pas +++ /dev/null @@ -1,85 +0,0 @@ -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @{ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double(obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -(** - * @} - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @{ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return 0 on success, a negative error code otherwise - *) -(** - * @note the returned string will av_malloc()ed and must be av_free()ed by the caller - *) -type - PPcuint8 = ^Pcuint8; -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; outval: PPcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; outval: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double(obj: pointer; name: {const} PAnsiChar; search_flags: cint; outval: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; outval: PAVRational): cint; - cdecl; external av__util; -(** - * @} - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.9/libavutil/pixfmt.pas b/src/lib/ffmpeg-0.9/libavutil/pixfmt.pas deleted file mode 100644 index 8ef6104d..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/pixfmt.pas +++ /dev/null @@ -1,258 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 51.32.0 - * - *) - -(** - * @file - * Pixel format - *) - -type -(** - * Pixel format. Notes: - * - * @note - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - PIX_FMT_NONE= -1, - PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - PIX_FMT_GRAY8, ///< Y , 8bpp - PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - PIX_FMT_XVMC_MPEG2_IDCT, - PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus - //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored seperately - //is better - PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian - PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian - PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian - PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian - PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian - PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - - PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - PIX_FMT_Y400A = PIX_FMT_GRAY8A; - PIX_FMT_GBR24P = PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - PIX_FMT_RGB32 = PIX_FMT_ARGB; - PIX_FMT_RGB32_1 = PIX_FMT_RGBA; - PIX_FMT_BGR32 = PIX_FMT_ABGR; - PIX_FMT_BGR32_1 = PIX_FMT_BGRA; - PIX_FMT_0RGB32 = PIX_FMT_0RGB; - PIX_FMT_0BGR32 = PIX_FMT_0BGR; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16BE; - PIX_FMT_RGB48 = PIX_FMT_RGB48BE; - PIX_FMT_RGB565 = PIX_FMT_RGB565BE; - PIX_FMT_RGB555 = PIX_FMT_RGB555BE; - PIX_FMT_RGB444 = PIX_FMT_RGB444BE; - PIX_FMT_BGR48 = PIX_FMT_BGR48BE; - PIX_FMT_BGR565 = PIX_FMT_BGR565BE; - PIX_FMT_BGR555 = PIX_FMT_BGR555BE; - PIX_FMT_BGR444 = PIX_FMT_BGR444BE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9BE; - PIX_FMT_YUV422P9 = PIX_FMT_YUV422P9BE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9BE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10BE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10BE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10BE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16BE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16BE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16BE; - - PIX_FMT_RGBA64 = PIX_FMT_RGBA64BE; - PIX_FMT_BGRA64 = PIX_FMT_BGRA64BE; - PIX_FMT_GBRP9 = PIX_FMT_GBRP9BE; - PIX_FMT_GBRP10 = PIX_FMT_GBRP10BE; - PIX_FMT_GBRP16 = PIX_FMT_GBRP16BE; -{$ELSE} - PIX_FMT_RGB32 = PIX_FMT_BGRA; - PIX_FMT_RGB32_1 = PIX_FMT_ABGR; - PIX_FMT_BGR32 = PIX_FMT_RGBA; - PIX_FMT_BGR32_1 = PIX_FMT_ARGB; - PIX_FMT_0RGB32 = PIX_FMT_BGR0; - PIX_FMT_0BGR32 = PIX_FMT_RGB0; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16LE; - PIX_FMT_RGB48 = PIX_FMT_RGB48LE; - PIX_FMT_RGB565 = PIX_FMT_RGB565LE; - PIX_FMT_RGB555 = PIX_FMT_RGB555LE; - PIX_FMT_RGB444 = PIX_FMT_RGB444LE; - PIX_FMT_BGR48 = PIX_FMT_BGR48LE; - PIX_FMT_BGR565 = PIX_FMT_BGR565LE; - PIX_FMT_BGR555 = PIX_FMT_BGR555LE; - PIX_FMT_BGR444 = PIX_FMT_BGR444LE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9LE; - PIX_FMT_YUV422P9 = PIX_FMT_YUV422P9LE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9LE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10LE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10LE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10LE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16LE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16LE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16LE; - - PIX_FMT_RGBA64 = PIX_FMT_RGBA64LE; - PIX_FMT_BGRA64 = PIX_FMT_BGRA64LE; - PIX_FMT_GBRP9 = PIX_FMT_GBRP9LE; - PIX_FMT_GBRP10 = PIX_FMT_GBRP10LE; - PIX_FMT_GBRP16 = PIX_FMT_GBRP16LE; -{$ENDIF} diff --git a/src/lib/ffmpeg-0.9/libavutil/samplefmt.pas b/src/lib/ffmpeg-0.9/libavutil/samplefmt.pas deleted file mode 100644 index 01dac5d8..00000000 --- a/src/lib/ffmpeg-0.9/libavutil/samplefmt.pas +++ /dev/null @@ -1,173 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 51.32.0 - * - *) - -type -(** - * all in native-endian format - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; deprecated; - cdecl; external av__util; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Fill channel data pointers and linesizes for samples with sample - * format sample_fmt. - * - * The pointers array is filled with the pointers to the samples data: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The linesize array is filled with the aligned size of each channel's data - * buffer for planar layout, or the aligned size of the buffer for all channels - * for packed layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (1 = no alignment required) - * @return 0 on success or a negative error code on failure - *) -function av_samples_fill_arrays(audio_data: pointer; linesize: Pcint; - buf: Pcuint8; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s) - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (1 = no alignment required) - * @return 0 on success or a negative error code on failure - * @see av_samples_fill_arrays() - *) -function av_samples_alloc(audio_data: pointer; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-0.9/rational.pas b/src/lib/ffmpeg-0.9/rational.pas deleted file mode 100644 index 3696400f..00000000 --- a/src/lib/ffmpeg-0.9/rational.pas +++ /dev/null @@ -1,190 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 51.32.0 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -type - (* - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b and -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) >> 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num >> 31) - (b.num >> 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -end. diff --git a/src/lib/ffmpeg-0.9/swresample.pas b/src/lib/ffmpeg-0.9/swresample.pas deleted file mode 100644 index 73900adf..00000000 --- a/src/lib/ffmpeg-0.9/swresample.pas +++ /dev/null @@ -1,165 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libswresample/swresample.h: - * version: 0.5.0 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - SWR_CH_MAX = 16; (* < Maximum number of channels *) - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s Swr context, can be NULL - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - {const} var in_: PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Activate resampling compensation. - *) -procedure swr_compensate(s: PSwrContext; sample_delta: cint; compensation_distance: cint); - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param s allocated Swr context, not yet initialized - * @param channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * @ - *) - -implementation - -end. - diff --git a/src/lib/ffmpeg-0.9/swscale.pas b/src/lib/ffmpeg-0.9/swscale.pas deleted file mode 100644 index c26f66c5..00000000 --- a/src/lib/ffmpeg-0.9/swscale.pas +++ /dev/null @@ -1,466 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.1.0 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 0; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -const -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(** - * Returns the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Returns the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Returns the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Returns a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Returns a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Returns a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocates an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initializes the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Frees the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IF FF_API_SWS_GETCONTEXT} -(** - * Allocates and returns a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - * @deprecated Use sws_getCachedContext() instead. - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scales the image slice in srcSlice and puts the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocates and returns an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Returns a normalized Gaussian curve used to filter stuff - * quality=3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocates and returns a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocates and returns a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scales all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scales all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocates and returns a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Prints with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Checks if context can be reused, otherwise reallocates a new - * one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Converts an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Converts an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-1.0/How to update the ffmpeg files.txt b/src/lib/ffmpeg-1.0/How to update the ffmpeg files.txt deleted file mode 100644 index 976d0eff..00000000 --- a/src/lib/ffmpeg-1.0/How to update the ffmpeg files.txt +++ /dev/null @@ -1,12 +0,0 @@ -how to update the ffmpeg files: - -1) rational.pas - error.pas -2) mathematics.pas - dict.pas - opt.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-1.0/ToDo.txt b/src/lib/ffmpeg-1.0/ToDo.txt deleted file mode 100644 index de773c78..00000000 --- a/src/lib/ffmpeg-1.0/ToDo.txt +++ /dev/null @@ -1,6 +0,0 @@ -1) opt.pas -PAVClass - -2) avutil.pas -inline function av_x_if_null -inline function av_size_mult diff --git a/src/lib/ffmpeg-1.0/avcodec.pas b/src/lib/ffmpeg-1.0/avcodec.pas deleted file mode 100644 index e7e60d2e..00000000 --- a/src/lib/ffmpeg-1.0/avcodec.pas +++ /dev/null @@ -1,5237 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 54.59.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 54; - LIBAVCODEC_MAX_VERSION_MINOR = 59; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 54; - LIBAVCODEC_MIN_VERSION_MINOR = 59; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_ALLOC_CONTEXT} -{$define FF_API_ALLOC_CONTEXT} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_AVCODEC_OPEN} -{$define FF_API_AVCODEC_OPEN} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OLD_TIMECODE} -{$define FF_API_OLD_TIMECODE} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} - -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_MPV_GLOBAL_OPTS} -{$define FF_API_MPV_GLOBAL_OPTS} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_COLOR_TABLE_ID} -{$define FF_API_COLOR_TABLE_ID} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_INTER_THRESHOLD} -{$define FF_API_INTER_THRESHOLD} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_SUB_ID} -{$define FF_API_SUB_ID} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_DSP_MASK} -{$define FF_API_DSP_MASK} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_FIND_BEST_PIX_FMT} -{$define FF_API_FIND_BEST_PIX_FMT} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_VDA_ASYNC} -{$define FF_API_VDA_ASYNC} // = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - AV_CODEC_ID_MPEG2VIDEO_XVMC, - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_SNOW, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, -(** see below. they need to be hard coded. - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, -(** see below. they need to be hard coded. - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, - AV_CODEC_ID_VOXWARE, - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - AV_CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), - AV_CODEC_ID_8SVX_RAW = $38535658, // MKBETAG('8','S','V','X'), - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644 // MKBETAG('m','D','V','D'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_get_descriptor() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(* in bytes *) - AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio -{$IFEND} - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 16; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_SPC_SMPTE240M = 7, - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - (** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - CODEC_FLAG_CBP_RD = $04000000; ///< use rate distortion optimization for cbp - CODEC_FLAG_QP_RD = $08000000; ///< use rate distortion optimization for qp selectioon - CODEC_FLAG2_STRICT_GOP = $00000002; ///< strictly enforce GOP size - CODEC_FLAG2_SKIP_RD = $00004000; ///< RD optimal MB level residual skipping -{$ENDIF} - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; - -(* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -(** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) - - FF_COMPRESSION_DEFAULT = -1; - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; - AV_EF_BUFFER = 4; - AV_EF_EXPLODE = 8; - - AV_EF_CAREFUL = 65536; - AV_EF_COMPLIANT = 131072; - AV_EF_AGGRESSIVE = 262144; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_LIBMPEG2MMX = 4; - FF_IDCT_PS2 = 5; - FF_IDCT_MLIB = 6; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_H264 = 11; - FF_IDCT_VP3 = 12; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_CAVS = 15; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_WMV2 = 19; - FF_IDCT_FAAN = 20; - FF_IDCT_EA = 21; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - FF_IDCT_BINK = 24; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_LEVEL_UNKNOWN = -99; - -type - AVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO - ); - - TAVPacketSideDataType = record - data: PByte; - size: cint; - type_: AVPacketSideDataType; - end; - PAVPacketSideDataType = ^TAVPacketSideDataType; - - PAVPacket = ^TAVPacket; - TAVPacket = record - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideDataType; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - -type - PAVCodecContext = ^TAVCodecContext; - -(** - * Audio Video Frame. - * New fields can be added to the end of AVFRAME with minor version - * bumps. Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - * Removal, reordering and changes in the remaining cases require - * a major version bump. - * sizeof(AVFrame) must not be used outside libavcodec. - *) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: unused - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * reordered pts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint64; - end; {TAVFrame} - - TAVCodecInternal = record - end; - PAVCodecInternal = ^TAVCodecInternal; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - AVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; - codec_name: array [0..31] of AnsiChar; - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - -{$IFDEF FF_API_SUB_ID} - (** - * @deprecated this field is unused - *) - sub_id: cint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid prolems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * Number of "priming" samples added to the beginning of the stream - * during encoding. The decoded output will be delayed by this many - * samples relative to the input to the encoder. Note that this field is - * purely informational and does not directly affect the pts output by - * the encoder, which should always be based on the actual presentation - * time, including any delay. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - * Note: For compatibility it is possible to set this instead of - * coded_width/height before decoding. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height if lowres enabled. - * - encoding: unused - * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the TAVPixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - (** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - luma_elim_threshold: cint; {deprecated} - - (** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - chroma_elim_threshold: cint; {deprecated} -{$ENDIF} - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - -{$IFDEF FF_API_COLOR_TABLE_ID} - (** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - *) - color_table_id: cint; {deprecated} -{$ENDIF} - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - -{$IFDEF FF_API_INTER_THRESHOLD} - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - inter_threshold: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - (** - * quantizer noise shaping - * - encoding: Set by user. - * - decoding: unused - *) - quantizer_noise_shaping: cint; {deprecated} -{$ENDIF} - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by libavcodec - *) - field_order: AVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Samples per packet, initialized when calling 'init'. - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - rc_buffer_aggressivity: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - -{$IFDEF FF_API_DSP_MASK} - (** - * Unused. - * @deprecated use av_set_cpu_flags_mask() instead. - *) - dsp_mask: cuint; {deprecated} -{$IFEND} - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * avcodec_set_pkt_timebase(avctx) - * - encoding unused. - * - decodimg set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * avcodec_get_codec_descriptior(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - (** - * 1 indicates this subtitle is a forced subtitle. - * A forced subtitle should be displayed even when subtitles are hidden. - *) - forced: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -(** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @ - *) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; - -function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; -procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - -function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; -procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -{$IFDEF FF_API_ALLOC_CONTEXT} -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - * - * @deprecated use avcodec_alloc_context3() - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - * @deprecated use avcodec_get_context_defaults3 - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using avcodec_free_frame(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - -{$IFDEF FF_API_AVCODEC_OPEN} -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close - * - * @deprecated use avcodec_open2 - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @addtogroup lavc_packet - * @ - *) - -(* - * Default packet destructor. - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The - * decoder may, however, only utilize part of the buffer by - * setting AVFrame.nb_samples to a smaller value in the - * output frame. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @addtogroup lavc_encoding - * @ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * - * @ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; - - -(** - * @addtogroup lavc_picture - * @ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * deinterlace - if not supported return -1 - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; (**< loss due to resolution change *) - FF_LOSS_DEPTH = $0002; (**< loss due to color depth change *) - FF_LOSS_COLORSPACE = $0004; (**< loss due to color space conversion *) - FF_LOSS_ALPHA = $0008; (**< loss of alpha bits *) - FF_LOSS_COLORQUANT = $0010; (**< loss due to color quantization *) - FF_LOSS_CHROMA = $0020; (**< loss of chroma (e.g. RGB to gray conversion) *) - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur - * (maximum loss for an invalid dst_pix_fmt). - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_FIND_BEST_PIX_FMT} -(** - * @deprecated use avcodec_find_best_pix_fmt_of_2() instead. - * - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_mask parameter. - * - * Note, only the first 64 pixel formats will fit in pix_fmt_mask. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << PIX_FMT_YUV422P) | (1 << PIX_FMT_RGB24); - * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint64; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format and a selection of two destination pixel formats. When converting from - * one pixel format to another, information loss may occur. For example, when converting - * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when - * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of - * the given pixel formats should be used to suffer the least amount of loss. - * - * If one of the destination formats is PIX_FMT_NONE the other pixel format (if valid) will be - * returned. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * dst_pix_fmt1= PIX_FMT_RGB24; - * dst_pix_fmt2= PIX_FMT_GRAY8; - * dst_pix_fmt3= PIX_FMT_RGB8; - * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from - * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from - * @param[in] src_pix_fmt Source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. - * NULL or value of zero means we care about all losses. Out: the loss - * that occurs when converting from src to selected dst pixel format. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_FORK_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill audio frame data and linesize. - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return 0 on success, negative error code on failure - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -procedure avcodec_default_free_buffers(s: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -implementation - -end. diff --git a/src/lib/ffmpeg-1.0/avformat.pas b/src/lib/ffmpeg-1.0/avformat.pas deleted file mode 100644 index f36ac31f..00000000 --- a/src/lib/ffmpeg-1.0/avformat.pas +++ /dev/null @@ -1,2199 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 1.0 libavformat/avformat.h - * Version: 54.29.104 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 1.0.x - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 54; - LIBAVFORMAT_MAX_VERSION_MINOR = 29; - LIBAVFORMAT_MAX_VERSION_RELEASE = 104; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 54; - LIBAVFORMAT_MIN_VERSION_MINOR = 29; - LIBAVFORMAT_MIN_VERSION_RELEASE = 0; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -const -{$ifndef FF_API_OLD_AVIO} - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_PKT_DUMP} - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_NEW_STREAM} - FF_API_NEW_STREAM = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_SET_PTS_INFO} - FF_API_SET_PTS_INFO = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} - FF_API_CLOSE_INPUT_FILE = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_APPLEHTTP_PROTO} - FF_API_APPLEHTTP_PROTO = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_READ_PACKET} - FF_API_READ_PACKET = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_INTERLEAVE_PACKET} - FF_API_INTERLEAVE_PACKET = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_AV_GETTIME} - FF_API_AV_GETTIME = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_R_FRAME_RATE} - FF_API_R_FRAME_RATE = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @{ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @{ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * The packet data belongs to the demuxer and is invalid after the next call to - * av_read_frame(). The user must free the packet with av_free_packet() before - * calling av_read_frame() again or closing the file. - * - * @section lavf_decoding_seek Seeking - * @} - * - * @defgroup lavf_encoding Muxing - * @{ - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -type - PAVFile = Pointer; - -(* - * @defgroup metadata_api Public Metadata API - * @{ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @} - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fallback to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fallback to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - - MAX_STD_TIMEBASES = (60*12+6); - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - -(** - * @addtogroup lavf_encoding - * @{ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @{ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - end; - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generaion would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - duration_error: array[0..1] of array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - codec_info_duration: cint64; - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) -{$IF FF_API_R_FRAME_RATE} - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - *) - r_frame_rate: TAVRational; -{$IFEND} - priv_data: pointer; - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: set by libavformat in av_write_header. The muxer may use the - * user-provided value of @ref AVCodecContext.time_base "codec->time_base" - * as a hint. - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why its not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - end; - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and AVOptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * Can only be iformat or oformat, not both at the same time. - * - * decoding: set by avformat_open_input(). - * encoding: set by the user. - *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - *) - priv_data: pointer; - - (* - * I/O context. - * - * decoding: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * encoding: set by the user. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PByteIOContext; - - (* stream info *) - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * decoding: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * encoding: streams are created by the user before avformat_write_header(). - *) - nb_streams: cuint; - streams: PPAVStream; - - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - flags: cint; - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * decoding: maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in avformat_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - (** - * decoding: number of frames used to probe fps - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * decoding: set by the user before avformat_open_input(). - * encoding: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * Avoids negative timestamps during muxing - * 0 -> allow negative timestamps - * 1 -> avoid negative timestamps - * -1 -> choose automatically (default) - * Note, this is only works when interleave_packet_per_dts is in use - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - avoid_negative_ts: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Packets split by the parser get queued here. - *) - parse_queue: PAVPacketList; - parse_queue_end: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - end; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: PAVCodec): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -{$IF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - * - * @deprecated use avformat_find_stream_info. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * The returned packet is valid - * until the next av_read_frame() or until av_close_input_file() and - * must be freed with av_free_packet. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of - * frames if each frame has a known fixed size (e.g. PCM or ADPCM - * data). If the audio frames have a variable size (e.g. MPEG audio), - * then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -{$IF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; -{$IFEND} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already openened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Libavformat takes - * ownership of the data and will free it when it sees fit using the packet's - * This can be NULL (at any time, not just at the end), to flush the - * interleaving queues. - * @ref AVPacket.destruct "destruct" field. The caller must not access the data - * after this function returns, as it may already be freed. - * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the - * index of the corresponding stream in @ref AVFormatContext.streams - * "s.streams". - * It is very strongly recommended that timing information (@ref AVPacket.pts - * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -{$IF FF_API_INTERLEAVE_PACKET} -(** - * @deprecated this function was never meant to be called by the user - * programs. - *) -function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; - pkt: PAVPacket; flush: cint): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to av_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param dts[out] DTS of the last packet output for the stream, in stream - * time_base units - * @param wall[out] absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @{ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: PAVPacket; dump_payload: cint; st: PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: PAVPacket; dump_payload: cint; - st: PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: PAVOutputFormat; codec_id: TAVCodecID; std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @{ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -procedure avformat_queue_attached_pictures(s: PAVFormatContext); - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-1.0/avio.pas b/src/lib/ffmpeg-1.0/avio.pas deleted file mode 100644 index 5053cc5b..00000000 --- a/src/lib/ffmpeg-1.0/avio.pas +++ /dev/null @@ -1,587 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 54.29.104 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - end; - -type - PByteIOContext = PAVIOContext; { deprecated } - TByteIOContext = TAVIOContext; { deprecated } - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const - (** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - - (** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonble - * means that can be extreemly slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data to the output s. - * - * Force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: {PPAVIOContext} pointer; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -{$IF (LIBAVFORMAT_VERSION_MAJOR < 54)} -function url_is_streamed(s: PAVIOContext): cint; -begin - Result := s^.is_streamed; -end; -{$IFEND} - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-1.0/avutil.pas b/src/lib/ffmpeg-1.0/avutil.pas deleted file mode 100644 index 49d543cc..00000000 --- a/src/lib/ffmpeg-1.0/avutil.pas +++ /dev/null @@ -1,299 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 51.73.101 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 51; - LIBAVUTIL_MAX_VERSION_MINOR = 73; - LIBAVUTIL_MAX_VERSION_RELEASE = 101; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 51; - LIBAVUTIL_MIN_VERSION_MINOR = 73; - LIBAVUTIL_MIN_VERSION_RELEASE = 0; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @{ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf -end; - -(* libavutil/mem.h *) - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-1.0/libavcodec/audioconvert.pas b/src/lib/ffmpeg-1.0/libavcodec/audioconvert.pas deleted file mode 100644 index efedb96a..00000000 --- a/src/lib/ffmpeg-1.0/libavcodec/audioconvert.pas +++ /dev/null @@ -1,252 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/audioconvert.h and libavcodec/audioconvert.h - * avutil version 51.73.101; avcodec version 54.59.100 - * - *) - -(** - * @file - * audio conversion routines - *) - -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -(** avcodec from here **) - -type - TAVAudioConvert = record - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -AVAudioConvert *av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint); - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -int av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint); - cdecl; external av__codec; diff --git a/src/lib/ffmpeg-1.0/libavutil/cpu.pas b/src/lib/ffmpeg-1.0/libavutil/cpu.pas deleted file mode 100644 index ab0a7d10..00000000 --- a/src/lib/ffmpeg-1.0/libavutil/cpu.pas +++ /dev/null @@ -1,114 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 51.73.101 - * - *) - -(** - * @file - * CPU specific - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - -(** - * Return the flags which specify extensions supported by the CPU. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(* The following CPU-specific functions shall not be called directly. *) -function ff_get_cpu_flags_arm(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_ppc(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_x86(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.0/libavutil/dict.pas b/src/lib/ffmpeg-1.0/libavutil/dict.pas deleted file mode 100644 index 915c6e2d..00000000 --- a/src/lib/ffmpeg-1.0/libavutil/dict.pas +++ /dev/null @@ -1,102 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 51.73.101 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() and children. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() and chilren. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.0/libavutil/error.pas b/src/lib/ffmpeg-1.0/libavutil/error.pas deleted file mode 100644 index 476119ed..00000000 --- a/src/lib/ffmpeg-1.0/libavutil/error.pas +++ /dev/null @@ -1,157 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 51.73.101 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @{ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) - -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-1.0/libavutil/log.pas b/src/lib/ffmpeg-1.0/libavutil/log.pas deleted file mode 100644 index 6ad9a02f..00000000 --- a/src/lib/ffmpeg-1.0/libavutil/log.pas +++ /dev/null @@ -1,318 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 51.73.101 - * - *) - -(** - * @file - * log - *) - -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T'), - AV_OPT_TYPE_IMAGE_SIZE = $53495A45 ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for loging is stored. - * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such - * parent context. And a av_log() implementation could then display the parent context - * can be NULL of course - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - -end; - -const - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; dummy: va_list); - cdecl; external av__util; -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -function av_default_item_name (ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.0/libavutil/mathematics.pas b/src/lib/ffmpeg-1.0/libavutil/mathematics.pas deleted file mode 100644 index ecbf2981..00000000 --- a/src/lib/ffmpeg-1.0/libavutil/mathematics.pas +++ /dev/null @@ -1,110 +0,0 @@ -(* - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 51.73.101 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5 ///< Round to nearest and halfway cases away from zero. - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.0/libavutil/mem.pas b/src/lib/ffmpeg-1.0/libavutil/mem.pas deleted file mode 100644 index af2262ee..00000000 --- a/src/lib/ffmpeg-1.0/libavutil/mem.pas +++ /dev/null @@ -1,180 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 51.73.101 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Helper function to allocate a block of size * nmemb bytes with - * using av_malloc() - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Helper function to allocate a block of size * nmemb bytes with - * using av_mallocz() - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * @param tab_ptr Pointer to the array. - * @param nb_ptr Pointer to the number of elements in the array. - * @param elem Element to be added. - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: PCint; elem: pointer); - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - - \ No newline at end of file diff --git a/src/lib/ffmpeg-1.0/libavutil/opt.pas b/src/lib/ffmpeg-1.0/libavutil/opt.pas deleted file mode 100644 index 806b0250..00000000 --- a/src/lib/ffmpeg-1.0/libavutil/opt.pas +++ /dev/null @@ -1,377 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 51.73.101 - * - *) - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR(ENOENT) if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @{ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @} - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @{ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -(** - * @} - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @{ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return 0 on success, a negative error code otherwise - *) -(** - * @note the returned string will av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -(** - * @} - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; -(** - * @} - *) diff --git a/src/lib/ffmpeg-1.0/libavutil/pixfmt.pas b/src/lib/ffmpeg-1.0/libavutil/pixfmt.pas deleted file mode 100644 index cbab6b1b..00000000 --- a/src/lib/ffmpeg-1.0/libavutil/pixfmt.pas +++ /dev/null @@ -1,297 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 51.73.101 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - PIX_FMT_NONE= -1, - PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - PIX_FMT_GRAY8, ///< Y , 8bpp - PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - PIX_FMT_XVMC_MPEG2_IDCT, - PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus - //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately - //is better - PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian - PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian - PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian - PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian - PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian - PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian - PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian - PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian - PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian - - PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - PIX_FMT_Y400A = PIX_FMT_GRAY8A; - PIX_FMT_GBR24P = PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - PIX_FMT_RGB32 = PIX_FMT_ARGB; - PIX_FMT_RGB32_1 = PIX_FMT_RGBA; - PIX_FMT_BGR32 = PIX_FMT_ABGR; - PIX_FMT_BGR32_1 = PIX_FMT_BGRA; - PIX_FMT_0RGB32 = PIX_FMT_0RGB; - PIX_FMT_0BGR32 = PIX_FMT_0BGR; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16BE; - PIX_FMT_RGB48 = PIX_FMT_RGB48BE; - PIX_FMT_RGB565 = PIX_FMT_RGB565BE; - PIX_FMT_RGB555 = PIX_FMT_RGB555BE; - PIX_FMT_RGB444 = PIX_FMT_RGB444BE; - PIX_FMT_BGR48 = PIX_FMT_BGR48BE; - PIX_FMT_BGR565 = PIX_FMT_BGR565BE; - PIX_FMT_BGR555 = PIX_FMT_BGR555BE; - PIX_FMT_BGR444 = PIX_FMT_BGR444BE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9BE; - PIX_FMT_YUV422P9 = PIX_FMT_YUV422P9BE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9BE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10BE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10BE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10BE; - PIX_FMT_YUV420P12 = PIX_FMT_YUV420P12BE; - PIX_FMT_YUV422P12 = PIX_FMT_YUV422P12BE; - PIX_FMT_YUV444P12 = PIX_FMT_YUV444P12BE; - PIX_FMT_YUV420P14 = PIX_FMT_YUV420P14BE; - PIX_FMT_YUV422P14 = PIX_FMT_YUV422P14BE; - PIX_FMT_YUV444P14 = PIX_FMT_YUV444P14BE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16BE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16BE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16BE; - - PIX_FMT_RGBA64 = PIX_FMT_RGBA64BE; - PIX_FMT_BGRA64 = PIX_FMT_BGRA64BE; - PIX_FMT_GBRP9 = PIX_FMT_GBRP9BE; - PIX_FMT_GBRP10 = PIX_FMT_GBRP10BE; - PIX_FMT_GBRP12 = PIX_FMT_GBRP12BE; - PIX_FMT_GBRP14 = PIX_FMT_GBRP14BE; - PIX_FMT_GBRP16 = PIX_FMT_GBRP16BE; -{$ELSE} - PIX_FMT_RGB32 = PIX_FMT_BGRA; - PIX_FMT_RGB32_1 = PIX_FMT_ABGR; - PIX_FMT_BGR32 = PIX_FMT_RGBA; - PIX_FMT_BGR32_1 = PIX_FMT_ARGB; - PIX_FMT_0RGB32 = PIX_FMT_BGR0; - PIX_FMT_0BGR32 = PIX_FMT_RGB0; - - PIX_FMT_GRAY16 = PIX_FMT_GRAY16LE; - PIX_FMT_RGB48 = PIX_FMT_RGB48LE; - PIX_FMT_RGB565 = PIX_FMT_RGB565LE; - PIX_FMT_RGB555 = PIX_FMT_RGB555LE; - PIX_FMT_RGB444 = PIX_FMT_RGB444LE; - PIX_FMT_BGR48 = PIX_FMT_BGR48LE; - PIX_FMT_BGR565 = PIX_FMT_BGR565LE; - PIX_FMT_BGR555 = PIX_FMT_BGR555LE; - PIX_FMT_BGR444 = PIX_FMT_BGR444LE; - - PIX_FMT_YUV420P9 = PIX_FMT_YUV420P9LE; - PIX_FMT_YUV422P9 = PIX_FMT_YUV422P9LE; - PIX_FMT_YUV444P9 = PIX_FMT_YUV444P9LE; - PIX_FMT_YUV420P10 = PIX_FMT_YUV420P10LE; - PIX_FMT_YUV422P10 = PIX_FMT_YUV422P10LE; - PIX_FMT_YUV444P10 = PIX_FMT_YUV444P10LE; - PIX_FMT_YUV420P12 = PIX_FMT_YUV420P12LE; - PIX_FMT_YUV422P12 = PIX_FMT_YUV422P12LE; - PIX_FMT_YUV444P12 = PIX_FMT_YUV444P12LE; - PIX_FMT_YUV420P14 = PIX_FMT_YUV420P14LE; - PIX_FMT_YUV422P14 = PIX_FMT_YUV422P14LE; - PIX_FMT_YUV444P14 = PIX_FMT_YUV444P14LE; - PIX_FMT_YUV420P16 = PIX_FMT_YUV420P16LE; - PIX_FMT_YUV422P16 = PIX_FMT_YUV422P16LE; - PIX_FMT_YUV444P16 = PIX_FMT_YUV444P16LE; - - PIX_FMT_RGBA64 = PIX_FMT_RGBA64LE; - PIX_FMT_BGRA64 = PIX_FMT_BGRA64LE; - PIX_FMT_GBRP9 = PIX_FMT_GBRP9LE; - PIX_FMT_GBRP10 = PIX_FMT_GBRP10LE; - PIX_FMT_GBRP12 = PIX_FMT_GBRP12LE; - PIX_FMT_GBRP14 = PIX_FMT_GBRP14LE; - PIX_FMT_GBRP16 = PIX_FMT_GBRP16LE; -{$ENDIF} diff --git a/src/lib/ffmpeg-1.0/libavutil/samplefmt.pas b/src/lib/ffmpeg-1.0/libavutil/samplefmt.pas deleted file mode 100644 index 83d5a44b..00000000 --- a/src/lib/ffmpeg-1.0/libavutil/samplefmt.pas +++ /dev/null @@ -1,257 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 51.73.101 - * - *) - -type -(** - * Audio Sample Formats - * - * @par - * The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * @par - * The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * @par - * The data layout as used in av_samples_fill_arrays() and elsewhere in Libav - * (such as AVFrame in libavcodec) is as follows: - * - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; deprecated; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return 0 on success or a negative error code on failure - *) -function av_samples_fill_arrays(audio_data: pointer; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return 0 on success or a negative error code on failure - * @see av_samples_fill_arrays() - *) -function av_samples_alloc(audio_data: pointer; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.0/rational.pas b/src/lib/ffmpeg-1.0/rational.pas deleted file mode 100644 index 9f9e43c4..00000000 --- a/src/lib/ffmpeg-1.0/rational.pas +++ /dev/null @@ -1,206 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 51.73.101 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - (* - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b and -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -end. diff --git a/src/lib/ffmpeg-1.0/swresample.pas b/src/lib/ffmpeg-1.0/swresample.pas deleted file mode 100644 index 5ec813bf..00000000 --- a/src/lib/ffmpeg-1.0/swresample.pas +++ /dev/null @@ -1,271 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libswresample/swresample.h: - * version: 0.15.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - {$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) - {$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s Swr context, can be NULL - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - {const} var in_: PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param s allocated Swr context, not yet initialized - * @param channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be - * if its set to 1 the returned delay is in seconds - * if its set to 1000 the returned delay is in milli seconds - * if its set to the input sample rate then the returned delay is in input samples - * if its set to the output sample rate then the returned delay is in output samples - * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate) - * @returns the delay in 1/base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the LIBSWRESAMPLE_VERSION_INT constant. - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - *) -function swresample_configuration(): cuchar; - cdecl; external sw__resample; - -(** - * Return the swr license. - *) -function swresample_license(): cuchar; - cdecl; external sw__resample; - -(** - * @ - *) - -implementation - -end. - diff --git a/src/lib/ffmpeg-1.0/swscale.pas b/src/lib/ffmpeg-1.0/swscale.pas deleted file mode 100644 index ea81338c..00000000 --- a/src/lib/ffmpeg-1.0/swscale.pas +++ /dev/null @@ -1,480 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.1.101 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 101; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -const -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; -{$IF LIBSWSCALE_VERSION_MAJOR < 3} - SWS_CPU_CAPS_MMX2 = $20000000; -{$IFEND} - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IF FF_API_SWS_GETCONTEXT} -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - * @deprecated Use sws_getCachedContext() instead. - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-1.1/How to update the ffmpeg files.txt b/src/lib/ffmpeg-1.1/How to update the ffmpeg files.txt deleted file mode 100644 index 976d0eff..00000000 --- a/src/lib/ffmpeg-1.1/How to update the ffmpeg files.txt +++ /dev/null @@ -1,12 +0,0 @@ -how to update the ffmpeg files: - -1) rational.pas - error.pas -2) mathematics.pas - dict.pas - opt.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-1.1/ToDo.txt b/src/lib/ffmpeg-1.1/ToDo.txt deleted file mode 100644 index de773c78..00000000 --- a/src/lib/ffmpeg-1.1/ToDo.txt +++ /dev/null @@ -1,6 +0,0 @@ -1) opt.pas -PAVClass - -2) avutil.pas -inline function av_x_if_null -inline function av_size_mult diff --git a/src/lib/ffmpeg-1.1/avcodec.pas b/src/lib/ffmpeg-1.1/avcodec.pas deleted file mode 100644 index 02ca8ab8..00000000 --- a/src/lib/ffmpeg-1.1/avcodec.pas +++ /dev/null @@ -1,5400 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 54.86.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 54; - LIBAVCODEC_MAX_VERSION_MINOR = 86; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 54; - LIBAVCODEC_MIN_VERSION_MINOR = 86; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_ALLOC_CONTEXT} -{$define FF_API_ALLOC_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AVCODEC_OPEN} -{$define FF_API_AVCODEC_OPEN := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_TIMECODE} -{$define FF_API_OLD_TIMECODE := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} - -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_MPV_GLOBAL_OPTS} -{$define FF_API_MPV_GLOBAL_OPTS := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_COLOR_TABLE_ID} -{$define FF_API_COLOR_TABLE_ID := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_INTER_THRESHOLD} -{$define FF_API_INTER_THRESHOLD := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_SUB_ID} -{$define FF_API_SUB_ID := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_DSP_MASK} -{$define FF_API_DSP_MASK := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_FIND_BEST_PIX_FMT} -{$define FF_API_FIND_BEST_PIX_FMT := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_VDA_ASYNC} -{$define FF_API_VDA_ASYNC := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - AV_CODEC_ID_MPEG2VIDEO_XVMC, - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_SNOW, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, -(** see below. they need to be hard coded. - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, - AV_CODEC_ID_VOXWARE, - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), -#if LIBAVCODEC_VERSION_MAJOR <= 54 - AV_CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), -#endif - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), -{$IF LIBAVCODEC_VERSION_MAJOR <= 54} - AV_CODEC_ID_8SVX_RAW = $38535658, // MKBETAG('8','S','V','X'), -{$endif} - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_get_descriptor() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(* in bytes *) - AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio -{$IFEND} - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 16; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_SPC_SMPTE240M = 7, - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - (** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - CODEC_FLAG_CBP_RD = $04000000; ///< use rate distortion optimization for cbp - CODEC_FLAG_QP_RD = $08000000; ///< use rate distortion optimization for qp selectioon - CODEC_FLAG2_STRICT_GOP = $00000002; ///< strictly enforce GOP size - CODEC_FLAG2_SKIP_RD = $00004000; ///< RD optimal MB level residual skipping -{$ENDIF} - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; - -(* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -(** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) - - FF_COMPRESSION_DEFAULT = -1; - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; - AV_EF_BUFFER = 4; - AV_EF_EXPLODE = 8; - - AV_EF_CAREFUL = 65536; - AV_EF_COMPLIANT = 131072; - AV_EF_AGGRESSIVE = 262144; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_LIBMPEG2MMX = 4; -{$IFDEF FF_API_MMI} - FF_IDCT_MMI = 5; -{$ENDIF} - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_H264 = 11; - FF_IDCT_VP3 = 12; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_CAVS = 15; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_WMV2 = 19; - FF_IDCT_FAAN = 20; - FF_IDCT_EA = 21; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - FF_IDCT_BINK = 24; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_LEVEL_UNKNOWN = -99; - -type - AVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION - ); - - TAVPacketSideDataType = record - data: PByte; - size: cint; - type_: AVPacketSideDataType; - end; - PAVPacketSideDataType = ^TAVPacketSideDataType; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the destruct field. - * If it is set, the packet data is dynamically allocated and is valid - * indefinitely until av_free_packet() is called (which in turn calls the - * destruct callback to free the data). If destruct is not set, the packet data - * is typically backed by some static buffer somewhere and is only valid for a - * limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideDataType; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - -type - PAVCodecContext = ^TAVCodecContext; - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint64; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; {TAVFrame} - - TAVCodecInternal = record - end; - PAVCodecInternal = ^TAVCodecInternal; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - AVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; - codec_name: array [0..31] of AnsiChar; - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - -{$IFDEF FF_API_SUB_ID} - (** - * @deprecated this field is unused - *) - sub_id: cint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid prolems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this is the number of "priming" samples added to the - * beginning of the stream. The decoded output will be delayed by this - * many samples relative to the input to the encoder. Note that this - * field is purely informational and does not directly affect the pts - * output by the encoder, which should always be based on the actual - * presentation time, including any delay. - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - * Note: For compatibility it is possible to set this instead of - * coded_width/height before decoding. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height if lowres enabled. - * - encoding: unused - * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - (** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - luma_elim_threshold: cint; {deprecated} - - (** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - chroma_elim_threshold: cint; {deprecated} -{$ENDIF} - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - -{$IFDEF FF_API_COLOR_TABLE_ID} - (** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - *) - color_table_id: cint; {deprecated} -{$ENDIF} - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - -{$IFDEF FF_API_INTER_THRESHOLD} - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - inter_threshold: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - (** - * quantizer noise shaping - * - encoding: Set by user. - * - decoding: unused - *) - quantizer_noise_shaping: cint; {deprecated} -{$ENDIF} - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: AVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - rc_buffer_aggressivity: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - -{$IFDEF FF_API_DSP_MASK} - (** - * Unused. - * @deprecated use av_set_cpu_flags_mask() instead. - *) - dsp_mask: cuint; {deprecated} -{$IFEND} - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * avcodec_set_pkt_timebase(avctx) - * - encoding unused. - * - decodimg set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * avcodec_get_codec_descriptior(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Current frame metadata. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - metadata: PAVDictionary; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - (** - * 1 indicates this subtitle is a forced subtitle. - * A forced subtitle should be displayed even when subtitles are hidden. - *) - forced: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -(** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @ - *) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; - -function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; -procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - -function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; -procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -{$IFDEF FF_API_ALLOC_CONTEXT} -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - * - * @deprecated use avcodec_alloc_context3() - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - * @deprecated use avcodec_get_context_defaults3 - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using avcodec_free_frame(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - -{$IFDEF FF_API_AVCODEC_OPEN} -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close - * - * @deprecated use avcodec_open2 - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @addtogroup lavc_packet - * @ - *) - -(* - * Default packet destructor. - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The - * decoder may, however, only utilize part of the buffer by - * setting AVFrame.nb_samples to a smaller value in the - * output frame. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitstreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @addtogroup lavc_encoding - * @ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * deinterlace - if not supported return -1 - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_h - * @param[out] v_shift store log2_chroma_w - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; (**< loss due to resolution change *) - FF_LOSS_DEPTH = $0002; (**< loss due to color depth change *) - FF_LOSS_COLORSPACE = $0004; (**< loss due to color space conversion *) - FF_LOSS_ALPHA = $0008; (**< loss of alpha bits *) - FF_LOSS_COLORQUANT = $0010; (**< loss due to color quantization *) - FF_LOSS_CHROMA = $0020; (**< loss of chroma (e.g. RGB to gray conversion) *) - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur - * (maximum loss for an invalid dst_pix_fmt). - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_FIND_BEST_PIX_FMT} -(** - * @deprecated use avcodec_find_best_pix_fmt_of_2() instead. - * - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_mask parameter. - * - * Note, only the first 64 pixel formats will fit in pix_fmt_mask. - * - * @code - * src_pix_fmt = AV_PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << AV_PIX_FMT_YUV422P) | (1 << AV_PIX_FMT_RGB24); - * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint64; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format and a selection of two destination pixel formats. When converting from - * one pixel format to another, information loss may occur. For example, when converting - * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when - * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of - * the given pixel formats should be used to suffer the least amount of loss. - * - * If one of the destination formats is AV_PIX_FMT_NONE the other pixel format (if valid) will be - * returned. - * - * @code - * src_pix_fmt = AV_PIX_FMT_YUV420P; - * dst_pix_fmt1= AV_PIX_FMT_RGB24; - * dst_pix_fmt2= AV_PIX_FMT_GRAY8; - * dst_pix_fmt3= AV_PIX_FMT_RGB8; - * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from - * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from - * @param[in] src_pix_fmt Source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. - * NULL or value of zero means we care about all losses. Out: the loss - * that occurs when converting from src to selected dst pixel format. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_FORK_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -procedure avcodec_default_free_buffers(s: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -implementation - -end. diff --git a/src/lib/ffmpeg-1.1/avformat.pas b/src/lib/ffmpeg-1.1/avformat.pas deleted file mode 100644 index 2229c20b..00000000 --- a/src/lib/ffmpeg-1.1/avformat.pas +++ /dev/null @@ -1,2261 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 1.1 libavformat/avformat.h - * Version: 54.59.106 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 1.1.x - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 54; - LIBAVFORMAT_MAX_VERSION_MINOR = 59; - LIBAVFORMAT_MAX_VERSION_RELEASE = 106; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 54; - LIBAVFORMAT_MIN_VERSION_MINOR = 59; - LIBAVFORMAT_MIN_VERSION_RELEASE = 0; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -const -{$ifndef FF_API_OLD_AVIO} - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_PKT_DUMP} - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_NEW_STREAM} - FF_API_NEW_STREAM = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_SET_PTS_INFO} - FF_API_SET_PTS_INFO = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} - FF_API_CLOSE_INPUT_FILE = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_APPLEHTTP_PROTO} - FF_API_APPLEHTTP_PROTO = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_READ_PACKET} - FF_API_READ_PACKET = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_INTERLEAVE_PACKET} - FF_API_INTERLEAVE_PACKET = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_AV_GETTIME} - FF_API_AV_GETTIME = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_R_FRAME_RATE} - FF_API_R_FRAME_RATE = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @{ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @{ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.destruct is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.destruct is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @} - * - * @defgroup lavf_encoding Muxing - * @{ - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -type - PAVFile = Pointer; - -(* - * @defgroup metadata_api Public Metadata API - * @{ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @} - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fallback to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fallback to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - - MAX_STD_TIMEBASES = (60*12+6); - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - -(** - * @addtogroup lavf_encoding - * @{ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @{ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - end; - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - duration_error: array[0..1] of array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) -{$IF FF_API_R_FRAME_RATE} - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - *) - r_frame_rate: TAVRational; -{$IFEND} - priv_data: pointer; - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: set by libavformat in avformat_write_header. The muxer may use the - * user-provided value of @ref AVCodecContext.time_base "codec->time_base" - * as a hint. - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why its not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - end; - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and AVOptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * Can only be iformat or oformat, not both at the same time. - * - * decoding: set by avformat_open_input(). - * encoding: set by the user. - *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - *) - priv_data: pointer; - - (* - * I/O context. - * - * decoding: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * encoding: set by the user. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * decoding: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * encoding: streams are created by the user before avformat_write_header(). - *) - nb_streams: cuint; - streams: PPAVStream; - - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - flags: cint; - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * decoding: maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in avformat_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - (** - * decoding: number of frames used to probe fps - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * decoding: set by the user before avformat_open_input(). - * encoding: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * Avoids negative timestamps during muxing - * 0 -> allow negative timestamps - * 1 -> avoid negative timestamps - * -1 -> choose automatically (default) - * Note, this is only works when interleave_packet_per_dts is in use - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - avoid_negative_ts: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cuint; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Packets split by the parser get queued here. - *) - parse_queue: PAVPacketList; - parse_queue_end: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - end; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -{$IF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - * - * @deprecated use avformat_find_stream_info. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->destruct is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -{$IF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; -{$IFEND} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already openened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Libavformat takes - * ownership of the data and will free it when it sees fit using the packet's - * This can be NULL (at any time, not just at the end), to flush the - * interleaving queues. - * @ref AVPacket.destruct "destruct" field. The caller must not access the data - * after this function returns, as it may already be freed. - * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the - * index of the corresponding stream in @ref AVFormatContext.streams - * "s.streams". - * It is very strongly recommended that timing information (@ref AVPacket.pts - * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -{$IF FF_API_INTERLEAVE_PACKET} -(** - * @deprecated this function was never meant to be called by the user - * programs. - *) -function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; - pkt: PAVPacket; flush: cint): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @{ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: PAVPacket; dump_payload: cint; st: PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: PAVPacket; dump_payload: cint; - st: PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: PAVOutputFormat; codec_id: TAVCodecID; std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @{ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -procedure avformat_queue_attached_pictures(s: PAVFormatContext); - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-1.1/avio.pas b/src/lib/ffmpeg-1.1/avio.pas deleted file mode 100644 index 22229974..00000000 --- a/src/lib/ffmpeg-1.1/avio.pas +++ /dev/null @@ -1,599 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 54.59.106 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const - (** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - - (** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonble - * means that can be extreemly slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data to the output s. - * - * Force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: {PPAVIOContext} pointer; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -{$IF (LIBAVFORMAT_VERSION_MAJOR < 54)} -function url_is_streamed(s: PAVIOContext): cint; -begin - Result := s^.is_streamed; -end; -{$IFEND} - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-1.1/avutil.pas b/src/lib/ffmpeg-1.1/avutil.pas deleted file mode 100644 index 5ea0231c..00000000 --- a/src/lib/ffmpeg-1.1/avutil.pas +++ /dev/null @@ -1,299 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 52.13.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 52; - LIBAVUTIL_MAX_VERSION_MINOR = 13; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 52; - LIBAVUTIL_MIN_VERSION_MINOR = 13; - LIBAVUTIL_MIN_VERSION_RELEASE = 0; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @{ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf -end; - -(* libavutil/mem.h *) - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-1.1/libavcodec/audioconvert.pas b/src/lib/ffmpeg-1.1/libavcodec/audioconvert.pas deleted file mode 100644 index 622453c8..00000000 --- a/src/lib/ffmpeg-1.1/libavcodec/audioconvert.pas +++ /dev/null @@ -1,263 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.13.100; avcodec version 54.86.100 - * - *) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -(** avcodec from here **) - -type - TAVAudioConvert = record - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -AVAudioConvert *av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint); - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -int av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint); - cdecl; external av__codec; diff --git a/src/lib/ffmpeg-1.1/libavutil/cpu.pas b/src/lib/ffmpeg-1.1/libavutil/cpu.pas deleted file mode 100644 index 409f62c8..00000000 --- a/src/lib/ffmpeg-1.1/libavutil/cpu.pas +++ /dev/null @@ -1,117 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 52.13.100 - * - *) - -(** - * @file - * CPU specific - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(* The following CPU-specific functions shall not be called directly. *) -function ff_get_cpu_flags_arm(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_ppc(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_x86(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.1/libavutil/dict.pas b/src/lib/ffmpeg-1.1/libavutil/dict.pas deleted file mode 100644 index 4dcf4107..00000000 --- a/src/lib/ffmpeg-1.1/libavutil/dict.pas +++ /dev/null @@ -1,102 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 52.13.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() and children. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() and chilren. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.1/libavutil/error.pas b/src/lib/ffmpeg-1.1/libavutil/error.pas deleted file mode 100644 index f6d19ac5..00000000 --- a/src/lib/ffmpeg-1.1/libavutil/error.pas +++ /dev/null @@ -1,158 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 52.13.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @{ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) - -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-1.1/libavutil/log.pas b/src/lib/ffmpeg-1.1/libavutil/log.pas deleted file mode 100644 index de110bd2..00000000 --- a/src/lib/ffmpeg-1.1/libavutil/log.pas +++ /dev/null @@ -1,348 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 52.13.100 - * - *) - -(** - * @file - * log - *) - -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T'), - AV_OPT_TYPE_IMAGE_SIZE = $53495A45 ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - value_min, value_max: cdouble; ///< For string ranges this represents the min/max length, for dimensions this represents the min/max pixel count - component_min, component_max: cdouble; ///< For string this represents the unicode range for chars, 0-127 limits to ASCII - is_range: cint; ///< if set to 1 the struct encodes a range, if set to 0 a single value - end; - - (** - * List of AVOptionRange structs - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - range: PPAVOptionRange; - nb_ranges: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; dummy: va_list); - cdecl; external av__util; -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -function av_default_item_name (ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.1/libavutil/mathematics.pas b/src/lib/ffmpeg-1.1/libavutil/mathematics.pas deleted file mode 100644 index 7dcb5e1e..00000000 --- a/src/lib/ffmpeg-1.1/libavutil/mathematics.pas +++ /dev/null @@ -1,130 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 52.13.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timesbase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timesbase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-1.1/libavutil/mem.pas b/src/lib/ffmpeg-1.1/libavutil/mem.pas deleted file mode 100644 index db22c82f..00000000 --- a/src/lib/ffmpeg-1.1/libavutil/mem.pas +++ /dev/null @@ -1,191 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.13.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Helper function to allocate a block of size * nmemb bytes with - * using av_malloc() - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Helper function to allocate a block of size * nmemb bytes with - * using av_mallocz() - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * @param tab_ptr Pointer to the array. - * @param nb_ptr Pointer to the number of elements in the array. - * @param elem Element to be added. - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: PCint; elem: pointer); - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * @brief deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-1.1/libavutil/opt.pas b/src/lib/ffmpeg-1.1/libavutil/opt.pas deleted file mode 100644 index 045b348d..00000000 --- a/src/lib/ffmpeg-1.1/libavutil/opt.pas +++ /dev/null @@ -1,485 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 52.13.100 - * - *) - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR(ENOENT) if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @{ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @} - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @{ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -(** - * @} - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @{ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return 0 on success, a negative error code otherwise - *) -(** - * @note the returned string will av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -(** - * @} - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_freep_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_free_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @} - *) diff --git a/src/lib/ffmpeg-1.1/libavutil/pixfmt.pas b/src/lib/ffmpeg-1.1/libavutil/pixfmt.pas deleted file mode 100644 index d14ad215..00000000 --- a/src/lib/ffmpeg-1.1/libavutil/pixfmt.pas +++ /dev/null @@ -1,374 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 52.13.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus - //If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately - //is better - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - *) - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_GRAY8A; - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - PixelFormat = AVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} diff --git a/src/lib/ffmpeg-1.1/libavutil/samplefmt.pas b/src/lib/ffmpeg-1.1/libavutil/samplefmt.pas deleted file mode 100644 index 667df5c0..00000000 --- a/src/lib/ffmpeg-1.1/libavutil/samplefmt.pas +++ /dev/null @@ -1,260 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 52.13.100 - * - *) - -type -(** - * Audio Sample Formats - * - * @par - * The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * @par - * The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * @par - * The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; deprecated; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(audio_data: pointer; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - *) -function av_samples_alloc(audio_data: pointer; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.1/rational.pas b/src/lib/ffmpeg-1.1/rational.pas deleted file mode 100644 index 850a45ea..00000000 --- a/src/lib/ffmpeg-1.1/rational.pas +++ /dev/null @@ -1,206 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 52.13.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - (* - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b and -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -end. diff --git a/src/lib/ffmpeg-1.1/swresample.pas b/src/lib/ffmpeg-1.1/swresample.pas deleted file mode 100644 index 0d7211ff..00000000 --- a/src/lib/ffmpeg-1.1/swresample.pas +++ /dev/null @@ -1,277 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libswresample/swresample.h: - * version: 0.17.102 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - {$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) - {$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s Swr context, can be NULL - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - {const} var in_: PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param s allocated Swr context, not yet initialized - * @param channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be - * if its set to 1 the returned delay is in seconds - * if its set to 1000 the returned delay is in milli seconds - * if its set to the input sample rate then the returned delay is in input samples - * if its set to the output sample rate then the returned delay is in output samples - * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate) - * @returns the delay in 1/base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the LIBSWRESAMPLE_VERSION_INT constant. - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - *) -function swresample_configuration(): cuchar; - cdecl; external sw__resample; - -(** - * Return the swr license. - *) -function swresample_license(): cuchar; - cdecl; external sw__resample; - -(** - * @ - *) - -implementation - -end. - diff --git a/src/lib/ffmpeg-1.1/swscale.pas b/src/lib/ffmpeg-1.1/swscale.pas deleted file mode 100644 index 016b2536..00000000 --- a/src/lib/ffmpeg-1.1/swscale.pas +++ /dev/null @@ -1,478 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.1.103 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 103; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -const -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IF FF_API_SWS_GETCONTEXT} -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - * @deprecated Use sws_getCachedContext() instead. - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-1.2/How to update the ffmpeg files.txt b/src/lib/ffmpeg-1.2/How to update the ffmpeg files.txt deleted file mode 100644 index 7e376454..00000000 --- a/src/lib/ffmpeg-1.2/How to update the ffmpeg files.txt +++ /dev/null @@ -1,17 +0,0 @@ -how to update the ffmpeg files: - -1) cpu.pas - dict.pas - error.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-1.2/ToDo.txt b/src/lib/ffmpeg-1.2/ToDo.txt deleted file mode 100644 index 44a1a058..00000000 --- a/src/lib/ffmpeg-1.2/ToDo.txt +++ /dev/null @@ -1,11 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog diff --git a/src/lib/ffmpeg-1.2/avcodec.pas b/src/lib/ffmpeg-1.2/avcodec.pas deleted file mode 100644 index a02f3a76..00000000 --- a/src/lib/ffmpeg-1.2/avcodec.pas +++ /dev/null @@ -1,5445 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 54.92.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 54; - LIBAVCODEC_MAX_VERSION_MINOR = 92; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 54; - LIBAVCODEC_MIN_VERSION_MINOR = 92; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_ALLOC_CONTEXT} -{$define FF_API_ALLOC_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AVCODEC_OPEN} -{$define FF_API_AVCODEC_OPEN := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_TIMECODE} -{$define FF_API_OLD_TIMECODE := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} - -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_MPV_GLOBAL_OPTS} -{$define FF_API_MPV_GLOBAL_OPTS := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_COLOR_TABLE_ID} -{$define FF_API_COLOR_TABLE_ID := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_INTER_THRESHOLD} -{$define FF_API_INTER_THRESHOLD := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_SUB_ID} -{$define FF_API_SUB_ID := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_DSP_MASK} -{$define FF_API_DSP_MASK := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_FIND_BEST_PIX_FMT} -{$define FF_API_FIND_BEST_PIX_FMT := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_VDA_ASYNC} -{$define FF_API_VDA_ASYNC := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - AV_CODEC_ID_MPEG2VIDEO_XVMC, - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_SNOW, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, -(** see below. they need to be hard coded. - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, - AV_CODEC_ID_VOXWARE, - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), -#if LIBAVCODEC_VERSION_MAJOR <= 54 - AV_CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), -#endif - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), -{$IF LIBAVCODEC_VERSION_MAJOR <= 54} - AV_CODEC_ID_8SVX_RAW = $38535658, // MKBETAG('8','S','V','X'), -{$endif} - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D'), - AV_CODEC_ID_EVRC = $73657663, // MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = $73736D76, // MKBETAG('s','s','m','v'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_get_descriptor() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Subtitle codec is bitmap based - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(* in bytes *) - AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio -{$IFEND} - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 16; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_SPC_SMPTE240M = 7, - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - (** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! - CODEC_FLAG2_IGNORE_CROP = $00010000; ///< Discard cropping information from SPS. -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - CODEC_FLAG_CBP_RD = $04000000; ///< use rate distortion optimization for cbp - CODEC_FLAG_QP_RD = $08000000; ///< use rate distortion optimization for qp selectioon - CODEC_FLAG2_STRICT_GOP = $00000002; ///< strictly enforce GOP size - CODEC_FLAG2_SKIP_RD = $00004000; ///< RD optimal MB level residual skipping -{$ENDIF} - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; - -(* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -(** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is intra only. - *) - CODEC_CAP_INTRA_ONLY = $40000000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) - - FF_COMPRESSION_DEFAULT = -1; - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; - AV_EF_BUFFER = 4; - AV_EF_EXPLODE = 8; - - AV_EF_CAREFUL = 65536; - AV_EF_COMPLIANT = 131072; - AV_EF_AGGRESSIVE = 262144; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_LIBMPEG2MMX = 4; -{$IFDEF FF_API_MMI} - FF_IDCT_MMI = 5; -{$ENDIF} - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; -{$IFDEF FF_API_MMI} - FF_IDCT_H264 = 11; - FF_IDCT_VP3 = 12; - FF_IDCT_CAVS = 15; - FF_IDCT_WMV2 = 19; - FF_IDCT_EA = 21; - FF_IDCT_BINK = 24; -{$ENDIF} - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_LEVEL_UNKNOWN = -99; - -type - AVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL - ); - - TAVPacketSideDataType = record - data: PByte; - size: cint; - type_: AVPacketSideDataType; - end; - PAVPacketSideDataType = ^TAVPacketSideDataType; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the destruct field. - * If it is set, the packet data is dynamically allocated and is valid - * indefinitely until av_free_packet() is called (which in turn calls the - * destruct callback to free the data). If destruct is not set, the packet data - * is typically backed by some static buffer somewhere and is only valid for a - * limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideDataType; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - -type - PAVCodecContext = ^TAVCodecContext; - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; {TAVFrame} - - TAVCodecInternal = record - end; - PAVCodecInternal = ^TAVCodecInternal; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - AVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; - codec_name: array [0..31] of AnsiChar; - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - -{$IFDEF FF_API_SUB_ID} - (** - * @deprecated this field is unused - *) - sub_id: cint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid prolems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this is the number of "priming" samples added to the - * beginning of the stream. The decoded output will be delayed by this - * many samples relative to the input to the encoder. Note that this - * field is purely informational and does not directly affect the pts - * output by the encoder, which should always be based on the actual - * presentation time, including any delay. - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - * Note: For compatibility it is possible to set this instead of - * coded_width/height before decoding. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height if lowres enabled. - * - encoding: unused - * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - (** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - luma_elim_threshold: cint; {deprecated} - - (** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - chroma_elim_threshold: cint; {deprecated} -{$ENDIF} - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - -{$IFDEF FF_API_COLOR_TABLE_ID} - (** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - *) - color_table_id: cint; {deprecated} -{$ENDIF} - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - -{$IFDEF FF_API_INTER_THRESHOLD} - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - inter_threshold: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_GLOBAL_OPTS} - (** - * quantizer noise shaping - * - encoding: Set by user. - * - decoding: unused - *) - quantizer_noise_shaping: cint; {deprecated} -{$ENDIF} - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: AVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - rc_buffer_aggressivity: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - -{$IFDEF FF_API_DSP_MASK} - (** - * Unused. - * @deprecated use av_set_cpu_flags_mask() instead. - *) - dsp_mask: cuint; {deprecated} -{$IFEND} - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decodimg set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Current frame metadata. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - metadata: PAVDictionary; - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -(** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @ - *) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; - -function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; -procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - -function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; -procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -{$IFDEF FF_API_ALLOC_CONTEXT} -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - * - * @deprecated use avcodec_alloc_context3() - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - * @deprecated use avcodec_get_context_defaults3 - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using avcodec_free_frame(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - -{$IFDEF FF_API_AVCODEC_OPEN} -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close - * - * @deprecated use avcodec_open2 - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @addtogroup lavc_packet - * @ - *) - -(* - * Default packet destructor. - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The - * decoder may, however, only utilize part of the buffer by - * setting AVFrame.nb_samples to a smaller value in the - * output frame. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitstreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @addtogroup lavc_encoding - * @ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_DEINTERLACE} -(** - * deinterlace - if not supported return -1 - * - * @deprecated - use yadif (in libavfilter) instead - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_h - * @param[out] v_shift store log2_chroma_w - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; (**< loss due to resolution change *) - FF_LOSS_DEPTH = $0002; (**< loss due to color depth change *) - FF_LOSS_COLORSPACE = $0004; (**< loss due to color space conversion *) - FF_LOSS_ALPHA = $0008; (**< loss of alpha bits *) - FF_LOSS_COLORQUANT = $0010; (**< loss due to color quantization *) - FF_LOSS_CHROMA = $0020; (**< loss of chroma (e.g. RGB to gray conversion) *) - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur - * (maximum loss for an invalid dst_pix_fmt). - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_FIND_BEST_PIX_FMT} -(** - * @deprecated use avcodec_find_best_pix_fmt_of_2() instead. - * - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_mask parameter. - * - * Note, only the first 64 pixel formats will fit in pix_fmt_mask. - * - * @code - * src_pix_fmt = AV_PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << AV_PIX_FMT_YUV422P) | (1 << AV_PIX_FMT_RGB24); - * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint64; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format and a selection of two destination pixel formats. When converting from - * one pixel format to another, information loss may occur. For example, when converting - * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when - * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of - * the given pixel formats should be used to suffer the least amount of loss. - * - * If one of the destination formats is AV_PIX_FMT_NONE the other pixel format (if valid) will be - * returned. - * - * @code - * src_pix_fmt = AV_PIX_FMT_YUV420P; - * dst_pix_fmt1= AV_PIX_FMT_RGB24; - * dst_pix_fmt2= AV_PIX_FMT_GRAY8; - * dst_pix_fmt3= AV_PIX_FMT_RGB8; - * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from - * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from - * @param[in] src_pix_fmt Source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. - * NULL or value of zero means we care about all losses. Out: the loss - * that occurs when converting from src to selected dst pixel format. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_FORK_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -procedure avcodec_default_free_buffers(s: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -implementation - -end. diff --git a/src/lib/ffmpeg-1.2/avformat.pas b/src/lib/ffmpeg-1.2/avformat.pas deleted file mode 100644 index 408fe0ef..00000000 --- a/src/lib/ffmpeg-1.2/avformat.pas +++ /dev/null @@ -1,2280 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 1.2 libavformat/avformat.h - * Version: 54.63.104 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 1.2.x - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 54; - LIBAVFORMAT_MAX_VERSION_MINOR = 63; - LIBAVFORMAT_MAX_VERSION_RELEASE = 104; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 54; - LIBAVFORMAT_MIN_VERSION_MINOR = 63; - LIBAVFORMAT_MIN_VERSION_RELEASE = 0; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_OLD_AVIO} -{$define FF_API_OLD_AVIO := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PKT_DUMP} -{$define FF_API_PKT_DUMP := (LIBAVFORMAT_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} -{$define FF_API_ALLOC_OUTPUT_CONTEXT := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} -{$define FF_API_FORMAT_PARAMETERS := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_NEW_STREAM} -{$define FF_API_NEW_STREAM := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_SET_PTS_INFO} -{$define FF_API_SET_PTS_INFO := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} -{$define FF_API_CLOSE_INPUT_FILE := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_APPLEHTTP_PROTO} -{$define FF_API_APPLEHTTP_PROTO := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_READ_PACKET} -{$define FF_API_READ_PACKET := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_INTERLEAVE_PACKET} -{$define FF_API_INTERLEAVE_PACKET := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AV_GETTIME} -{$define FF_API_AV_GETTIME := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @{ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @{ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.destruct is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.destruct is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @} - * - * @defgroup lavf_encoding Muxing - * @{ - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -type - PAVFile = Pointer; - -(* - * @defgroup metadata_api Public Metadata API - * @{ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @} - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fallback to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fallback to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - - MAX_STD_TIMEBASES = (60*12+6); - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @{ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - end; - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - duration_error: array[0..1] of array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) -{$IFDEF FF_API_R_FRAME_RATE} - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - *) - r_frame_rate: TAVRational; -{$IFEND} - priv_data: pointer; - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: set by libavformat in avformat_write_header. The muxer may use the - * user-provided value of @ref AVCodecContext.time_base "codec->time_base" - * as a hint. - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - end; - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and AVOptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * Can only be iformat or oformat, not both at the same time. - * - * decoding: set by avformat_open_input(). - * encoding: set by the user. - *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - *) - priv_data: pointer; - - (* - * I/O context. - * - * decoding: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * encoding: set by the user. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * decoding: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * encoding: streams are created by the user before avformat_write_header(). - *) - nb_streams: cuint; - streams: PPAVStream; - - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - flags: cint; - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * decoding: maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in avformat_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - (** - * decoding: number of frames used to probe fps - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * decoding: set by the user before avformat_open_input(). - * encoding: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * Avoids negative timestamps during muxing - * 0 -> allow negative timestamps - * 1 -> avoid negative timestamps - * -1 -> choose automatically (default) - * Note, this is only works when interleave_packet_per_dts is in use - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - avoid_negative_ts: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cuint; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Packets split by the parser get queued here. - *) - parse_queue: PAVPacketList; - parse_queue_end: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - end; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -{$IFDEF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -{$IFDEF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - * - * @deprecated use avformat_find_stream_info. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->destruct is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IFDEF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -{$IFDEF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IFEND} - -{$IFDEF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; -{$IFEND} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already openened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Libavformat takes - * ownership of the data and will free it when it sees fit using the packet's - * This can be NULL (at any time, not just at the end), to flush the - * interleaving queues. - * @ref AVPacket.destruct "destruct" field. The caller must not access the data - * after this function returns, as it may already be freed. - * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the - * index of the corresponding stream in @ref AVFormatContext.streams - * "s.streams". - * It is very strongly recommended that timing information (@ref AVPacket.pts - * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -{$IFDEF FF_API_INTERLEAVE_PACKET} -(** - * @deprecated this function was never meant to be called by the user - * programs. - *) -function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; - pkt: PAVPacket; flush: cint): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @{ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: PAVPacket; dump_payload: cint; st: PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: PAVPacket; dump_payload: cint; - st: PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: PAVOutputFormat; codec_id: TAVCodecID; std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @{ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -procedure avformat_queue_attached_pictures(s: PAVFormatContext); - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-1.2/avio.pas b/src/lib/ffmpeg-1.2/avio.pas deleted file mode 100644 index 139b00e3..00000000 --- a/src/lib/ffmpeg-1.2/avio.pas +++ /dev/null @@ -1,599 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 54.63.104 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const - (** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - - (** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonble - * means that can be extreemly slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data to the output s. - * - * Force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: {PPAVIOContext} pointer; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(var s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -{$IF (LIBAVFORMAT_VERSION_MAJOR < 54)} -function url_is_streamed(s: PAVIOContext): cint; -begin - Result := s^.is_streamed; -end; -{$IFEND} - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-1.2/avutil.pas b/src/lib/ffmpeg-1.2/avutil.pas deleted file mode 100644 index b3883ffa..00000000 --- a/src/lib/ffmpeg-1.2/avutil.pas +++ /dev/null @@ -1,299 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 52.18.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 52; - LIBAVUTIL_MAX_VERSION_MINOR = 18; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 52; - LIBAVUTIL_MIN_VERSION_MINOR = 18; - LIBAVUTIL_MIN_VERSION_RELEASE = 0; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @{ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-1.2/libavcodec/audioconvert.pas b/src/lib/ffmpeg-1.2/libavcodec/audioconvert.pas deleted file mode 100644 index e43007c5..00000000 --- a/src/lib/ffmpeg-1.2/libavcodec/audioconvert.pas +++ /dev/null @@ -1,283 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.18.100; avcodec version 54.92.100 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; diff --git a/src/lib/ffmpeg-1.2/libavutil/cpu.pas b/src/lib/ffmpeg-1.2/libavutil/cpu.pas deleted file mode 100644 index c9aa3c12..00000000 --- a/src/lib/ffmpeg-1.2/libavutil/cpu.pas +++ /dev/null @@ -1,112 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 52.18.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(* The following CPU-specific functions shall not be called directly. *) -function ff_get_cpu_flags_arm(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_ppc(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_x86(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.2/libavutil/dict.pas b/src/lib/ffmpeg-1.2/libavutil/dict.pas deleted file mode 100644 index 1e7f36b4..00000000 --- a/src/lib/ffmpeg-1.2/libavutil/dict.pas +++ /dev/null @@ -1,120 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 52.18.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() and children. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() and chilren. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/dict.c: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add to a dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.2/libavutil/error.pas b/src/lib/ffmpeg-1.2/libavutil/error.pas deleted file mode 100644 index 3faba70e..00000000 --- a/src/lib/ffmpeg-1.2/libavutil/error.pas +++ /dev/null @@ -1,157 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 52.18.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @{ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-1.2/libavutil/log.pas b/src/lib/ffmpeg-1.2/libavutil/log.pas deleted file mode 100644 index 39ad09c8..00000000 --- a/src/lib/ffmpeg-1.2/libavutil/log.pas +++ /dev/null @@ -1,349 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 52.18.100 - * - *) - -(** - * @file - * log - *) - -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_IMAGE_SIZE = $53495A45 ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - value_min, value_max: cdouble; ///< For string ranges this represents the min/max length, for dimensions this represents the min/max pixel count - component_min, component_max: cdouble; ///< For string this represents the unicode range for chars, 0-127 limits to ASCII - is_range: cint; ///< if set to 1 the struct encodes a range, if set to 0 a single value - end; - - (** - * List of AVOptionRange structs - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - range: PPAVOptionRange; - nb_ranges: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; dummy: va_list); - cdecl; external av__util; -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -function av_default_item_name (ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.2/libavutil/mathematics.pas b/src/lib/ffmpeg-1.2/libavutil/mathematics.pas deleted file mode 100644 index dfea0c45..00000000 --- a/src/lib/ffmpeg-1.2/libavutil/mathematics.pas +++ /dev/null @@ -1,130 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 52.18.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timesbase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timesbase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-1.2/libavutil/mem.pas b/src/lib/ffmpeg-1.2/libavutil/mem.pas deleted file mode 100644 index ff4231a2..00000000 --- a/src/lib/ffmpeg-1.2/libavutil/mem.pas +++ /dev/null @@ -1,191 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.18.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Helper function to allocate a block of size * nmemb bytes with - * using av_malloc() - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Helper function to allocate a block of size * nmemb bytes with - * using av_mallocz() - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * @param tab_ptr Pointer to the array. - * @param nb_ptr Pointer to the number of elements in the array. - * @param elem Element to be added. - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: PCint; elem: pointer); - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * @brief deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-1.2/libavutil/opt.pas b/src/lib/ffmpeg-1.2/libavutil/opt.pas deleted file mode 100644 index b805fd81..00000000 --- a/src/lib/ffmpeg-1.2/libavutil/opt.pas +++ /dev/null @@ -1,490 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 52.18.100 - * - *) - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - * @deprecated use av_opt_set() - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -{$IFDEF FF_API_OLD_AVOPTIONS} -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @{ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @} - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @{ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -(** - * @} - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @{ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return 0 on success, a negative error code otherwise - *) -(** - * @note the returned string will av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -(** - * @} - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_freep_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_free_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @} - *) diff --git a/src/lib/ffmpeg-1.2/libavutil/pixfmt.pas b/src/lib/ffmpeg-1.2/libavutil/pixfmt.pas deleted file mode 100644 index da126bea..00000000 --- a/src/lib/ffmpeg-1.2/libavutil/pixfmt.pas +++ /dev/null @@ -1,412 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 52.18.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus - //If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately - //is better - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - *) - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of PIX_FMT_YUV411P and setting color_range - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -const - AV_PIX_FMT_YUVA422P = AV_PIX_FMT_YUVA422P_LIBAV; - AV_PIX_FMT_YUVA444P = AV_PIX_FMT_YUVA444P_LIBAV; -{$ENDIF} - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_GRAY8A; - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - PixelFormat = AVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} diff --git a/src/lib/ffmpeg-1.2/libavutil/samplefmt.pas b/src/lib/ffmpeg-1.2/libavutil/samplefmt.pas deleted file mode 100644 index 8ed65ed5..00000000 --- a/src/lib/ffmpeg-1.2/libavutil/samplefmt.pas +++ /dev/null @@ -1,260 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 52.18.100 - * - *) - -type -(** - * Audio Sample Formats - * - * @par - * The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * @par - * The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * @par - * The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-1.2/rational.pas b/src/lib/ffmpeg-1.2/rational.pas deleted file mode 100644 index 9e2d6a50..00000000 --- a/src/lib/ffmpeg-1.2/rational.pas +++ /dev/null @@ -1,207 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 52.18.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -end. diff --git a/src/lib/ffmpeg-1.2/swresample.pas b/src/lib/ffmpeg-1.2/swresample.pas deleted file mode 100644 index c3adb474..00000000 --- a/src/lib/ffmpeg-1.2/swresample.pas +++ /dev/null @@ -1,286 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libswresample/swresample.h: - * version: 0.17.102 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - {$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) - {$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s Swr context, can be NULL - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - {const} var in_: PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param s allocated Swr context, not yet initialized - * @param channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be - * if its set to 1 the returned delay is in seconds - * if its set to 1000 the returned delay is in milli seconds - * if its set to the input sample rate then the returned delay is in input samples - * if its set to the output sample rate then the returned delay is in output samples - * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate) - * @returns the delay in 1/base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the LIBSWRESAMPLE_VERSION_INT constant. - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - *) -function swresample_configuration(): cuchar; - cdecl; external sw__resample; - -(** - * Return the swr license. - *) -function swresample_license(): cuchar; - cdecl; external sw__resample; - -(** - * @ - *) - -implementation - -end. - diff --git a/src/lib/ffmpeg-1.2/swscale.pas b/src/lib/ffmpeg-1.2/swscale.pas deleted file mode 100644 index 636d5bf5..00000000 --- a/src/lib/ffmpeg-1.2/swscale.pas +++ /dev/null @@ -1,479 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.2.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 2; - LIBSWSCALE_MAX_VERSION_RELEASE = 100; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -const -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - SWS_ERROR_DIFFUSION = $800000; - -{$IF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IF FF_API_SWS_GETCONTEXT} -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - * @deprecated Use sws_getCachedContext() instead. - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.0/How to update the ffmpeg files.txt b/src/lib/ffmpeg-2.0/How to update the ffmpeg files.txt deleted file mode 100644 index 7e376454..00000000 --- a/src/lib/ffmpeg-2.0/How to update the ffmpeg files.txt +++ /dev/null @@ -1,17 +0,0 @@ -how to update the ffmpeg files: - -1) cpu.pas - dict.pas - error.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-2.0/ToDo.txt b/src/lib/ffmpeg-2.0/ToDo.txt deleted file mode 100644 index 44a1a058..00000000 --- a/src/lib/ffmpeg-2.0/ToDo.txt +++ /dev/null @@ -1,11 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog diff --git a/src/lib/ffmpeg-2.0/avcodec.pas b/src/lib/ffmpeg-2.0/avcodec.pas deleted file mode 100644 index ace02b3e..00000000 --- a/src/lib/ffmpeg-2.0/avcodec.pas +++ /dev/null @@ -1,5698 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 55.18.102 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 55; - LIBAVCODEC_MAX_VERSION_MINOR = 18; - LIBAVCODEC_MAX_VERSION_RELEASE = 102; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 55; - LIBAVCODEC_MIN_VERSION_MINOR = 18; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -const -{$ifndef FF_API_REQUEST_CHANNELS} - FF_API_REQUEST_CHANNELS = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_ALLOC_CONTEXT} - FF_API_ALLOC_CONTEXT = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_AVCODEC_OPEN} - FF_API_AVCODEC_OPEN = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} - FF_API_OLD_DECODE_AUDIO = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OLD_TIMECODE} - FF_API_OLD_TIMECODE = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} - -{$ifndef FF_API_OLD_ENCODE_AUDIO} - FF_API_OLD_ENCODE_AUDIO = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} - FF_API_OLD_ENCODE_VIDEO = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_MPV_GLOBAL_OPTS} - FF_API_MPV_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_COLOR_TABLE_ID} - FF_API_COLOR_TABLE_ID = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_INTER_THRESHOLD} - FF_API_INTER_THRESHOLD = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_SUB_ID} - FF_API_SUB_ID = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_DSP_MASK} - FF_API_DSP_MASK = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_FIND_BEST_PIX_FMT} - FF_API_FIND_BEST_PIX_FMT = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_CODEC_ID} - FF_API_CODEC_ID = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_VDA_ASYNC} - FF_API_VDA_ASYNC = (LIBAVCODEC_VERSION_MAJOR < 55); -{$endif} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @{ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - AV_CODEC_ID_MPEG2VIDEO_XVMC, - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130_DEPRECATED, - AV_CODEC_ID_G2M_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'), - AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'), - AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'), - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, -(** see below. they need to be hard coded. - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '), - AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, - AV_CODEC_ID_VOXWARE, - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_ASS = $41534B20, // MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_DVD_NAV = $444E4156, // MKBETAG('D','N','A','V'), - AV_CODEC_ID_ADPCM_DTK = $44544B20, // MKBETAG('D','T','K',' '), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_ADPCM_IMA_RAD = $52414420, // MKBETAG('R','A','D',' '), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SMVJPEG = $534D564A, // MKBETAG('S','M','V','J'), - AV_CODEC_ID_SNOW = $534E4F57, // MKBETAG('S','N','O','W'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBP = $57454250, // MKBETAG('W','E','B','P'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D'), - AV_CODEC_ID_EVRC = $73657663, // MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = $73736D76, // MKBETAG('s','s','m','v'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_get_descriptor() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 16; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_SPC_SMPTE240M = 7, - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = $0001; - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - (** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! - CODEC_FLAG2_IGNORE_CROP = $00010000; ///< Discard cropping information from SPS. - - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; - -(* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -(** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - -{$IFDEF FF_API_GET_BUFFER} - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; - AV_EF_BUFFER = 4; - AV_EF_EXPLODE = 8; - - AV_EF_CAREFUL = 65536; - AV_EF_COMPLIANT = 131072; - AV_EF_AGGRESSIVE = 262144; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 1; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 2; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_LEVEL_UNKNOWN = -99; - -type - AVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS - ); - - TAVPacketSideDataType = record - data: PByte; - size: cint; - type_: AVPacketSideDataType; - end; - PAVPacketSideDataType = ^TAVPacketSideDataType; - - PAVBuffer = ^TAVBuffer; - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: PAVBuffer; - - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: Pcuint8; - (** - * Size of data in bytes. - *) - size: cint; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf or destruct (deprecated) - * fields. If either is set, the packet data is dynamically allocated and is - * valid indefinitely until av_free_packet() is called (which in turn calls - * av_buffer_unref()/the destruct callback to free the data). If neither is set, - * the packet data is typically backed by some static buffer somewhere and is - * only valid for a limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideDataType; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; -{$IFDEF FF_API_DESTRUCT_PACKET} - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; -{$ENDIF} - - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - -const - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - -type - PAVCodecContext = ^TAVCodecContext; - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) -} - - TAVCodecInternal = record - end; - PAVCodecInternal = ^TAVCodecInternal; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; - codec_name: array [0..31] of AnsiChar; - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this is the number of "priming" samples added to the - * beginning of the stream. The decoded output will be delayed by this - * many samples relative to the input to the encoder. Note that this - * field is purely informational and does not directly affect the pts - * output by the encoder, which should always be based on the actual - * presentation time, including any delay. - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - -{$IFDEF FF_API_GET_BUFFER} - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated use get_buffer2() - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated custom freeing callbacks should be set from get_buffer2() - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; {deprecated;} - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} -{$ENDIF} - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise exended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * If CODEC_FLAG_EMU_EDGE is not set in s->flags, the buffer must contain an - * edge of the size returned by avcodec_get_edge_width() on all sides. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - rc_buffer_aggressivity: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: PAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -(** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @ - *) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; - -function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; -procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - -function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; -procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - -function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; -procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -{$IF FF_API_ALLOC_CONTEXT} -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - * - * @deprecated use avcodec_alloc_context3() - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - * @deprecated use avcodec_get_context_defaults3 - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using avcodec_free_frame(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - -{$IF FF_API_AVCODEC_OPEN} -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close - * - * @deprecated use avcodec_open2 - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -{$IFDEF FF_API_DESTRUCT_PACKET} -(* - * Default packet destructor. - * @deprecated use the AVBuffer API instead - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: Pcuint8; size: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_GET_BUFFER} -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; deprecated; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. - * The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. The - * caller may not write to it. - * - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_DEINTERLACE} -(** - * deinterlace - if not supported return -1 *) - * - * @deprecated - use yadif (in libavfilter) instead - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @{ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @{ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; (**< loss due to resolution change *) - FF_LOSS_DEPTH = $0002; (**< loss due to color depth change *) - FF_LOSS_COLORSPACE = $0004; (**< loss due to color space conversion *) - FF_LOSS_ALPHA = $0008; (**< loss of alpha bits *) - FF_LOSS_COLORQUANT = $0010; (**< loss due to color quantization *) - FF_LOSS_CHROMA = $0020; (**< loss of chroma (e.g. RGB to gray conversion) *) - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur - * (maximum loss for an invalid dst_pix_fmt). - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format and a selection of two destination pixel formats. When converting from - * one pixel format to another, information loss may occur. For example, when converting - * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when - * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of - * the given pixel formats should be used to suffer the least amount of loss. - * - * If one of the destination formats is AV_PIX_FMT_NONE the other pixel format (if valid) will be - * returned. - * - * @code - * src_pix_fmt = AV_PIX_FMT_YUV420P; - * dst_pix_fmt1= AV_PIX_FMT_RGB24; - * dst_pix_fmt2= AV_PIX_FMT_GRAY8; - * dst_pix_fmt3= AV_PIX_FMT_RGB8; - * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from - * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from - * @param[in] src_pix_fmt Source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. - * NULL or value of zero means we care about all losses. Out: the loss - * that occurs when converting from src to selected dst pixel format. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is availble in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output output buffer is not allocated - * and the output buffer should be considered identical to the input - * buffer, or in case *poutbuf was set it points to the input buffer - * (not necessarily to its starting address). - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-2.0/avformat.pas b/src/lib/ffmpeg-2.0/avformat.pas deleted file mode 100644 index 32af4522..00000000 --- a/src/lib/ffmpeg-2.0/avformat.pas +++ /dev/null @@ -1,2356 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 55.12.100 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 1.1.x - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 55; - LIBAVFORMAT_MAX_VERSION_MINOR = 12; - LIBAVFORMAT_MAX_VERSION_RELEASE = 100; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 55; - LIBAVFORMAT_MIN_VERSION_MINOR = 12; - LIBAVFORMAT_MIN_VERSION_RELEASE = 0; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -const -{$ifndef FF_API_OLD_AVIO} - FF_API_OLD_AVIO = (LIBAVFORMAT_VERSION_MAJOR < 55); -{$endif} -{$ifndef FF_API_PKT_DUMP} - FF_API_PKT_DUMP = (LIBAVFORMAT_VERSION_MAJOR < 54); -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} - FF_API_ALLOC_OUTPUT_CONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 56); -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} - FF_API_FORMAT_PARAMETERS = (LIBAVFORMAT_VERSION_MAJOR < 56); -{$endif} -{$ifndef FF_API_NEW_STREAM} - FF_API_NEW_STREAM = (LIBAVFORMAT_VERSION_MAJOR < 56); -{$endif} -{$ifndef FF_API_SET_PTS_INFO} - FF_API_SET_PTS_INFO = (LIBAVFORMAT_VERSION_MAJOR < 56); -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} - FF_API_CLOSE_INPUT_FILE = (LIBAVFORMAT_VERSION_MAJOR < 56); -{$endif} -{$ifndef FF_API_READ_PACKET} - FF_API_READ_PACKET = (LIBAVFORMAT_VERSION_MAJOR < 56); -{$endif} -{$ifndef FF_API_ASS_SSA} - FF_API_ASS_SSA = (LIBAVFORMAT_VERSION_MAJOR < 56); -{$endif} -{$ifndef FF_API_R_FRAME_RATE} - FF_API_R_FRAME_RATE = 1; -{$endif} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @{ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @{ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @} - * - * @defgroup lavf_encoding Muxing - * @{ - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -type - PAVFile = Pointer; - -(* - * @defgroup metadata_api Public Metadata API - * @{ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @} - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MAX = 100; ///< maximum score - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - - MAX_STD_TIMEBASES = (60*12+6); - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; /**< stream for hearing impaired audiences */ - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; /**< stream for visual impaired audiences */ - AV_DISPOSITION_CLEAN_EFFECTS = $0200; /**< stream without voice */ -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - -(** - * @addtogroup lavf_encoding - * @{ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @{ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230; // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - duration_error: ^array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - priv_data: pointer; - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: set by libavformat in avformat_write_header. The muxer may use the - * user-provided value of @ref AVCodecContext.time_base "codec->time_base" - * as a hint. - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - end; (** TAVStream **) - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and AVOptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * Can only be iformat or oformat, not both at the same time. - * - * decoding: set by avformat_open_input(). - * encoding: set by the user. - *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - *) - priv_data: pointer; - - (* - * I/O context. - * - * decoding: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * encoding: set by the user. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PByteIOContext; - - (* stream info *) - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * decoding: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * encoding: streams are created by the user before avformat_write_header(). - *) - nb_streams: cuint; - streams: PPAVStream; - - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - flags: cint; - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * decoding: maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in avformat_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - (** - * decoding: number of frames used to probe fps - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * decoding: set by the user before avformat_open_input(). - * encoding: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * Avoid negative timestamps during muxing - * 0 -> allow negative timestamps - * 1 -> avoid negative timestamps - * -1 -> choose automatically (default) - * Note, this only works when interleave_packet_per_dts is in use - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - avoid_negative_ts: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cuint; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Packets split by the parser get queued here. - *) - parse_queue: PAVPacketList; - parse_queue_end: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - (** - * Offset to remap timestamps to be non-negative. - * Expressed in timebase units. - * @see AVStream.mux_ts_offset - *) - offset: cint64; - - (** - * Timebase for the timestamp offset. - *) - offset_timebase: TAVRational; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - -end; (** TAVFormatContext **) - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @{ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @{ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint); - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -{$IF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - * - * @deprecated use avformat_find_stream_info. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -{$IF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IFEND} - -{$IF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; -{$IFEND} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. pkt->buf must be set - * to a valid AVBufferRef describing the packet data. Libavformat takes - * ownership of this reference and will unref it when it sees fit. The caller - * must not access the data through this reference after this function returns. - * This can be NULL (at any time, not just at the end), to flush the - * interleaving queues. - * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the - * index of the corresponding stream in @ref AVFormatContext.streams - * "s.streams". - * It is very strongly recommended that timing information (@ref AVPacket.pts - * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @{ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: PAVPacket; dump_payload: cint; st: PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: PAVPacket; dump_payload: cint; - st: PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID, - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: PAVOutputFormat; codec_id: TAVCodecID; std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @{ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.0/avio.pas b/src/lib/ffmpeg-2.0/avio.pas deleted file mode 100644 index 32ca278f..00000000 --- a/src/lib/ffmpeg-2.0/avio.pas +++ /dev/null @@ -1,598 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 55.12.100 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const -(** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data to the output s. - * - * Force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-2.0/avutil.pas b/src/lib/ffmpeg-2.0/avutil.pas deleted file mode 100644 index d305e031..00000000 --- a/src/lib/ffmpeg-2.0/avutil.pas +++ /dev/null @@ -1,327 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 52.38.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 52; - LIBAVUTIL_MAX_VERSION_MINOR = 38; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 52; - LIBAVUTIL_MIN_VERSION_MINOR = 38; - LIBAVUTIL_MIN_VERSION_RELEASE = 0; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @{ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-2.0/libavcodec/audioconvert.pas b/src/lib/ffmpeg-2.0/libavcodec/audioconvert.pas deleted file mode 100644 index 73c76f22..00000000 --- a/src/lib/ffmpeg-2.0/libavcodec/audioconvert.pas +++ /dev/null @@ -1,283 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.38.100; avcodec version 55.18.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; diff --git a/src/lib/ffmpeg-2.0/libavutil/cpu.pas b/src/lib/ffmpeg-2.0/libavutil/cpu.pas deleted file mode 100644 index 635b8928..00000000 --- a/src/lib/ffmpeg-2.0/libavutil/cpu.pas +++ /dev/null @@ -1,118 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 52.38.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; - -(* The following CPU-specific functions shall not be called directly. *) -function ff_get_cpu_flags_arm(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_ppc(): cint; - cdecl; external av__util; -function ff_get_cpu_flags_x86(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.0/libavutil/dict.pas b/src/lib/ffmpeg-2.0/libavutil/dict.pas deleted file mode 100644 index 21886657..00000000 --- a/src/lib/ffmpeg-2.0/libavutil/dict.pas +++ /dev/null @@ -1,120 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 52.38.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() and children. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() and chilren. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add to a dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.0/libavutil/error.pas b/src/lib/ffmpeg-2.0/libavutil/error.pas deleted file mode 100644 index 4406c2cd..00000000 --- a/src/lib/ffmpeg-2.0/libavutil/error.pas +++ /dev/null @@ -1,157 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 52.38.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @{ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-2.0/libavutil/log.pas b/src/lib/ffmpeg-2.0/libavutil/log.pas deleted file mode 100644 index 1ce782ff..00000000 --- a/src/lib/ffmpeg-2.0/libavutil/log.pas +++ /dev/null @@ -1,352 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 52.38.100 - * - *) - -(** - * @file - * log - *) - -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_COLOR = $434F4C52 ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_DURATION = $44555220 ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_IMAGE_SIZE = $53495A45 ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to AVRational -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - value_min, value_max: cdouble; ///< For string ranges this represents the min/max length, for dimensions this represents the min/max pixel count - component_min, component_max: cdouble; ///< For string this represents the unicode range for chars, 0-127 limits to ASCII - is_range: cint; ///< if set to 1 the struct encodes a range, if set to 0 a single value - end; - - (** - * List of AVOptionRange structs - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - range: PPAVOptionRange; - nb_ranges: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; dummy: va_list); - cdecl; external av__util; -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -function av_default_item_name (ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.0/libavutil/mathematics.pas b/src/lib/ffmpeg-2.0/libavutil/mathematics.pas deleted file mode 100644 index 60c9e16c..00000000 --- a/src/lib/ffmpeg-2.0/libavutil/mathematics.pas +++ /dev/null @@ -1,130 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 52.38.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @{ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timesbase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timesbase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-2.0/libavutil/mem.pas b/src/lib/ffmpeg-2.0/libavutil/mem.pas deleted file mode 100644 index 17c3461c..00000000 --- a/src/lib/ffmpeg-2.0/libavutil/mem.pas +++ /dev/null @@ -1,267 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.38.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Helper function to allocate a block of size * nmemb bytes with - * using av_malloc() - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_malloc(z)() or av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Helper function to allocate a block of size * nmemb bytes with - * using av_mallocz() - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * @brief deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-2.0/libavutil/opt.pas b/src/lib/ffmpeg-2.0/libavutil/opt.pas deleted file mode 100644 index 862e202a..00000000 --- a/src/lib/ffmpeg-2.0/libavutil/opt.pas +++ /dev/null @@ -1,506 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 52.38.100 - * - *) - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - * @deprecated use av_opt_set() - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -{$IFDEF FF_API_OLD_AVOPTIONS} -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar - flags: byte, - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @{ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; -(** - * @} - *) - - const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @{ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @} - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @{ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return 0 on success, a negative error code otherwise - *) -(** - * @note the returned string will av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -(** - * @} - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_freep_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_free_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @} - *) diff --git a/src/lib/ffmpeg-2.0/libavutil/pixfmt.pas b/src/lib/ffmpeg-2.0/libavutil/pixfmt.pas deleted file mode 100644 index c80e13d1..00000000 --- a/src/lib/ffmpeg-2.0/libavutil/pixfmt.pas +++ /dev/null @@ -1,382 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 52.38.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus - //If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately - //is better - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - /** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - */ - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -{$IFDEF AV_HAVE_INCOMPATIBLE_FORK_ABI} -const - AV_PIX_FMT_YUVA422P = AV_PIX_FMT_YUVA422P_LIBAV; - AV_PIX_FMT_YUVA444P = AV_PIX_FMT_YUVA444P_LIBAV; -{$ENDIF} - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_GRAY8A; - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - PixelFormat = AVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} diff --git a/src/lib/ffmpeg-2.0/libavutil/samplefmt.pas b/src/lib/ffmpeg-2.0/libavutil/samplefmt.pas deleted file mode 100644 index 877d6207..00000000 --- a/src/lib/ffmpeg-2.0/libavutil/samplefmt.pas +++ /dev/null @@ -1,275 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 52.38.100 - * - *) - -type -(** - * Audio Sample Formats - * - * @par - * The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * @par - * The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * @par - * The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.0/rational.pas b/src/lib/ffmpeg-2.0/rational.pas deleted file mode 100644 index 54319362..00000000 --- a/src/lib/ffmpeg-2.0/rational.pas +++ /dev/null @@ -1,207 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 52.38.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -end. diff --git a/src/lib/ffmpeg-2.0/swresample.pas b/src/lib/ffmpeg-2.0/swresample.pas deleted file mode 100644 index c3adb474..00000000 --- a/src/lib/ffmpeg-2.0/swresample.pas +++ /dev/null @@ -1,286 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libswresample/swresample.h: - * version: 0.17.102 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - {$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) - {$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s Swr context, can be NULL - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - {const} var in_: PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param s allocated Swr context, not yet initialized - * @param channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be - * if its set to 1 the returned delay is in seconds - * if its set to 1000 the returned delay is in milli seconds - * if its set to the input sample rate then the returned delay is in input samples - * if its set to the output sample rate then the returned delay is in output samples - * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate) - * @returns the delay in 1/base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the LIBSWRESAMPLE_VERSION_INT constant. - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - *) -function swresample_configuration(): cuchar; - cdecl; external sw__resample; - -(** - * Return the swr license. - *) -function swresample_license(): cuchar; - cdecl; external sw__resample; - -(** - * @ - *) - -implementation - -end. - diff --git a/src/lib/ffmpeg-2.0/swscale.pas b/src/lib/ffmpeg-2.0/swscale.pas deleted file mode 100644 index 6bcd3638..00000000 --- a/src/lib/ffmpeg-2.0/swscale.pas +++ /dev/null @@ -1,486 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.3.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 3; - LIBSWSCALE_MAX_VERSION_RELEASE = 100; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -const -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IF FF_API_SWS_GETCONTEXT} -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - * @deprecated Use sws_getCachedContext() instead. - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.1/How to update the ffmpeg files.txt b/src/lib/ffmpeg-2.1/How to update the ffmpeg files.txt deleted file mode 100644 index 7e376454..00000000 --- a/src/lib/ffmpeg-2.1/How to update the ffmpeg files.txt +++ /dev/null @@ -1,17 +0,0 @@ -how to update the ffmpeg files: - -1) cpu.pas - dict.pas - error.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-2.1/ToDo.txt b/src/lib/ffmpeg-2.1/ToDo.txt deleted file mode 100644 index 44a1a058..00000000 --- a/src/lib/ffmpeg-2.1/ToDo.txt +++ /dev/null @@ -1,11 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog diff --git a/src/lib/ffmpeg-2.1/avcodec.pas b/src/lib/ffmpeg-2.1/avcodec.pas deleted file mode 100644 index 5aeaee4b..00000000 --- a/src/lib/ffmpeg-2.1/avcodec.pas +++ /dev/null @@ -1,5720 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 55.18.102 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 55; - LIBAVCODEC_MAX_VERSION_MINOR = 39; - LIBAVCODEC_MAX_VERSION_RELEASE = 101; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 55; - LIBAVCODEC_MIN_VERSION_MINOR = 39; - LIBAVCODEC_MIN_VERSION_RELEASE = 100; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ALLOC_CONTEXT} -{$define FF_API_ALLOC_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AVCODEC_OPEN} -{$define FF_API_AVCODEC_OPEN := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_TIMECODE} -{$define FF_API_OLD_TIMECODE := (LIBAVCODEC_VERSION_MAJOR < 55)} -{$endif} - -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DEINTERLACE} -{$define FF_API_DEINTERLACE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DESTRUCT_PACKET} -{$define FF_API_DESTRUCT_PACKET := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_GET_BUFFER} -{$define FF_API_GET_BUFFER := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} - -(*defines not present anymore in ffmpeg-2.1 avcodec/version.h -{$ifndef FF_API_MPV_GLOBAL_OPTS} -{$define FF_API_MPV_GLOBAL_OPTS := (LIBAVCODEC_VERSION_MAJOR < 55)}; -{$endif} -{$ifndef FF_API_COLOR_TABLE_ID} -{$define FF_API_COLOR_TABLE_ID := (LIBAVCODEC_VERSION_MAJOR < 55)}; -{$endif} -{$ifndef FF_API_INTER_THRESHOLD} -{$define FF_API_INTER_THRESHOLD := (LIBAVCODEC_VERSION_MAJOR < 55)}; -{$endif} -{$ifndef FF_API_SUB_ID} -{$define FF_API_SUB_ID := (LIBAVCODEC_VERSION_MAJOR < 55)}; -{$endif} -{$ifndef FF_API_DSP_MASK} -{$define FF_API_DSP_MASK := (LIBAVCODEC_VERSION_MAJOR < 55)}; -{$endif} -{$ifndef FF_API_FIND_BEST_PIX_FMT} -{$define FF_API_FIND_BEST_PIX_FMT := (LIBAVCODEC_VERSION_MAJOR < 55)}; -{$endif} -{$ifndef FF_API_VDA_ASYNC} -{$define FF_API_VDA_ASYNC := (LIBAVCODEC_VERSION_MAJOR < 55)}; -{$endif} -*) - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @{ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - AV_CODEC_ID_MPEG2VIDEO_XVMC, - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130_DEPRECATED, - AV_CODEC_ID_G2M_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'), - AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'), - AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'), - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, -(** see below. they need to be hard coded. - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '), - AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, - AV_CODEC_ID_VOXWARE, - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_ASS = $41534B20, // MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_DVD_NAV = $444E4156, // MKBETAG('D','N','A','V'), - AV_CODEC_ID_ADPCM_DTK = $44544B20, // MKBETAG('D','T','K',' '), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_ADPCM_IMA_RAD = $52414420, // MKBETAG('R','A','D',' '), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SMVJPEG = $534D564A, // MKBETAG('S','M','V','J'), - AV_CODEC_ID_SNOW = $534E4F57, // MKBETAG('S','N','O','W'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBP = $57454250, // MKBETAG('W','E','B','P'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D') - AV_CODEC_ID_EVRC = $73657663, // MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = $73736D76, // MKBETAG('s','s','m','v'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_get_descriptor() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 16; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_SPC_SMPTE240M = 7, - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = $0001; - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - (** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! - CODEC_FLAG2_IGNORE_CROP = $00010000; ///< Discard cropping information from SPS. - - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; - -(* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -(** - * Codec is able to deal with negative linesizes - *) - CODEC_CAP_NEG_LINESIZES = $0800; - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; - -{$IFDEF FF_API_GET_BUFFER} - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; - AV_EF_BUFFER = 4; - AV_EF_EXPLODE = 8; - - AV_EF_CAREFUL = 65536; - AV_EF_COMPLIANT = 131072; - AV_EF_AGGRESSIVE = 262144; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 1; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 2; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_LEVEL_UNKNOWN = -99; - -type - AVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS - ); - - TAVPacketSideDataType = record - data: PByte; - size: cint; - type_: AVPacketSideDataType; - end; - PAVPacketSideDataType = ^TAVPacketSideDataType; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf or destruct (deprecated) - * fields. If either is set, the packet data is dynamically allocated and is - * valid indefinitely until av_free_packet() is called (which in turn calls - * av_buffer_unref()/the destruct callback to free the data). If neither is set, - * the packet data is typically backed by some static buffer somewhere and is - * only valid for a limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideDataType; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; -{$IFDEF FF_API_DESTRUCT_PACKET} - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; -{$ENDIF} - - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; - codec_name: array [0..31] of AnsiChar; - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this is the number of "priming" samples added to the - * beginning of the stream. The decoded output will be delayed by this - * many samples relative to the input to the encoder. Note that this - * field is purely informational and does not directly affect the pts - * output by the encoder, which should always be based on the actual - * presentation time, including any delay. - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - -{$IFDEF FF_API_GET_BUFFER} - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated use get_buffer2() - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated custom freeing callbacks should be set from get_buffer2() - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; {deprecated;} - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} -{$ENDIF} - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise exended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * If CODEC_FLAG_EMU_EDGE is not set in s->flags, the buffer must contain an - * edge of the size returned by avcodec_get_edge_width() on all sides. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - rc_buffer_aggressivity: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - - (** - * Current packet as passed into the decoder, to avoid having - * to pass the packet into every function. Currently only valid - * inside lavc and get/release_buffer callbacks. - * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts - * - encoding: unused - *) - pkt: PAVPacket; - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: PAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - end; {TAVHWAccel} - -const - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -{$IFDEF FF_API_ALLOC_CONTEXT} -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - * - * @deprecated use avcodec_alloc_context3() - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; deprecated; - -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - * @deprecated use avcodec_get_context_defaults3 - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; deprecated; - -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using avcodec_free_frame(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - -{$IFDEF FF_API_AVCODEC_OPEN} -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close - * - * @deprecated use avcodec_open2 - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -{$IFDEF FF_API_DESTRUCT_PACKET} -(* - * Default packet destructor. - * @deprecated use the AVBuffer API instead - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_GET_BUFFER} -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; deprecated; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. - * The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. The - * caller may not write to it. - * - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_DEINTERLACE} -(** - * deinterlace - if not supported return -1 - * - * @deprecated - use yadif (in libavfilter) instead - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @{ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @{ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; (**< loss due to resolution change *) - FF_LOSS_DEPTH = $0002; (**< loss due to color depth change *) - FF_LOSS_COLORSPACE = $0004; (**< loss due to color space conversion *) - FF_LOSS_ALPHA = $0008; (**< loss of alpha bits *) - FF_LOSS_COLORQUANT = $0010; (**< loss due to color quantization *) - FF_LOSS_CHROMA = $0020; (**< loss of chroma (e.g. RGB to gray conversion) *) - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur - * (maximum loss for an invalid dst_pix_fmt). - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format and a selection of two destination pixel formats. When converting from - * one pixel format to another, information loss may occur. For example, when converting - * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when - * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of - * the given pixel formats should be used to suffer the least amount of loss. - * - * If one of the destination formats is AV_PIX_FMT_NONE the other pixel format (if valid) will be - * returned. - * - * @code - * src_pix_fmt = AV_PIX_FMT_YUV420P; - * dst_pix_fmt1= AV_PIX_FMT_RGB24; - * dst_pix_fmt2= AV_PIX_FMT_GRAY8; - * dst_pix_fmt3= AV_PIX_FMT_RGB8; - * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from - * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from - * @param[in] src_pix_fmt Source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. - * NULL or value of zero means we care about all losses. Out: the loss - * that occurs when converting from src to selected dst pixel format. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is availble in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output output buffer is not allocated - * and the output buffer should be considered identical to the input - * buffer, or in case *poutbuf was set it points to the input buffer - * (not necessarily to its starting address). - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-2.1/avformat.pas b/src/lib/ffmpeg-2.1/avformat.pas deleted file mode 100644 index b97e4259..00000000 --- a/src/lib/ffmpeg-2.1/avformat.pas +++ /dev/null @@ -1,2362 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 55.12.100 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 1.1.x - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 55; - LIBAVFORMAT_MAX_VERSION_MINOR = 19; - LIBAVFORMAT_MAX_VERSION_RELEASE = 104; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 55; - LIBAVFORMAT_MIN_VERSION_MINOR = 19; - LIBAVFORMAT_MIN_VERSION_RELEASE = 104; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(*old defines not present anymore in ffmpeg-2.1 -{$ifndef FF_API_OLD_AVIO} -{$define FF_API_OLD_AVIO := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PKT_DUMP} -{$define FF_API_PKT_DUMP := (LIBAVFORMAT_VERSION_MAJOR < 54) -{$endif} -*) -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} -{$define FF_API_ALLOC_OUTPUT_CONTEXT := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} -{$define FF_API_FORMAT_PARAMETERS := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_NEW_STREAM} -{$define FF_API_NEW_STREAM := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_SET_PTS_INFO} -{$define FF_API_SET_PTS_INFO := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} -{$define FF_API_CLOSE_INPUT_FILE := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_READ_PACKET} -{$define FF_API_READ_PACKET := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ASS_SSA} -{$define FF_API_ASS_SSA := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @{ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @{ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @} - * - * @defgroup lavf_encoding Muxing - * @{ - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -type - PAVFile = Pointer; - -(* - * @defgroup metadata_api Public Metadata API - * @{ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @} - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MAX = 100; ///< maximum score - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - - MAX_STD_TIMEBASES = (60*12+6); - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - -(** - * @addtogroup lavf_encoding - * @{ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @{ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - priv_data: pointer; - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: set by libavformat in avformat_write_header. The muxer may use the - * user-provided value of @ref AVCodecContext.time_base "codec->time_base" - * as a hint. - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and AVOptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * Can only be iformat or oformat, not both at the same time. - * - * decoding: set by avformat_open_input(). - * encoding: set by the user. - *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - *) - priv_data: pointer; - - (* - * I/O context. - * - * decoding: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * encoding: set by the user. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * decoding: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * encoding: streams are created by the user before avformat_write_header(). - *) - nb_streams: cuint; - streams: PPAVStream; - - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - flags: cint; - - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - - (** - * decoding: maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in avformat_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - - (** - * decoding: number of frames used to probe fps - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * decoding: set by the user before avformat_open_input(). - * encoding: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * Avoid negative timestamps during muxing - * 0 -> allow negative timestamps - * 1 -> avoid negative timestamps - * -1 -> choose automatically (default) - * Note, this only works when interleave_packet_per_dts is in use - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - avoid_negative_ts: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cuint; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Packets split by the parser get queued here. - *) - parse_queue: PAVPacketList; - parse_queue_end: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - (** - * Offset to remap timestamps to be non-negative. - * Expressed in timebase units. - * @see AVStream.mux_ts_offset - *) - offset: cint64; - - (** - * Timebase for the timestamp offset. - *) - offset_timebase: TAVRational; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - -end; (** TAVFormatContext **) - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @{ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -{$IFDEF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -{$IFDEF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - * - * @deprecated use avformat_find_stream_info. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IFDEF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -{$IFDEF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IFEND} - -{$IFDEF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; -{$IFEND} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. pkt->buf must be set - * to a valid AVBufferRef describing the packet data. Libavformat takes - * ownership of this reference and will unref it when it sees fit. The caller - * must not access the data through this reference after this function returns. - * This can be NULL (at any time, not just at the end), to flush the - * interleaving queues. - * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the - * index of the corresponding stream in @ref AVFormatContext.streams - * "s.streams". - * It is very strongly recommended that timing information (@ref AVPacket.pts - * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @{ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: PAVPacket; dump_payload: cint; st: PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: PAVPacket; dump_payload: cint; - st: PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: PAVOutputFormat; codec_id: TAVCodecID; std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @{ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.1/avio.pas b/src/lib/ffmpeg-2.1/avio.pas deleted file mode 100644 index 32ca278f..00000000 --- a/src/lib/ffmpeg-2.1/avio.pas +++ /dev/null @@ -1,598 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 55.12.100 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const -(** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data to the output s. - * - * Force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-2.1/avutil.pas b/src/lib/ffmpeg-2.1/avutil.pas deleted file mode 100644 index fa8e74d6..00000000 --- a/src/lib/ffmpeg-2.1/avutil.pas +++ /dev/null @@ -1,332 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 52.48.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 52; - LIBAVUTIL_MAX_VERSION_MINOR = 48; - LIBAVUTIL_MAX_VERSION_RELEASE = 101; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 52; - LIBAVUTIL_MIN_VERSION_MINOR = 48; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-2.1/libavcodec/audioconvert.pas b/src/lib/ffmpeg-2.1/libavcodec/audioconvert.pas deleted file mode 100644 index 73c76f22..00000000 --- a/src/lib/ffmpeg-2.1/libavcodec/audioconvert.pas +++ /dev/null @@ -1,283 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.38.100; avcodec version 55.18.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; diff --git a/src/lib/ffmpeg-2.1/libavutil/buffer.pas b/src/lib/ffmpeg-2.1/libavutil/buffer.pas deleted file mode 100644 index 6eead1dc..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/buffer.pas +++ /dev/null @@ -1,283 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 52.48.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferRef; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - * @see av_buffer_pool_can_uninit() - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.1/libavutil/cpu.pas b/src/lib/ffmpeg-2.1/libavutil/cpu.pas deleted file mode 100644 index 4cb468a8..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/cpu.pas +++ /dev/null @@ -1,114 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 52.48.100 - 52.48.101 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.1/libavutil/dict.pas b/src/lib/ffmpeg-2.1/libavutil/dict.pas deleted file mode 100644 index 21886657..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/dict.pas +++ /dev/null @@ -1,120 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 52.38.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() and children. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() and chilren. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found entry or NULL, changing key or value leads to undefined behavior. - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add to a dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.1/libavutil/error.pas b/src/lib/ffmpeg-2.1/libavutil/error.pas deleted file mode 100644 index 5ddd2a74..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/error.pas +++ /dev/null @@ -1,157 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 52.38.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-2.1/libavutil/frame.pas b/src/lib/ffmpeg-2.1/libavutil/frame.pas deleted file mode 100644 index 725ebce1..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/frame.pas +++ /dev/null @@ -1,733 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 52.48.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN - ); - - PAVFrameSideData = ^TAVFrameSideData; - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. -*) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiplies of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - -{$IFDEF FF_API_AVFRAME_LAVC} - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; {deprecated} -{$ENDIF} - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - reference: cint; {deprecated} - - (** - * QP table - *) - qscale_table: pbyte; {deprecated} - - (** - * QP store stride - *) - qstride: cint; {deprecated} - qscale_type: cint; {deprecated} - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - *) - mbskip_table: pbyte; {deprecated} - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - *) - motion_val: array [0..1] of pointer; {deprecated} - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - *) - mb_type: PCuint; {deprecated} - - (** - * DCT coefficients - *) - dct_coeff: PsmallInt; {deprecated} - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - *) - ref_index: array [0..1] of pbyte; {deprecated} -{$ENDIF} - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - type_: cint; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - buffer_hints: cint; {deprecated} - (** - * Pan scan. - *) - pan_scan: PAVPanScan; {deprecated} -{$ENDIF} - - (** - * reordered opaque 64bit (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - (** - * @deprecated this field is unused - *) - hwaccel_picture_private: pointer; {deprecated} - owner: PAVCodecContext; {deprecated} - thread_opaque: pointer; {deprecated} - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - *) - motion_subsample_log2: cuint8; {deprecated} -{$ENDIF} - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Move everythnig contained in src to dst and reset src. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-2.1/libavutil/log.pas b/src/lib/ffmpeg-2.1/libavutil/log.pas deleted file mode 100644 index 8bcc95bf..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/log.pas +++ /dev/null @@ -1,426 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 52.38.100 - * - *) - -(** - * @file - * log - *) - -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - value_min, value_max: cdouble; ///< For string ranges this represents the min/max length, for dimensions this represents the min/max pixel count - component_min, component_max: cdouble; ///< For string this represents the unicode range for chars, 0-127 limits to ASCII - is_range: cint; ///< if set to 1 the struct encodes a range, if set to 0 a single value - end; - - (** - * List of AVOptionRange structs - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - range: PPAVOptionRange; - nb_ranges: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param ap The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.1/libavutil/mathematics.pas b/src/lib/ffmpeg-2.1/libavutil/mathematics.pas deleted file mode 100644 index 9964b6fd..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/mathematics.pas +++ /dev/null @@ -1,130 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 52.38.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timesbase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timesbase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-2.1/libavutil/mem.pas b/src/lib/ffmpeg-2.1/libavutil/mem.pas deleted file mode 100644 index d7e0ca90..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/mem.pas +++ /dev/null @@ -1,303 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.38.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of size * nmemb bytes with av_malloc(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param size Size in bytes of the memory block to be allocated or - * reallocated. - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate a block of memory. - * If *ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param size Size in bytes for the memory block to be allocated or - * reallocated - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_reallocp(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array through a pointer to a pointer. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate a block of size * nmemb bytes with av_mallocz(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - diff --git a/src/lib/ffmpeg-2.1/libavutil/opt.pas b/src/lib/ffmpeg-2.1/libavutil/opt.pas deleted file mode 100644 index 3783431d..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/opt.pas +++ /dev/null @@ -1,516 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 52.38.100 - * - *) - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that (opt->flags & mask) == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - * @deprecated use av_opt_set() - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -{$IFDEF FF_API_OLD_AVOPTIONS} -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_freep_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_free_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-2.1/libavutil/pixfmt.pas b/src/lib/ffmpeg-2.1/libavutil/pixfmt.pas deleted file mode 100644 index 09a0aff0..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/pixfmt.pas +++ /dev/null @@ -1,451 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 52.48.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * Make sure that all newly added big-endian formats have (pix_fmt & 1) == 1 - * and that all newly added little-endian formats have (pix_fmt & 1) == 0. - * This allows simpler detection of big vs little-endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - *) - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ - - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -const - AV_PIX_FMT_YUVA422P = AV_PIX_FMT_YUVA422P_LIBAV; - AV_PIX_FMT_YUVA444P = AV_PIX_FMT_YUVA444P_LIBAV; -{$ENDIF} - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_GRAY8A; - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - PixelFormat = AVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} diff --git a/src/lib/ffmpeg-2.1/libavutil/samplefmt.pas b/src/lib/ffmpeg-2.1/libavutil/samplefmt.pas deleted file mode 100644 index 1da4372a..00000000 --- a/src/lib/ffmpeg-2.1/libavutil/samplefmt.pas +++ /dev/null @@ -1,275 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 52.48.100 - * - *) - -type -(** - * Audio Sample Formats - * - * @par - * The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * @par - * The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * @par - * The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.1/rational.pas b/src/lib/ffmpeg-2.1/rational.pas deleted file mode 100644 index 54319362..00000000 --- a/src/lib/ffmpeg-2.1/rational.pas +++ /dev/null @@ -1,207 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 52.38.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -end. diff --git a/src/lib/ffmpeg-2.1/swresample.pas b/src/lib/ffmpeg-2.1/swresample.pas deleted file mode 100644 index 6b9146a8..00000000 --- a/src/lib/ffmpeg-2.1/swresample.pas +++ /dev/null @@ -1,286 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libswresample/swresample.h: - * version: 0.17.104 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - {$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) - {$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s Swr context, can be NULL - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - {const} var in_: PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param s allocated Swr context, not yet initialized - * @param channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be - * if its set to 1 the returned delay is in seconds - * if its set to 1000 the returned delay is in milli seconds - * if its set to the input sample rate then the returned delay is in input samples - * if its set to the output sample rate then the returned delay is in output samples - * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate) - * @returns the delay in 1/base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the LIBSWRESAMPLE_VERSION_INT constant. - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - *) -function swresample_configuration(): cuchar; - cdecl; external sw__resample; - -(** - * Return the swr license. - *) -function swresample_license(): cuchar; - cdecl; external sw__resample; - -(** - * @ - *) - -implementation - -end. - diff --git a/src/lib/ffmpeg-2.1/swscale.pas b/src/lib/ffmpeg-2.1/swscale.pas deleted file mode 100644 index 0a107c1d..00000000 --- a/src/lib/ffmpeg-2.1/swscale.pas +++ /dev/null @@ -1,486 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.3.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 5; - LIBSWSCALE_MAX_VERSION_RELEASE = 101; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -const -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} - FF_API_SWS_GETCONTEXT = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} - FF_API_SWS_CPU_CAPS = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} - FF_API_SWS_FORMAT_NAME = LIBSWSCALE_VERSION_MAJOR < 3; -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IF FF_API_SWS_GETCONTEXT} -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - * @deprecated Use sws_getCachedContext() instead. - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.2/How to update the ffmpeg files.txt b/src/lib/ffmpeg-2.2/How to update the ffmpeg files.txt deleted file mode 100644 index 7e376454..00000000 --- a/src/lib/ffmpeg-2.2/How to update the ffmpeg files.txt +++ /dev/null @@ -1,17 +0,0 @@ -how to update the ffmpeg files: - -1) cpu.pas - dict.pas - error.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-2.2/ToDo.txt b/src/lib/ffmpeg-2.2/ToDo.txt deleted file mode 100644 index 44a1a058..00000000 --- a/src/lib/ffmpeg-2.2/ToDo.txt +++ /dev/null @@ -1,11 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog diff --git a/src/lib/ffmpeg-2.2/avcodec.pas b/src/lib/ffmpeg-2.2/avcodec.pas deleted file mode 100644 index 66a3b551..00000000 --- a/src/lib/ffmpeg-2.2/avcodec.pas +++ /dev/null @@ -1,5856 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 55.52.102 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 55; - LIBAVCODEC_MAX_VERSION_MINOR = 52; - LIBAVCODEC_MAX_VERSION_RELEASE = 102; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 55; - LIBAVCODEC_MIN_VERSION_MINOR = 52; - LIBAVCODEC_MIN_VERSION_RELEASE = 102; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DEINTERLACE} -{$define FF_API_DEINTERLACE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DESTRUCT_PACKET} -{$define FF_API_DESTRUCT_PACKET := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_GET_BUFFER} -{$define FF_API_GET_BUFFER := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_THREAD_OPAQUE} -{$define FF_API_THREAD_OPAQUE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CODEC_PKT} -{$define FF_API_CODEC_PKT := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FAST_MALLOC} -{$define FF_API_FAST_MALLOC := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} - - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @{ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130_DEPRECATED, - AV_CODEC_ID_G2M_DEPRECATED, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC_DEPRECATED, - AV_CODEC_ID_FIC, - -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'), - AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'), - AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'), - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, -(** see below. they need to be hard coded. - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '), - AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'), - AV_CODEC_ID_TIMED_ID3 = MKBETAG('T','I','D','3'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_ASS = $41534B20, // MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_DVD_NAV = $444E4156, // MKBETAG('D','N','A','V'), - AV_CODEC_ID_ADPCM_DTK = $44544B20, // MKBETAG('D','T','K',' '), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_ADPCM_IMA_RAD = $52414420, // MKBETAG('R','A','D',' '), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SMVJPEG = $534D564A, // MKBETAG('S','M','V','J'), - AV_CODEC_ID_SNOW = $534E4F57, // MKBETAG('S','N','O','W'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_TIMED_ID3 = $54494433, // MKBETAG('T','I','D','3'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBP = $57454250, // MKBETAG('W','E','B','P'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D') - AV_CODEC_ID_EVRC = $73657663, // MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = $73736D76, // MKBETAG('s','s','m','v'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_get_descriptor() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 16; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); - - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = $0001; - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_OUTPUT_CORRUPT = $0008; ///< Output even those frames that might be corrupted - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - (** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! - CODEC_FLAG2_IGNORE_CROP = $00010000; ///< Discard cropping information from SPS. - - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note: AVPanScan is now (28/09/2014) defined in libavutil/frame.pas to workaround a reference problem *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -{$IFDEF FF_API_GET_BUFFER} - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; ///< only access through AVOptions from outside libavcodec - FF_DEBUG_VIS_MB_TYPE = $00004000; ///< only access through AVOptions from outside libavcodec -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; - AV_EF_BUFFER = 4; - AV_EF_EXPLODE = 8; - - AV_EF_CAREFUL = 65536; - AV_EF_COMPLIANT = 131072; - AV_EF_AGGRESSIVE = 262144; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 1; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 2; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - - FF_LEVEL_UNKNOWN = -99; - -type - AVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE - ); - - TAVPacketSideDataType = record - data: PByte; - size: cint; - type_: AVPacketSideDataType; - end; - PAVPacketSideDataType = ^TAVPacketSideDataType; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf or destruct (deprecated) - * fields. If either is set, the packet data is dynamically allocated and is - * valid indefinitely until av_free_packet() is called (which in turn calls - * av_buffer_unref()/the destruct callback to free the data). If neither is set, - * the packet data is typically backed by some static buffer somewhere and is - * only valid for a limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideDataType; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; -{$IFDEF FF_API_DESTRUCT_PACKET} - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; -{$ENDIF} - - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; - codec_name: array [0..31] of AnsiChar; - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this is the number of "priming" samples added to the - * beginning of the stream. The decoded output will be delayed by this - * many samples relative to the input to the encoder. Note that this - * field is purely informational and does not directly affect the pts - * output by the encoder, which should always be based on the actual - * presentation time, including any delay. - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - -{$IFDEF FF_API_GET_BUFFER} - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated use get_buffer2() - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated custom freeing callbacks should be set from get_buffer2() - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; {deprecated;} - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} -{$ENDIF} - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise exended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - rc_buffer_aggressivity: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - -{$IFDEF FF_API_THREAD_OPAQUE} - (** - * @deprecated this field should not be used from outside of lavc - *) - thread_opaque: pointer; -{$ENDIF} - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_CODEC_PKT} - (** - * @deprecated this field is not supposed to be accessed from outside lavc - *) - pkt: PAVPacket; -{$ENDIF} - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: PAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * Code outside libavcodec should access this field using AVOptions - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVHWAccel; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the ff_MPV_decode_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - //void (*decode_mb)(struct MpegEncContext *s); - decode_mb: procedure(s: PMpegEncContext); cdecl; - end; {TAVHWAccel} - -const - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by calling avcodec_close() on it followed - * by av_free(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVFRAME_LAVC} -(** - * @deprecated use av_frame_alloc() - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; -{$ENDIF} - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - * - * @deprecated use av_frame_unref() - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - * - * @deprecated use av_frame_free() - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -{$IFDEF FF_API_DESTRUCT_PACKET} -(* - * Default packet destructor. - * @deprecated use the AVBuffer API instead - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: AVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_GET_BUFFER} -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; deprecated; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. - * The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. The - * caller may not write to it. - * - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_DEINTERLACE} -(** - * deinterlace - if not supported return -1 - * - * @deprecated - use yadif (in libavfilter) instead - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @{ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @{ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -const - FF_LOSS_RESOLUTION = $0001; (**< loss due to resolution change *) - FF_LOSS_DEPTH = $0002; (**< loss due to color depth change *) - FF_LOSS_COLORSPACE = $0004; (**< loss due to color space conversion *) - FF_LOSS_ALPHA = $0008; (**< loss of alpha bits *) - FF_LOSS_COLORQUANT = $0010; (**< loss due to color quantization *) - FF_LOSS_CHROMA = $0020; (**< loss of chroma (e.g. RGB to gray conversion) *) - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur - * (maximum loss for an invalid dst_pix_fmt). - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format and a selection of two destination pixel formats. When converting from - * one pixel format to another, information loss may occur. For example, when converting - * from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when - * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of - * the given pixel formats should be used to suffer the least amount of loss. - * - * If one of the destination formats is AV_PIX_FMT_NONE the other pixel format (if valid) will be - * returned. - * - * @code - * src_pix_fmt = AV_PIX_FMT_YUV420P; - * dst_pix_fmt1= AV_PIX_FMT_RGB24; - * dst_pix_fmt2= AV_PIX_FMT_GRAY8; - * dst_pix_fmt3= AV_PIX_FMT_RGB8; - * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); - * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from - * @param[in] dst_pix_fmt2 The other of the two destination pixel formats to choose from - * @param[in] src_pix_fmt Source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[in, out] loss_ptr Combination of loss flags. In: selects which of the losses to ignore, i.e. - * NULL or value of zero means we care about all losses. Out: the loss - * that occurs when converting from src to selected dst pixel format. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is availble in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output output buffer is not allocated - * and the output buffer should be considered identical to the input - * buffer, or in case *poutbuf was set it points to the input buffer - * (not necessarily to its starting address). - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-2.2/avformat.pas b/src/lib/ffmpeg-2.2/avformat.pas deleted file mode 100644 index e40ebea6..00000000 --- a/src/lib/ffmpeg-2.2/avformat.pas +++ /dev/null @@ -1,2765 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 55.12.100 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 1.1.x - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 55; - LIBAVFORMAT_MAX_VERSION_MINOR = 33; - LIBAVFORMAT_MAX_VERSION_RELEASE = 100; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 55; - LIBAVFORMAT_MIN_VERSION_MINOR = 33; - LIBAVFORMAT_MIN_VERSION_RELEASE = 100; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(*old defines not present anymore in ffmpeg-2.1 -{$ifndef FF_API_OLD_AVIO} -{$define FF_API_OLD_AVIO := (LIBAVFORMAT_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PKT_DUMP} -{$define FF_API_PKT_DUMP := (LIBAVFORMAT_VERSION_MAJOR < 54) -{$endif} -*) -{$ifndef FF_API_REFERENCE_DTS} -{$define FF_API_REFERENCE_DTS := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} -{$define FF_API_ALLOC_OUTPUT_CONTEXT := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} -{$define FF_API_FORMAT_PARAMETERS := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_NEW_STREAM} -{$define FF_API_NEW_STREAM := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_SET_PTS_INFO} -{$define FF_API_SET_PTS_INFO := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} -{$define FF_API_CLOSE_INPUT_FILE := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_READ_PACKET} -{$define FF_API_READ_PACKET := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ASS_SSA} -{$define FF_API_ASS_SSA := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @{ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @{ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @} - * - * @defgroup lavf_encoding Muxing - * @{ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codec "stream codec context" information, such as the - * codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVCodecContext.time_base "codec timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase the - * caller set on the codec context. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -//type - - - -(* - * @defgroup metadata_api Public Metadata API - * @{ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @} - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< maximum score - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - - MAX_STD_TIMEBASES = (60*12+6); - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - MAX_PROBE_PACKETS = 2500; - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - -(** - * @addtogroup lavf_encoding - * @{ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @{ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - priv_data: pointer; - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: set by libavformat in avformat_write_header. The muxer may use the - * user-provided value of @ref AVCodecContext.time_base "codec->time_base" - * as a hint. - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - -{$IFDEF FF_API_REFERENCE_DTS} - (* a hack to keep ABI compatibility for ffmpeg and other applications, which accesses parser even - * though it should not *) - do_not_use: cint64; -{$ENDIF} - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - flags: cint; - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input(). - *) - probesize: cuint; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * Muxing only, set by the caller before avformat_write_header(). - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * Avoid negative timestamps during muxing - * 0 -> allow negative timestamps - * 1 -> avoid negative timestamps - * -1 -> choose automatically (default) - * Note, this only works when interleave_packet_per_dts is in use - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - avoid_negative_ts: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cuint; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Packets split by the parser get queued here. - *) - parse_queue: PAVPacketList; - parse_queue_end: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - (** - * Offset to remap timestamps to be non-negative. - * Expressed in timebase units. - * @see AVStream.mux_ts_offset - *) - offset: cint64; - - (** - * Timebase for the timestamp offset. - *) - offset_timebase: TAVRational; - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_video_codec (NO direct access). - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). - *) - subtitle_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - * Mostly usable with control_message_cb or any future callbacks in device's context. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user via AVOptions (NO direct access) - *) - output_ts_offset: cint64; - - end; (** TAVFormatContext **) - - function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; - function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; - procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; - function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; - procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; - function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; - procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; - function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; - procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; - procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; - procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; - function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; - procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @{ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -{$IFDEF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -{$IFDEF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - * - * @deprecated use avformat_find_stream_info. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IFDEF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -{$IFDEF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IFEND} - -{$IFDEF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; -{$IFEND} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * If the muxer supports it, this function allows to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @{ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: PAVPacket; dump_payload: cint; st: PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: PAVPacket; dump_payload: cint; - st: PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; - -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: PAVOutputFormat; codec_id: TAVCodecID; std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @{ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.2/avio.pas b/src/lib/ffmpeg-2.2/avio.pas deleted file mode 100644 index 32ca278f..00000000 --- a/src/lib/ffmpeg-2.2/avio.pas +++ /dev/null @@ -1,598 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 55.12.100 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const -(** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data to the output s. - * - * Force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-2.2/avutil.pas b/src/lib/ffmpeg-2.2/avutil.pas deleted file mode 100644 index 959a11e4..00000000 --- a/src/lib/ffmpeg-2.2/avutil.pas +++ /dev/null @@ -1,417 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 52.66.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 52; - LIBAVUTIL_MAX_VERSION_MINOR = 66; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 52; - LIBAVUTIL_MIN_VERSION_MINOR = 66; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - - -(** - * @} - * - * @defgroup depr_guards Deprecation guards - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - * - * @{ - *) - -{$ifndef FF_API_GET_BITS_PER_SAMPLE_FMT} -{$define FF_API_GET_BITS_PER_SAMPLE_FMT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_FIND_OPT} -{$define FF_API_FIND_OPT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OLD_AVOPTIONS} -{$define FF_API_OLD_AVOPTIONS := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_PIX_FMT} -{$define FF_API_PIX_FMT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_CONTEXT_SIZE} -{$define FF_API_CONTEXT_SIZE := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_PIX_FMT_DESC} -{$define FF_API_PIX_FMT_DESC := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AV_REVERSE} -{$define FF_API_AV_REVERSE := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AUDIOCONVERT} -{$define FF_API_AUDIOCONVERT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_CPU_FLAG_MMX2} -{$define FF_API_CPU_FLAG_MMX2 := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO} -{$define FF_API_SAMPLES_UTILS_RETURN_ZERO := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_LLS_PRIVATE} -{$define FF_API_LLS_PRIVATE := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_LLS1} -{$define FF_API_LLS1 :=(LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AVFRAME_LAVC} -{$define FF_API_AVFRAME_LAVC := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT} -{$define FF_API_GET_CHANNEL_LAYOUT_COMPAT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OLD_OPENCL} -{$define FF_API_OLD_OPENCL := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_INTFLOAT -{$define FF_API_INTFLOAT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-2.2/ff_api-defines.inc b/src/lib/ffmpeg-2.2/ff_api-defines.inc deleted file mode 100644 index 72a7f4c6..00000000 --- a/src/lib/ffmpeg-2.2/ff_api-defines.inc +++ /dev/null @@ -1,204 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DEINTERLACE} -{$define FF_API_DEINTERLACE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DESTRUCT_PACKET} -{$define FF_API_DESTRUCT_PACKET := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_GET_BUFFER} -{$define FF_API_GET_BUFFER := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_THREAD_OPAQUE} -{$define FF_API_THREAD_OPAQUE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CODEC_PKT} -{$define FF_API_CODEC_PKT := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FAST_MALLOC} -{$define FF_API_FAST_MALLOC := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_GET_BITS_PER_SAMPLE_FMT} -{$define FF_API_GET_BITS_PER_SAMPLE_FMT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_FIND_OPT} -{$define FF_API_FIND_OPT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OLD_AVOPTIONS} -{$define FF_API_OLD_AVOPTIONS := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_PIX_FMT} -{$define FF_API_PIX_FMT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_CONTEXT_SIZE} -{$define FF_API_CONTEXT_SIZE := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_PIX_FMT_DESC} -{$define FF_API_PIX_FMT_DESC := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AV_REVERSE} -{$define FF_API_AV_REVERSE := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AUDIOCONVERT} -{$define FF_API_AUDIOCONVERT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_CPU_FLAG_MMX2} -{$define FF_API_CPU_FLAG_MMX2 := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO} -{$define FF_API_SAMPLES_UTILS_RETURN_ZERO := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_LLS_PRIVATE} -{$define FF_API_LLS_PRIVATE := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_LLS1} -{$define FF_API_LLS1 :=(LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AVFRAME_LAVC} -{$define FF_API_AVFRAME_LAVC := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT} -{$define FF_API_GET_CHANNEL_LAYOUT_COMPAT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OLD_OPENCL} -{$define FF_API_OLD_OPENCL := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_INTFLOAT -{$define FF_API_INTFLOAT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_REFERENCE_DTS} -{$define FF_API_REFERENCE_DTS := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} -{$define FF_API_ALLOC_OUTPUT_CONTEXT := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} -{$define FF_API_FORMAT_PARAMETERS := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_NEW_STREAM} -{$define FF_API_NEW_STREAM := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_SET_PTS_INFO} -{$define FF_API_SET_PTS_INFO := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} -{$define FF_API_CLOSE_INPUT_FILE := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_READ_PACKET} -{$define FF_API_READ_PACKET := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ASS_SSA} -{$define FF_API_ASS_SSA := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** swscale FF_API defines *) -{$ifndef FF_API_SWS_GETCONTEXT} -{$define FF_API_SWS_GETCONTEXT := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} - -{$ENDIF PASDOC} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.2/libavcodec/audioconvert.pas b/src/lib/ffmpeg-2.2/libavcodec/audioconvert.pas deleted file mode 100644 index 03e3fb10..00000000 --- a/src/lib/ffmpeg-2.2/libavcodec/audioconvert.pas +++ /dev/null @@ -1,291 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.2/libavutil/buffer.pas b/src/lib/ffmpeg-2.2/libavutil/buffer.pas deleted file mode 100644 index b855b9ab..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/buffer.pas +++ /dev/null @@ -1,283 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 52.66.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferRef; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - * @see av_buffer_pool_can_uninit() - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.2/libavutil/cpu.pas b/src/lib/ffmpeg-2.2/libavutil/cpu.pas deleted file mode 100644 index 631cc255..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/cpu.pas +++ /dev/null @@ -1,117 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 52.66.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.2/libavutil/dict.pas b/src/lib/ffmpeg-2.2/libavutil/dict.pas deleted file mode 100644 index 0d9ffabd..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/dict.pas +++ /dev/null @@ -1,130 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 52.66.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.2/libavutil/error.pas b/src/lib/ffmpeg-2.2/libavutil/error.pas deleted file mode 100644 index d5f76639..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/error.pas +++ /dev/null @@ -1,157 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-2.2/libavutil/frame.pas b/src/lib/ffmpeg-2.2/libavutil/frame.pas deleted file mode 100644 index 4a044ea3..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/frame.pas +++ /dev/null @@ -1,818 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 52.66.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @{ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO - ); - - PAVFrameSideData = ^TAVFrameSideData; - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. -*) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiplies of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - -{$IFDEF FF_API_AVFRAME_LAVC} - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; {deprecated} -{$ENDIF} - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - reference: cint; {deprecated} - - (** - * QP table - *) - qscale_table: pbyte; {deprecated} - - (** - * QP store stride - *) - qstride: cint; {deprecated} - qscale_type: cint; {deprecated} - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - *) - mbskip_table: pbyte; {deprecated} - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - *) - motion_val: array [0..1] of pointer; {deprecated} - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - *) - mb_type: PCuint; {deprecated} - - (** - * DCT coefficients - *) - dct_coeff: PsmallInt; {deprecated} - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - *) - ref_index: array [0..1] of pbyte; {deprecated} -{$ENDIF} - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - type_: cint; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - buffer_hints: cint; {deprecated} - (** - * Pan scan. - *) - pan_scan: PAVPanScan; {deprecated} -{$ENDIF} - - (** - * reordered opaque 64bit (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - (** - * @deprecated this field is unused - *) - hwaccel_picture_private: pointer; {deprecated} - owner: pointer; {deprecated} (** Note: Should be a PAVCodecContext, but a type pointer is used to avoid a reference problem. *) - thread_opaque: pointer; {deprecated} - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - *) - motion_subsample_log2: cuint8; {deprecated} -{$ENDIF} - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * Flags describing additional frame properties. - * - * @{ - *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - {$define AV_FRAME_FLAG_CORRUPT := (1 << 0)} - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Move everythnig contained in src to dst and reset src. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-2.2/libavutil/log.pas b/src/lib/ffmpeg-2.2/libavutil/log.pas deleted file mode 100644 index e47cfc19..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/log.pas +++ /dev/null @@ -1,437 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * log - *) - -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is inteded for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - value_min, value_max: cdouble; ///< For string ranges this represents the min/max length, for dimensions this represents the min/max pixel count - component_min, component_max: cdouble; ///< For string this represents the unicode range for chars, 0-127 limits to ASCII - is_range: cint; ///< if set to 1 the struct encodes a range, if set to 0 a single value - end; - - (** - * List of AVOptionRange structs - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - range: PPAVOptionRange; - nb_ranges: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) -const - AV_LOG_SKIP_REPEATED = 1; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.2/libavutil/mathematics.pas b/src/lib/ffmpeg-2.2/libavutil/mathematics.pas deleted file mode 100644 index 993cefad..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/mathematics.pas +++ /dev/null @@ -1,144 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 52.66.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timebase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timebase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function gurantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.2/libavutil/mem.pas b/src/lib/ffmpeg-2.2/libavutil/mem.pas deleted file mode 100644 index 65ffb25a..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/mem.pas +++ /dev/null @@ -1,325 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of size * nmemb bytes with av_malloc(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param size Size in bytes of the memory block to be allocated or - * reallocated. - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate a block of memory. - * If *ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param size Size in bytes for the memory block to be allocated or - * reallocated - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_reallocp(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array through a pointer to a pointer. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate a block of size * nmemb bytes with av_mallocz(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.2/libavutil/opt.pas b/src/lib/ffmpeg-2.2/libavutil/opt.pas deleted file mode 100644 index 655ccf22..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/opt.pas +++ /dev/null @@ -1,516 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 52.66.100 - * - *) - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that (opt->flags & mask) == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - * @deprecated use av_opt_set() - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -{$IFDEF FF_API_OLD_AVOPTIONS} -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all string and binary options in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_freep_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * - * The result must be freed with av_opt_free_ranges. - * - * @return >= 0 on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-2.2/libavutil/pixfmt.pas b/src/lib/ffmpeg-2.2/libavutil/pixfmt.pas deleted file mode 100644 index 6b100b14..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/pixfmt.pas +++ /dev/null @@ -1,456 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * Make sure that all newly added big-endian formats have (pix_fmt & 1) == 1 - * and that all newly added little-endian formats have (pix_fmt & 1) == 0. - * This allows simpler detection of big vs little-endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - {$define AV_PIX_FMT_XVMC := (AV_PIX_FMT_XVMC_MPEG2_IDCT)} -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - *) - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -const - AV_PIX_FMT_YUVA422P = AV_PIX_FMT_YUVA422P_LIBAV; - AV_PIX_FMT_YUVA444P = AV_PIX_FMT_YUVA444P_LIBAV; -{$ENDIF} - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_GRAY8A; - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - PixelFormat = TAVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} diff --git a/src/lib/ffmpeg-2.2/libavutil/samplefmt.pas b/src/lib/ffmpeg-2.2/libavutil/samplefmt.pas deleted file mode 100644 index 2a28ad7e..00000000 --- a/src/lib/ffmpeg-2.2/libavutil/samplefmt.pas +++ /dev/null @@ -1,275 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 52.66.100 - * - *) - -type -(** - * Audio Sample Formats - * - * @par - * The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * @par - * The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * @par - * The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.2/rational.pas b/src/lib/ffmpeg-2.2/rational.pas deleted file mode 100644 index d6f63749..00000000 --- a/src/lib/ffmpeg-2.2/rational.pas +++ /dev/null @@ -1,233 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 52.38.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-2.2/swresample.pas b/src/lib/ffmpeg-2.2/swresample.pas deleted file mode 100644 index 8f550df2..00000000 --- a/src/lib/ffmpeg-2.2/swresample.pas +++ /dev/null @@ -1,346 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 0.18.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 0; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 18; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 0; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 18; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s Swr context, can be NULL - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - {const} var in_: PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param s allocated Swr context, not yet initialized - * @param channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be - * if its set to 1 the returned delay is in seconds - * if its set to 1000 the returned delay is in milli seconds - * if its set to the input sample rate then the returned delay is in input samples - * if its set to the output sample rate then the returned delay is in output samples - * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate) - * @returns the delay in 1/base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the LIBSWRESAMPLE_VERSION_INT constant. - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - *) -function swresample_configuration(): cuchar; - cdecl; external sw__resample; - -(** - * Return the swr license. - *) -function swresample_license(): cuchar; - cdecl; external sw__resample; - -(** - * @ - *) - -implementation - -end. - diff --git a/src/lib/ffmpeg-2.2/swscale.pas b/src/lib/ffmpeg-2.2/swscale.pas deleted file mode 100644 index 4b9dff2f..00000000 --- a/src/lib/ffmpeg-2.2/swscale.pas +++ /dev/null @@ -1,491 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 2.3.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 2; - LIBSWSCALE_MAX_VERSION_MINOR = 5; - LIBSWSCALE_MAX_VERSION_RELEASE = 102; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} -{$define FF_API_SWS_GETCONTEXT := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IFDEF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -{$IFDEF FF_API_SWS_GETCONTEXT} -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - * @deprecated Use sws_getCachedContext() instead. - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; -{$IFEND} - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.4/How to update the ffmpeg files.txt b/src/lib/ffmpeg-2.4/How to update the ffmpeg files.txt deleted file mode 100644 index ae65d477..00000000 --- a/src/lib/ffmpeg-2.4/How to update the ffmpeg files.txt +++ /dev/null @@ -1,20 +0,0 @@ -how to update the ffmpeg files: - -1) buffer.pas - cpu.pas - dict.pas - error.pas - frame.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas - swresample.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-2.4/ToDo.txt b/src/lib/ffmpeg-2.4/ToDo.txt deleted file mode 100644 index 44a1a058..00000000 --- a/src/lib/ffmpeg-2.4/ToDo.txt +++ /dev/null @@ -1,11 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog diff --git a/src/lib/ffmpeg-2.4/avcodec.pas b/src/lib/ffmpeg-2.4/avcodec.pas deleted file mode 100644 index 73f50d91..00000000 --- a/src/lib/ffmpeg-2.4/avcodec.pas +++ /dev/null @@ -1,5897 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 56.1.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 56; - LIBAVCODEC_MAX_VERSION_MINOR = 1; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 56; - LIBAVCODEC_MIN_VERSION_MINOR = 1; - LIBAVCODEC_MIN_VERSION_RELEASE = 100; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130_DEPRECATED, - AV_CODEC_ID_G2M_DEPRECATED, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC_DEPRECATED, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX_DEPRECATED, - AV_CODEC_ID_PAF_VIDEO_DEPRECATED, - AV_CODEC_ID_EXR_DEPRECATED, - AV_CODEC_ID_VP7_DEPRECATED, - AV_CODEC_ID_SANM_DEPRECATED, - AV_CODEC_ID_SGIRLE_DEPRECATED, - AV_CODEC_ID_MVC1_DEPRECATED, - AV_CODEC_ID_MVC2_DEPRECATED, - -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'), - AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'), - AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'), - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_ADPCM_VIMA = MKBETAG('V','I','M','A'), - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '), - AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '), - AV_CODEC_ID_ADPCM_G726LE = MKBETAG('6','2','7','G'), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, - AV_CODEC_ID_PAF_AUDIO_DEPRECATED, - AV_CODEC_ID_ON2AVC, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'), - AV_CODEC_ID_DSD_LSBF = MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = MKBETAG('D','S','D','M'), - AV_CODEC_ID_DSD_LSBF_PLANAR = MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = MKBETAG('D','S','D','8'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'), - AV_CODEC_ID_TIMED_ID3 = MKBETAG('T','I','D','3'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), - AV_CODEC_ID_ADPCM_G726LE= $36323747, // MKBETAG('6','2','7','G'), - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_ASS = $41534B20, // MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_DVD_NAV = $444E4156, // MKBETAG('D','N','A','V'), - AV_CODEC_ID_DSD_LSBF_PLANAR = $44534431, // MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = $44534438, // MKBETAG('D','S','D','8'), - AV_CODEC_ID_DSD_LSBF = $4453444C, // MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = $4453444D, // MKBETAG('D','S','D','M'), - AV_CODEC_ID_ADPCM_DTK = $44544B20, // MKBETAG('D','T','K',' '), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_ADPCM_IMA_RAD = $52414420, // MKBETAG('R','A','D',' '), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SMVJPEG = $534D564A, // MKBETAG('S','M','V','J'), - AV_CODEC_ID_SNOW = $534E4F57, // MKBETAG('S','N','O','W'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_TIMED_ID3 = $54494433, // MKBETAG('T','I','D','3'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_ADPCM_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBP = $57454250, // MKBETAG('W','E','B','P'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D') - AV_CODEC_ID_EVRC = $73657663, // MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = $73736D76, // MKBETAG('s','s','m','v'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_get_descriptor() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - - (** - * MIME type(s) associated with the codec. - * May be NULL; if not, a NULL-terminated array of MIME types. - * The first item is always non-NULL and is the preferred MIME type. - *) - mime_types: PAnsiChar; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Codec supports frame reordering. That is, the coded order (the order in which - * the encoded packets are output by the encoders / stored / input to the - * decoders) may be different from the presentation order of the corresponding - * frames. - * - * For codecs that do not have this property set, PTS and DTS should always be - * equal. - *) - AV_CODEC_PROP_REORDER = 1 << 3; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONINTRA= 24, ///< discard all non intra frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{ removed, kept for the moment - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -} - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = $0001; - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_OUTPUT_CORRUPT = $0008; ///< Output even those frames that might be corrupted - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. -{$IFDEF FF_API_GMC} -(** - * @deprecated use the "gmc" private option of the libxvid encoder - *) - CODEC_FLAG_GMC = $0020; ///< use GMC. -{$IFEND} -{$IFDEF FF_API_MV0} -(** - * @deprecated use the flag "mv0" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. -{$IFEND} -{$IFDEF FF_API_INPUT_PRESERVED} -(** - * @deprecated passing reference-counted frames to the encoders replaces this - * flag - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; -{$IFEND} - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ -{$IFDEF FF_API_NORMALIZE_AQP} -(** - * @deprecated use the flag "naq" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization -{$IFEND} - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! - CODEC_FLAG2_IGNORE_CROP = $00010000; ///< Discard cropping information from SPS. - - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - CODEC_FLAG2_EXPORT_MVS = $10000000; ///< Export motion vectors through frame side data - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note: AVPanScan is now (28/09/2014) defined in libavutil/frame.pas to workaround a reference problem *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -{$IFDEF FF_API_GET_BUFFER} - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - -{$IFDEF FF_API_AFD} - {attribute_deprecated} - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; -{$IFEND} - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_CODER_TYPE_DEFLATE = 4; -{$ENDIF} - - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - FF_EC_FAVOR_INTER = 256; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DEBUG_PTS = $00000200; -{$ENDIF} - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; ///< only access through AVOptions from outside libavcodec - FF_DEBUG_VIS_MB_TYPE = $00004000; ///< only access through AVOptions from outside libavcodec -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - FF_DEBUG_NOMC = $01000000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; ///< detect bitstream specification deviations - AV_EF_BUFFER = 4; ///< detect improper bitstream length - AV_EF_EXPLODE = 8; ///< abort decoding on minor error detection - - AV_EF_IGNORE_ERR = 32768; ///< ignore errors and continue - AV_EF_CAREFUL = 65536; ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors - AV_EF_COMPLIANT = 131072; ///< consider all spec non compliances as errors - AV_EF_AGGRESSIVE = 262144; ///< consider things that a sane encoder should not do as an error - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DCT_INT = 2; -{$ENDIF} - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; -{$IFDEF FF_API_ARCH_SH4} - FF_IDCT_SH4 = 9; -{$ENDIF} - FF_IDCT_SIMPLEARM = 10; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_IDCT_IPP = 13; -{$ENDIF} - FF_IDCT_XVID = 14; -{$IFDEF FF_API_IDCT_XVIDMMX} - FF_IDCT_XVIDMMX = 14; -{$ENDIF} - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; -{$IFDEF FF_API_ARCH_SPARC} - FF_IDCT_SIMPLEVIS = 18; -{$ENDIF} - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - FF_IDCT_SIMPLEAUTO = 128; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 1; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 2; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - FF_PROFILE_HEVC_REXT = 4; - - FF_LEVEL_UNKNOWN = -99; - -type - TAVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * This side data should be associated with an audio stream and contains - * ReplayGain information in form of the AVReplayGain struct. - *9 - AV_PKT_DATA_REPLAYGAIN, - - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the decoded video frames for - * correct presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_PKT_DATA_DISPLAYMATRIX, - - (** - * This side data should be associated with a video stream and contains - * Stereoscopic 3D information in form of the AVStereo3D struct. - *) - AV_PKT_DATA_STEREO3D, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE - ); - - PAVPacketSideData = ^TAVPacketSideData; - TAVPacketSideData = record - data: PByte; - size: cint; - type_: TAVPacketSideDataType; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf or destruct (deprecated) - * fields. If either is set, the packet data is dynamically allocated and is - * valid indefinitely until av_free_packet() is called (which in turn calls - * av_buffer_unref()/the destruct callback to free the data). If neither is set, - * the packet data is typically backed by some static buffer somewhere and is - * only valid for a limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideData; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; -{$IFDEF FF_API_DESTRUCT_PACKET} - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; -{$ENDIF} - - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; -{$IFDEF FF_API_CODEC_NAME} - (** - * @deprecated this field is not used for anything in libavcodec - *) - {attribute_deprecated} - codec_name: array [0..31] of AnsiChar; -{$IFEND} - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this is the number of "priming" samples added by the - * encoder to the beginning of the stream. The decoded output will be - * delayed by this many samples relative to the input to the encoder (or - * more, if the decoder adds its own padding). - * The timestamps on the output packets are adjusted by the encoder so - * that they always refer to the first sample of the data actually - * contained in the packet, including any added padding. - * E.g. if the timebase is 1/samplerate and the timestamp of the first - * input sample is 0, the timestamp of the first output packet will be - * -delay. - * - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - -{$IFDEF FF_API_AFD} - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - * @deprecated Deprecated in favor of AVSideData - *) - {attribute_deprecated} - dtg_active_format: cint; -{$IFEND} - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - -{$IFDEF FF_API_UNUSED_MEMBERS} - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; {attribute_deprecated} -{$IFEND} - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - -{$IFDEF FF_API_GET_BUFFER} - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated use get_buffer2() - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated custom freeing callbacks should be set from get_buffer2() - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; {deprecated;} - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} -{$ENDIF} - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise exended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continuous function to limit qscale within qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PAnsiChar; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - rc_buffer_aggressivity: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - (** - * minimum Lagrange multiplier - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multiplier - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - -{$IFDEF FF_API_THREAD_OPAQUE} - (** - * @deprecated this field should not be used from outside of lavc - *) - thread_opaque: pointer; -{$ENDIF} - - (** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_CODEC_PKT} - (** - * @deprecated this field is not supposed to be accessed from outside lavc - *) - pkt: PAVPacket; -{$ENDIF} - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Encoding only. Allow encoders to output packets that do not contain any - * encoded data, only side data. - * - * Some encoders need to output such packets, e.g. to update some stream - * parameters at the end of encoding. - * - * All callers are strongly recommended to set this option to 1 and update - * their code to deal with such packets, since this behaviour may become - * always enabled in the future (then this option will be deprecated and - * later removed). To avoid ABI issues when this happens, the callers should - * use AVOptions to set this field. - *) - side_data_only_packets: cint; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: PAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * Code outside libavcodec should access this field using AVOptions - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVHWAccel; - - (** - * Allocate a custom buffer - *) - alloc_frame: function (avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - frame_priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the ff_mpv_decode_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - decode_mb: procedure(s: PMpegEncContext); cdecl; - - (** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - *) - init: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - *) - uninit: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - *) - priv_data_size: cint; - end; {TAVHWAccel} - -const - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct should be freed with avcodec_free_context(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Free the codec context and everything associated with it and write NULL to - * the provided pointer. - *) -procedure avcodec_free_context(var avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVFRAME_LAVC} -(** - * @deprecated use av_frame_alloc() - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; -{$ENDIF} - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - * - * @deprecated use av_frame_unref() - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - * - * @deprecated use av_frame_free() - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -{$IFDEF FF_API_DESTRUCT_PACKET} -(* - * Default packet destructor. - * @deprecated use the AVBuffer API instead - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Convert valid timing fields (timestamps / durations) in a packet from one - * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be - * ignored. - * - * @param pkt packet on which the conversion will be performed - * @param tb_src source timebase, in which the timing fields in pkt are - * expressed - * @param tb_dst destination timebase, to which the timing fields will be - * converted - *) -procedure av_packet_rescale_ts(pkt: PAVPacket; tb_src, tb_dst: TAVRational); - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_GET_BUFFER} -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; deprecated; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio4 has to be called again with an AVPacket containing - * the remaining data in order to decode the second frame, etc... - * Even if no frames are returned, the packet needs to be fed to the decoder - * with remaining data until it is completely consumed or an error occurs. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note You might have to align the input buffer. The alignment requirements - * depend on the CPU and the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. - * The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. The - * caller may not write to it. - * - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, - * must be freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: {const} PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_DEINTERLACE} -(** - * deinterlace - if not supported return -1 - * - * @deprecated - use yadif (in libavfilter) instead - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * @deprecated see av_get_pix_fmt_loss() - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @deprecated see av_find_best_pix_fmt_of_2() - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is available in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output output buffer is not allocated - * and the output buffer should be considered identical to the input - * buffer, or in case *poutbuf was set it points to the input buffer - * (not necessarily to its starting address). - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: {const} PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: {const} PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-2.4/avformat.pas b/src/lib/ffmpeg-2.4/avformat.pas deleted file mode 100644 index 06e04945..00000000 --- a/src/lib/ffmpeg-2.4/avformat.pas +++ /dev/null @@ -1,2911 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 56.4.101 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 2.4.* - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 56; - LIBAVFORMAT_MAX_VERSION_MINOR = 4; - LIBAVFORMAT_MAX_VERSION_RELEASE = 101; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 56; - LIBAVFORMAT_MIN_VERSION_MINOR = 4; - LIBAVFORMAT_MIN_VERSION_RELEASE = 100; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @ - * - * @defgroup lavf_encoding Muxing - * @ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codec "stream codec context" information, such as the - * codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVStream.time_base "stream timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase - * requested by the caller. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -//type - -(* - * @defgroup metadata_api Public Metadata API - * @ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @ - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_LAVF_FRAC} -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; -{$ENDIF} - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - mime_type: Pcuint; (**< mime_type, when known. *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MIME = 75; ///< score for file mime type - AVPROBE_SCORE_MAX = 100; ///< maximum score - - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_FLUSH_PACKETS = $0200; ///< Flush the AVIOContext every packet. -(** - * When muxing, try to avoid writing any random/volatile data to the output. - * This includes any random IDs, real-time timestamps/dates, muxer version, etc. - * - * This flag is mainly intended for testing. - *) - AVFMT_FLAG_BITEXACT = $0400; - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - - // used by AVStream - AVSTREAM_EVENT_FLAG_METADATA_UPDATED = $0001; ///< The call resulted in updated metadata. - MAX_STD_TIMEBASES = (60*12+6); - MAX_PROBE_PACKETS = 2500; - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - AVFMT_EVENT_FLAG_METADATA_UPDATED = 0001; ///< The call resulted in updated metadata. - - RAW_PACKET_BUFFER_SIZE = 2500000; - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - - PAVDeviceCapabilitiesQuery = ^TAVDeviceCapabilitiesQuery; - TAVDeviceCapabilitiesQuery = record - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (** - * Comma-separated list of mime types. - * It is used check for matching mime types while probing. - * @see av_probe_input_format2 - *) - mime_type: {const} PAnsiChar; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - priv_data: pointer; - -{$IFDEF FF_API_LAVF_FRAC} - (** - * @deprecated this field is unused - *) - pts: TAVFrac; {attribute_deprecated} -{$ENDIF} - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the desired timebase. In - * avformat_write_header(), the muxer will overwrite this field - * with the timebase that will actually be used for the timestamps - * written into the file (which may or may not be related to the - * user-provided one, depending on the format). - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - * - * - demuxing: May be set by libavformat when creating the stream or in - * avformat_find_stream_info(). - * - muxing: May be set by the caller before avformat_write_header(). - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (** - * An array of side data that applies to the whole stream (i.e. the - * container does not allow it to change between packets). - * - * There may be no overlap between the side data in this array and side data - * in the packets. I.e. a given side data is either exported by the muxer - * (demuxing) / set by the caller (muxing) in this array, then it never - * appears in the packets, or the side data is exported / sent through - * the packets (always in the first packet where the value becomes known or - * changes), then it does not appear in this array. - * - * - demuxing: Set by libavformat when the stream is created. - * - muxing: May be set by the caller before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - * - * @see av_format_inject_global_side_data() - *) - side_data: PAVPacketSideData; - - (** - * The number of elements in the AVStream.side_data array. - *) - nb_side_data: cint; - - (** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. - *) - event_flags: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - (** - * Internal data to inject global side data - *) - inject_global_side_data: cint; - - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - (** - * Flags signalling stream properties. A combination of AVFMTCTX_*. - * Set by libavformat. - *) - ctx_flags: cint; - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - (** - * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. - * Set by the user before avformat_open_input() / avformat_write_header(). - *) - flags: cint; - - (** - * @deprecated deprecated in favor of probesize2 - *) - probesize: cuint; - - (** - * @deprecated deprecated in favor of max_analyze_duration2 - *) - max_analyze_duration: cint; {attribute_deprecated} - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * - muxing: Set by the caller before avformat_write_header(). If set to - * either 0 or AV_NOPTS_VALUE, then the current wall-time will - * be used. - * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that - * the value may become known after some number of frames - * have been received. - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Allow non-standard and experimental extension - * @see AVCodecContext.strict_std_compliance - *) - strict_std_compliance: cint; - - (** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. - *) - event_flags: cint; - - (** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - *) - max_ts_probe: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * Avoid negative timestamps during muxing - * 0 -> allow negative timestamps - * 1 -> avoid negative timestamps - * -1 -> choose automatically (default) - * Note, this only works when interleave_packet_per_dts is in use - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - avoid_negative_ts: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cint64; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (** - * format probing score. - * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes - * the format. - * - encoding: unused - * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) - *) - probe_score: cint; - - (** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - format_probesize: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Packets split by the parser get queued here. - *) - parse_queue: PAVPacketList; - parse_queue_end: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - (** - * Offset to remap timestamps to be non-negative. - * Expressed in timebase units. - * @see AVStream.mux_ts_offset - *) - offset: cint64; - - (** - * Timebase for the timestamp offset. - *) - offset_timebase: TAVRational; - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_video_codec (NO direct access). - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). - *) - subtitle_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - * Mostly usable with control_message_cb or any future callbacks in device's context. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user via AVOptions (NO direct access) - *) - output_ts_offset: cint64; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info() - * via AVOptions (NO direct access). - * Can be set to 0 to let avformat choose using a heuristic. - *) - max_analyze_duration2: cint64; - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input() - * via AVOptions (NO direct access). - *) - probesize2: cint64; - - end; (** TAVFormatContext **) - -function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; -procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; -procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; -function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; -procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; - -(** - * This function will cause global side data to be injected in the next packet - * of each stream as well as after any subsequent seek. - *) -procedure av_format_inject_global_side_data(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; -function av_stream_get_parser(s: {const} PAVStream): PAVCodecParserContext; - cdecl; external av__format; - -(** - * Returns the pts of the last muxed packet + its duration - * - * the retuned value is undefined when used with a demuxer. - *) -function av_stream_get_end_pts(st: {const} PAVStream): cint64; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: {const} PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: {const} PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -(** - * Get side information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_stream_get_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -{$IFDEF FF_API_ALLOC_OUTPUT_CONTEXT} -(** - * @deprecated deprecated in favor of avformat_alloc_output_context2() - *) -function avformat_alloc_output_context({const} format: PAnsiChar; - oformat: PAVOutputFormat; - {const} filename: PAnsiChar): PAVFormatContext; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -{$IFDEF FF_API_FORMAT_PARAMETERS} -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - * - * @deprecated use avformat_find_stream_info. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IFDEF FF_API_CLOSE_INPUT_FILE} -(** - * @deprecated use avformat_close_input() - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -{$IFDEF FF_API_NEW_STREAM} -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IFEND} - -{$IFDEF FF_API_SET_PTS_INFO} -(** - * @deprecated this function is not supposed to be called outside of lavf - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; - pts_num: cuint; pts_den: cuint); - cdecl; external av__format; -{$IFEND} - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * If the muxer supports it, this function allows to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: {const} PAVPacket; dump_payload: cint; st: {const} PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: {const} PAVPacket; dump_payload: cint; - st: {const} PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - url: {const} PAnsiChar); - cdecl; external av__format; - -(** - * Print detailed information about the input or output format, such as - * duration, bitrate, streams, container, programs, metadata, side data, - * codec and time base. - * - * @param ic the context to analyze - * @param index index of the stream to dump information about - * @param url the URL to print, such as source or destination file - * @param is_output Select whether the specified context is an input(0) or output(1) - *) -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: {const} PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: {const} PAVOutputFormat; codec_id: TAVCodecID; - std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.4/avio.pas b/src/lib/ffmpeg-2.4/avio.pas deleted file mode 100644 index 9be5f987..00000000 --- a/src/lib/ffmpeg-2.4/avio.pas +++ /dev/null @@ -1,627 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 56.4.101 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - - (** - * Original buffer size - * used internally after probing and ensure seekback to reset the buffer size - * This field is internal to libavformat and access from outside is not allowed. - *) - orig_buffer_size: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const -(** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function avio_feof(s: PAVIOContext): cint; - cdecl; external av__format; -{$IFDEF FF_API_URL_FEOF} -(** - * @deprecated use avio_feof() - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; {attribute_deprecated} -{$ENDIF} - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data to the output s. - * - * Force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -(* Avoid a warning. The header can not be included because it breaks c++. *) -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; - -(** - * Read contents of h into print buffer, up to max_size bytes, or up to EOF. - * - * @return 0 for success (max_size bytes read or EOF reached), negative error - * code otherwise - *) -function avio_read_to_bprint(h: PAVIOContext; pb: PAVBPrint; max_size: size_t): cint; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-2.4/avutil.pas b/src/lib/ffmpeg-2.4/avutil.pas deleted file mode 100644 index 1987d02a..00000000 --- a/src/lib/ffmpeg-2.4/avutil.pas +++ /dev/null @@ -1,353 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 54.7.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 54; - LIBAVUTIL_MAX_VERSION_MINOR = 7; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 54; - LIBAVUTIL_MIN_VERSION_MINOR = 7; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -(** - * Return the fractional representation of the internal time base. - *) -function av_get_time_base_q: TAVRational; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-2.4/ff_api-defines.inc b/src/lib/ffmpeg-2.4/ff_api-defines.inc deleted file mode 100644 index 47e2bdd6..00000000 --- a/src/lib/ffmpeg-2.4/ff_api-defines.inc +++ /dev/null @@ -1,250 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEINTERLACE} -{$define FF_API_DEINTERLACE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DESTRUCT_PACKET} -{$define FF_API_DESTRUCT_PACKET := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GET_BUFFER} -{$define FF_API_GET_BUFFER := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_THREAD_OPAQUE} -{$define FF_API_THREAD_OPAQUE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_PKT} -{$define FF_API_CODEC_PKT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_FAST_MALLOC} -{$define FF_API_FAST_MALLOC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DSPUTIL} -{$define FF_API_DSPUTIL := (LIBAVCODEC_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ARCH_SH4} -{$define FF_API_ARCH_SH4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_SPARC} -{$define FF_API_ARCH_SPARC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_UNUSED_MEMBERS} -{$define FF_API_UNUSED_MEMBERS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_IDCT_XVIDMMX} -{$define FF_API_IDCT_XVIDMMX := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_INPUT_PRESERVED} -{$define FF_API_INPUT_PRESERVED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NORMALIZE_AQP} -{$define FF_API_NORMALIZE_AQP := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GMC} -{$define FF_API_GMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MV0} -{$define FF_API_MV0 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_NAME} -{$define FF_API_CODEC_NAME := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AFD} -{$define FF_API_AFD := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VISMV} -(* XXX: don't forget to drop the -vismv documentation *) -{$define FF_API_VISMV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_GET_BITS_PER_SAMPLE_FMT} -{$define FF_API_GET_BITS_PER_SAMPLE_FMT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_FIND_OPT} -{$define FF_API_FIND_OPT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OLD_AVOPTIONS} -{$define FF_API_OLD_AVOPTIONS := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT} -{$define FF_API_PIX_FMT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CONTEXT_SIZE} -{$define FF_API_CONTEXT_SIZE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT_DESC} -{$define FF_API_PIX_FMT_DESC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AV_REVERSE} -{$define FF_API_AV_REVERSE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AUDIOCONVERT} -{$define FF_API_AUDIOCONVERT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CPU_FLAG_MMX2} -{$define FF_API_CPU_FLAG_MMX2 := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO} -{$define FF_API_SAMPLES_UTILS_RETURN_ZERO := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_LLS_PRIVATE} -{$define FF_API_LLS_PRIVATE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_LLS1} -{$define FF_API_LLS1 :=(LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AVFRAME_LAVC} -{$define FF_API_AVFRAME_LAVC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT} -{$define FF_API_GET_CHANNEL_LAYOUT_COMPAT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_OPENCL} -{$define FF_API_OLD_OPENCL := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_INTFLOAT -{$define FF_API_INTFLOAT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_LAVF_BITEXACT} -{$define FF_API_LAVF_BITEXACT := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_FRAC} -{$define FF_API_LAVF_FRAC := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_CODEC_TB} -{$define FF_API_LAVF_CODEC_TB := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_URL_FEOF} -{$define FF_API_URL_FEOF := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} -{$define FF_API_ALLOC_OUTPUT_CONTEXT := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} -{$define FF_API_FORMAT_PARAMETERS := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_NEW_STREAM} -{$define FF_API_NEW_STREAM := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_SET_PTS_INFO} -{$define FF_API_SET_PTS_INFO := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} -{$define FF_API_CLOSE_INPUT_FILE := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_READ_PACKET} -{$define FF_API_READ_PACKET := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ASS_SSA} -{$define FF_API_ASS_SSA := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** swscale FF_API defines *) -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_ARCH_BFIN} -{$define FF_API_ARCH_BFIN := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} - -{$ENDIF PASDOC} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.4/libavcodec/audioconvert.pas b/src/lib/ffmpeg-2.4/libavcodec/audioconvert.pas deleted file mode 100644 index 03e3fb10..00000000 --- a/src/lib/ffmpeg-2.4/libavcodec/audioconvert.pas +++ /dev/null @@ -1,291 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.4/libavutil/buffer.pas b/src/lib/ffmpeg-2.4/libavutil/buffer.pas deleted file mode 100644 index c1502f51..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/buffer.pas +++ /dev/null @@ -1,290 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 54.7.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Same as av_buffer_alloc(), except the returned buffer will be initialized - * to zero. - *) -function av_buffer_allocz(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferRef; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - * @see av_buffer_pool_can_uninit() - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.4/libavutil/cpu.pas b/src/lib/ffmpeg-2.4/libavutil/cpu.pas deleted file mode 100644 index 5d2e02da..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/cpu.pas +++ /dev/null @@ -1,119 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 54.7.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - AV_CPU_FLAG_ARMV8 = (1 << 6); - AV_CPU_FLAG_SETEND = (1 <<16); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.4/libavutil/dict.pas b/src/lib/ffmpeg-2.4/libavutil/dict.pas deleted file mode 100644 index ec3c2521..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/dict.pas +++ /dev/null @@ -1,143 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 54.7.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, - * these arguments will be freed on error. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Convenience wrapper for av_dict_set that converts the value to a string - * and stores it. - * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. - *) -function av_dict_set_int(var pm: PAVDictionary; {const} key: PAnsiChar; - value: cint64; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.4/libavutil/error.pas b/src/lib/ffmpeg-2.4/libavutil/error.pas deleted file mode 100644 index 219f4dfd..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/error.pas +++ /dev/null @@ -1,159 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) - AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-2.4/libavutil/frame.pas b/src/lib/ffmpeg-2.4/libavutil/frame.pas deleted file mode 100644 index 6edcad5d..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/frame.pas +++ /dev/null @@ -1,822 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 54.7.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - (** from the definitions of TAVFrame *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - AV_FRAME_FLAG_CORRUPT = (1 << 0); - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type -(* is already in pixfmt.pas - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); -*) - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO, - (** - * ReplayGain information in the form of the AVReplayGain struct. - *) - AV_FRAME_DATA_REPLAYGAIN, - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the frame for correct - * presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_FRAME_DATA_DISPLAYMATRIX, - (** - * Active Format Description data consisting of a single byte as specified - * in ETSI TS 101 154 using AVActiveFormatDescription enum. - *) - AV_FRAME_DATA_AFD, - (** - * Motion vectors exported by some codecs (on demand through the export_mvs - * flag set in the libavcodec AVCodecContext flags2 option). - * The data is the AVMotionVector struct defined in - * libavutil/motion_vector.h. - *) - AV_FRAME_DATA_MOTION_VECTORS - ); - - TAVActiveFormatDescription = ( - AV_AFD_SAME = 8, - AV_AFD_4_3 = 9, - AV_AFD_16_9 = 10, - AV_AFD_14_9 = 11, - AV_AFD_4_3_SP_14_9 = 13, - AV_AFD_16_9_SP_14_9 = 14, - AV_AFD_SP_4_3 = 15 - ); {TAVActiveFormatDescription} - - PAVFrameSideData = ^TAVFrameSideData; - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. -*) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used in order to access all channels. - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - *) - key_frame: cint; - - (** - * Picture type of the frame - *) - pict_type: TAVPictureType; - -{$IFDEF FF_API_AVFRAME_LAVC} - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; {deprecated} -{$ENDIF} - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - *) - pkt_pts: cint64; - - (** - * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) - * This is also the Presentation time of this AVFrame calculated from - * only AVPacket.dts values without pts values. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - *) - coded_picture_number: cint; - - (** - * picture number in display order - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - *) - quality: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - reference: cint; {deprecated} - - (** - * QP table - *) - qscale_table: pbyte; {deprecated} - - (** - * QP store stride - *) - qstride: cint; {deprecated} - qscale_type: cint; {deprecated} - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - *) - mbskip_table: pbyte; {deprecated} - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - *) - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - *) - mb_type: PCuint; {deprecated} - - (** - * DCT coefficients - *) - dct_coeff: PsmallInt; {deprecated} - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - *) - ref_index: array [0..1] of pbyte; {deprecated} -{$ENDIF} - - (** - * for some private data of the user - *) - opaque: pointer; - - (** - * error - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - type_: cint; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - *) - palette_has_changed: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - buffer_hints: cint; {deprecated} - (** - * Pan scan. - *) - pan_scan: PAVPanScan; {deprecated} -{$ENDIF} - - (** - * reordered opaque 64bit (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - *) - reordered_opaque: cint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - (** - * @deprecated this field is unused - *) - hwaccel_picture_private: pointer; {deprecated} - owner: pointer; {deprecated} (** Note: Should be a PAVCodecContext, but a type pointer is used to avoid a reference problem. *) - thread_opaque: pointer; {deprecated} - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - *) - motion_subsample_log2: cuint8; {deprecated} -{$ENDIF} - - (** - * Sample rate of the audio data. - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * Flags describing additional frame properties. - * - * @ - *) - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - color_primaries: TAVColorPrimaries; - - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - chroma_location: TAVChromaLocation; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Move everythnig contained in src to dst and reset src. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - -(** - * If side data of the supplied type exists in the frame, free it and remove it - * from the frame. - *) -procedure av_frame_remove_side_data(frame: PAVFrame; type_: TAVFrameSideDataType); - cdecl; external av__codec; - -(** - * @return a string identifying the side data type - *) -function av_frame_side_data_name(type_: TAVFrameSideDataType): PAnsiChar; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-2.4/libavutil/log.pas b/src/lib/ffmpeg-2.4/libavutil/log.pas deleted file mode 100644 index d0854c31..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/log.pas +++ /dev/null @@ -1,530 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * log - *) - -type - (* from opt.h *) - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_DICT, - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is inteded for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, - AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, - AV_CLASS_CATEGORY_DEVICE_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_INPUT, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(* -#define AV_IS_INPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) - -#define AV_IS_OUTPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -*) - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - (** - * Value range. - * For string ranges this represents the min/max length. - * For dimensions this represents the min/max pixel count or width/height in multi-component case. - *) - value_min, value_max: cdouble; - (** - * Value's component range. - * For string this represents the unicode range for chars, 0-127 limits to ASCII. - *) - component_min, component_max: cdouble; - (** - * Range flag. - * If set to 1 the struct encodes a range, if set to 0 a single value. - *) - is_range: cint; - end; - - (** - * List of AVOptionRange structs. - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - (** - * Array of option ranges. - * - * Most of option types use just one component. - * Following describes multi-component option types: - * - * AV_OPT_TYPE_IMAGE_SIZE: - * component index 0: range of pixel count (width * height). - * component index 1: range of width. - * component index 2: range of height. - * - * @note To obtain multi-component version of this structure, user must - * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or - * av_opt_query_ranges_default function. - * - * Multi-component range can be read as in following example: - * - * @code - * int range_index, component_index; - * AVOptionRanges *ranges; - * AVOptionRange *range[3]; //may require more than 3 in the future. - * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); - * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { - * for (component_index = 0; component_index < ranges->nb_components; component_index++) - * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; - * //do something with range here. - * } - * av_opt_freep_ranges(&ranges); - * @endcode - *) - range: PPAVOptionRange; - (** - * Number of ranges per component. - *) - nb_ranges: cint; - (** - * Number of componentes. - *) - nb_components: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Sets additional colors for extended debugging sessions. - * @code - av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); - @endcode - * Requires 256color terminal support. Uses outside debugging is not - * recommended. - *) -{** to be translated if needed - AV_LOG_C(x) (x << 8) -**} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -const -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) - AV_LOG_SKIP_REPEATED = 1; - -(** - * Include the log severity in messages originating from codecs. - * - * Results in messages such as: - * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts - *) - AV_LOG_PRINT_LEVEL = 2; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; - -function av_log_get_flags: cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.4/libavutil/mathematics.pas b/src/lib/ffmpeg-2.4/libavutil/mathematics.pas deleted file mode 100644 index 1025bbf3..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/mathematics.pas +++ /dev/null @@ -1,144 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 54.7.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a, b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a, b, modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timebase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timebase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function guarantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.4/libavutil/mem.pas b/src/lib/ffmpeg-2.4/libavutil/mem.pas deleted file mode 100644 index 43a38e4d..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/mem.pas +++ /dev/null @@ -1,353 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of size * nmemb bytes with av_malloc(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param size Size in bytes of the memory block to be allocated or - * reallocated. - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate a block of memory. - * If *ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param size Size in bytes for the memory block to be allocated or - * reallocated - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_reallocp(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array through a pointer to a pointer. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate a block of size * nmemb bytes with av_mallocz(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a substring of the string s. - * @param s string to be duplicated - * @param len the maximum length of the resulting string (not counting the - * terminating byte). - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strndup({const} s: PAnsiChar; len: size_t): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @note passing a pointer to a NULL pointer is safe and leads to no action. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray_add_nofree(), av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * Function has the same functionality as av_dynarray_add(), - * but it doesn't free memory on fails. It returns error code - * instead and leave current buffer untouched. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @return >=0 on success, negative otherwise. - * @see av_dynarray_add(), av_dynarray2_add() - *) -function av_dynarray_add_nofree(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer): cint; - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add(), av_dynarray_add_nofree() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.4/libavutil/opt.pas b/src/lib/ffmpeg-2.4/libavutil/opt.pas deleted file mode 100644 index b88674a3..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/opt.pas +++ /dev/null @@ -1,559 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 54.7.100 - * - *) - -{$IFDEF FF_API_FIND_OPT} -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that (opt->flags & mask) == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - * @deprecated use av_opt_set() - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -{$IFDEF FF_API_OLD_AVOPTIONS} -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all allocated objects in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict2(obj: pointer; var options: PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than - * one component for certain option types. - * @see AVOptionRanges for details. - *) - AV_OPT_MULTI_COMPONENT_RANGE = 1000; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * @note Any old dictionary present is discarded and replaced with a copy of the new one. The - * caller still owns val is and responsible for freeing it. - *) -function av_opt_set_dict_val(obj: pointer; name: {const} PAnsiChar; val: {const} PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @param[out] out_val The returned dictionary is a copy of the actual value and must - * be freed with av_dict_free() by the caller - *) -function av_opt_get_dict_val (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: PAVDictionary): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -function av_opt_copy(dest: pointer;src: pointer): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-2.4/libavutil/pixfmt.pas b/src/lib/ffmpeg-2.4/libavutil/pixfmt.pas deleted file mode 100644 index 264653a9..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/pixfmt.pas +++ /dev/null @@ -1,575 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * Make sure that all newly added big-endian formats have (pix_fmt & 1) == 1 - * and that all newly added little-endian formats have (pix_fmt & 1) == 0. - * This allows simpler detection of big vs little-endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - {$define AV_PIX_FMT_XVMC := (AV_PIX_FMT_XVMC_MPEG2_IDCT)} -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_YA8, ///< 8bit gray, 8bit alpha -(* see const declaration way down - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -*) - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - *) - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since Sat Sep 24 06:01:45 2011 +0200 (commits 9569a3c9f41387a8c7d1ce97d8693520477a66c3) - * also see Fri Nov 25 01:38:21 2011 +0100 92afb431621c79155fcb7171d26f137eb1bee028 - * Libav added them Sun Mar 16 23:05:47 2014 +0100 with incompatible values (commit 1481d24c3a0abf81e1d7a514547bd5305232be30) - *) - AV_PIX_FMT_RGBA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - - AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb - - AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef - - AV_PIX_FMT_YA16BE, ///< 16bit gray, 16bit alpha (big-endian) - AV_PIX_FMT_YA16LE, ///< 16bit gray, 16bit alpha (little-endian) - - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -const - AV_PIX_FMT_YUVA422P = AV_PIX_FMT_YUVA422P_LIBAV; - AV_PIX_FMT_YUVA444P = AV_PIX_FMT_YUVA444P_LIBAV; - AV_PIX_FMT_RGBA64BE = AV_PIX_FMT_RGBA64BE_LIBAV; - AV_PIX_FMT_RGBA64LE = AV_PIX_FMT_RGBA64LE_LIBAV; - AV_PIX_FMT_BGRA64BE = AV_PIX_FMT_BGRA64BE_LIBAV; - AV_PIX_FMT_BGRA64LE = AV_PIX_FMT_BGRA64LE_LIBAV; -{$ENDIF} - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - TPixelFormat = TAVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} - -type -(** - * Chromaticity coordinates of the source primaries. - *) - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_RESERVED = 3, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - -(** - * Color Transfer Characteristic. - *) - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_RESERVED = 3, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * YUV colorspace type. - *) - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_RESERVED = 3, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - -const - AVCOL_SPC_YCGCO = AVCOL_SPC_YCOCG; - -type -(** - * MPEG vs JPEG YUV range. - *) - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * Location of chroma samples. - * - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); diff --git a/src/lib/ffmpeg-2.4/libavutil/samplefmt.pas b/src/lib/ffmpeg-2.4/libavutil/samplefmt.pas deleted file mode 100644 index 60024330..00000000 --- a/src/lib/ffmpeg-2.4/libavutil/samplefmt.pas +++ /dev/null @@ -1,294 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 54.7.100 - * - *) - -type -(** - * @addtogroup lavu_audio - * @ - * - * @defgroup lavu_sampfmts Audio sample formats - * - * Audio sample format enumeration and related convenience functions. - * @ - * - *) - -(** - * Audio sample formats - * - * - The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * - The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * @par - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - * - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -{$IFDEF FF_API_GET_BITS_PER_SAMPLE_FMT} -(** - * @deprecated Use av_get_bytes_per_sample() instead. - *) -function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * @ - * - * @defgroup lavu_sampmanip Samples manipulation - * - * Functions that manipulate audio samples - * @ - *) - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.4/rational.pas b/src/lib/ffmpeg-2.4/rational.pas deleted file mode 100644 index 35ade835..00000000 --- a/src/lib/ffmpeg-2.4/rational.pas +++ /dev/null @@ -1,233 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 54.7.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-2.4/swresample.pas b/src/lib/ffmpeg-2.4/swresample.pas deleted file mode 100644 index c99531c6..00000000 --- a/src/lib/ffmpeg-2.4/swresample.pas +++ /dev/null @@ -1,414 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 1.1.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 1; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 1; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type -(** Dithering algorithms *) - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - -(** Resampling Engines *) - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - -(** Resampling Filter Types *) - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - -(** - * The libswresample context. Unlike libavcodec and libavformat, this structure - * is opaque. This means that if you would like to set options, you must use - * the @ref avoptions API and cannot directly set values to members of the - * structure. - *) - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * - * @param[in,out] s Swr context to initialize - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @param[in] s Swr context to check - * @see swr_init() - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - * - * @param[in] s a pointer to a pointer to Swr context - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Closes the context so that swr_is_initialized() returns 0. - * - * The context can be brought back to life by running swr_init(), - * swr_init() can also be used without swr_close(). - * This function is mainly provided for simplifying the usecase - * where one tries to support libavresample and libswresample. - * - * @param[in,out] s Swr context to be closed - *) -procedure swr_close(s: PSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - var in_: {const} PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation ("soft" compensation). This function is - * internally called when needed in swr_next_pts(). - * - * @param[in,out] s allocated Swr context. If it is not initialized, - * or SWR_FLAG_RESAMPLE is not set, swr_init() is - * called with the flag set. - * @param[in] sample_delta delta in PTS per sample - * @param[in] compensation_distance number of samples to compensate for - * @return >= 0 on success, AVERROR error codes if: - * @li @c s is NULL, - * @li @c compensation_distance is less than 0, - * @li @c compensation_distance is 0 but sample_delta is not, - * @li compensation unsupported by resampler, or - * @li swr_init() fails when called. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param[in,out] s allocated Swr context, not yet initialized - * @param[in] channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - * - * This function, along with swr_inject_silence(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - * - * This function, along with swr_drop_output(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be: - * @li if it's set to 1 the returned delay is in seconds - * @li if it's set to 1000 the returned delay is in milliseconds - * @li if it's set to the input sample rate then the returned - * delay is in input samples - * @li if it's set to the output sample rate then the returned - * delay is in output samples - * @li if it's the least common multiple of in_sample_rate and - * out_sample_rate then an exact rounding-free delay will be - * returned - * @returns the delay in 1 / @c base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. - * - * This is useful to check if the build-time libswresample has the same version - * as the run-time one. - * - * @returns the unsigned int-typed version - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - * - * @returns the build-time @c ./configure flags - *) -function swresample_configuration(): PAnsiChar; - cdecl; external sw__resample; - -(** - * Return the swr license. - * - * @returns the license of libswresample, determined at build-time - *) -function swresample_license(): PAnsiChar; - cdecl; external sw__resample; - -implementation - -end. - diff --git a/src/lib/ffmpeg-2.4/swscale.pas b/src/lib/ffmpeg-2.4/swscale.pas deleted file mode 100644 index b052f678..00000000 --- a/src/lib/ffmpeg-2.4/swscale.pas +++ /dev/null @@ -1,490 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 3.0.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 3; - LIBSWSCALE_MAX_VERSION_MINOR = 0; - LIBSWSCALE_MAX_VERSION_RELEASE = 100; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} -{$define FF_API_SWS_GETCONTEXT := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IFDEF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; -{$IFDEF FF_API_ARCH_BFIN} - SWS_CPU_CAPS_BFIN = $01000000; -{$IFEND} - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: {const} PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.5/How to update the ffmpeg files.txt b/src/lib/ffmpeg-2.5/How to update the ffmpeg files.txt deleted file mode 100644 index ae65d477..00000000 --- a/src/lib/ffmpeg-2.5/How to update the ffmpeg files.txt +++ /dev/null @@ -1,20 +0,0 @@ -how to update the ffmpeg files: - -1) buffer.pas - cpu.pas - dict.pas - error.pas - frame.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas - swresample.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-2.5/ToDo.txt b/src/lib/ffmpeg-2.5/ToDo.txt deleted file mode 100644 index 44a1a058..00000000 --- a/src/lib/ffmpeg-2.5/ToDo.txt +++ /dev/null @@ -1,11 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog diff --git a/src/lib/ffmpeg-2.5/avcodec.pas b/src/lib/ffmpeg-2.5/avcodec.pas deleted file mode 100644 index 8425fb91..00000000 --- a/src/lib/ffmpeg-2.5/avcodec.pas +++ /dev/null @@ -1,5968 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 56.1.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 56; - LIBAVCODEC_MAX_VERSION_MINOR = 13; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 56; - LIBAVCODEC_MIN_VERSION_MINOR = 13; - LIBAVCODEC_MIN_VERSION_RELEASE = 100; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130_DEPRECATED, - AV_CODEC_ID_G2M_DEPRECATED, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC_DEPRECATED, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX_DEPRECATED, - AV_CODEC_ID_PAF_VIDEO_DEPRECATED, - AV_CODEC_ID_EXR_DEPRECATED, - AV_CODEC_ID_VP7_DEPRECATED, - AV_CODEC_ID_SANM_DEPRECATED, - AV_CODEC_ID_SGIRLE_DEPRECATED, - AV_CODEC_ID_MVC1_DEPRECATED, - AV_CODEC_ID_MVC2_DEPRECATED, - -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'), - AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'), - AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'), - AV_CODEC_ID_HEVC = MKBETAG('H','2','6','5'), - AV_CODEC_ID_H265 = AV_CODEC_ID_HEVC, - AV_CODEC_ID_VP7 = MKBETAG('V','P','7','0'), - AV_CODEC_ID_APNG = MKBETAG('A','P','N','G') - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_ADPCM_VIMA = MKBETAG('V','I','M','A'), - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '), - AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '), - AV_CODEC_ID_ADPCM_G726LE = MKBETAG('6','2','7','G'), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, - AV_CODEC_ID_PAF_AUDIO_DEPRECATED, - AV_CODEC_ID_ON2AVC, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'), - AV_CODEC_ID_DSD_LSBF = MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = MKBETAG('D','S','D','M'), - AV_CODEC_ID_DSD_LSBF_PLANAR = MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = MKBETAG('D','S','D','8'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_STL = MKBETAG('S','p','T','L'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'), - AV_CODEC_ID_TIMED_ID3 = MKBETAG('T','I','D','3'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), - AV_CODEC_ID_ADPCM_G726LE= $36323747, // MKBETAG('6','2','7','G'), - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_ASS = $41534B20, // MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_DVD_NAV = $444E4156, // MKBETAG('D','N','A','V'), - AV_CODEC_ID_DSD_LSBF_PLANAR = $44534431, // MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = $44534438, // MKBETAG('D','S','D','8'), - AV_CODEC_ID_DSD_LSBF = $4453444C, // MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = $4453444D, // MKBETAG('D','S','D','M'), - AV_CODEC_ID_ADPCM_DTK = $44544B20, // MKBETAG('D','T','K',' '), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_ADPCM_IMA_RAD = $52414420, // MKBETAG('R','A','D',' '), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SMVJPEG = $534D564A, // MKBETAG('S','M','V','J'), - AV_CODEC_ID_SNOW = $534E4F57, // MKBETAG('S','N','O','W'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_TIMED_ID3 = $54494433, // MKBETAG('T','I','D','3'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_ADPCM_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBP = $57454250, // MKBETAG('W','E','B','P'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D') - AV_CODEC_ID_EVRC = $73657663, // MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = $73736D76, // MKBETAG('s','s','m','v'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_descriptor_get() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - - (** - * MIME type(s) associated with the codec. - * May be NULL; if not, a NULL-terminated array of MIME types. - * The first item is always non-NULL and is the preferred MIME type. - *) - mime_types: PAnsiChar; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Codec supports frame reordering. That is, the coded order (the order in which - * the encoded packets are output by the encoders / stored / input to the - * decoders) may be different from the presentation order of the corresponding - * frames. - * - * For codecs that do not have this property set, PTS and DTS should always be - * equal. - *) - AV_CODEC_PROP_REORDER = 1 << 3; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONINTRA= 24, ///< discard all non intra frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{ removed, kept for the moment - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -} - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = $0001; - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_OUTPUT_CORRUPT = $0008; ///< Output even those frames that might be corrupted - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. -{$IFDEF FF_API_GMC} -(** - * @deprecated use the "gmc" private option of the libxvid encoder - *) - CODEC_FLAG_GMC = $0020; ///< use GMC. -{$IFEND} -{$IFDEF FF_API_MV0} -(** - * @deprecated use the flag "mv0" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. -{$IFEND} -{$IFDEF FF_API_INPUT_PRESERVED} -(** - * @deprecated passing reference-counted frames to the encoders replaces this - * flag - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; -{$IFEND} - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ -{$IFDEF FF_API_NORMALIZE_AQP} -(** - * @deprecated use the flag "naq" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization -{$IFEND} - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! - CODEC_FLAG2_IGNORE_CROP = $00010000; ///< Discard cropping information from SPS. - - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - CODEC_FLAG2_EXPORT_MVS = $10000000; ///< Export motion vectors through frame side data - CODEC_FLAG2_SKIP_MANUAL = $20000000; ///< Do not skip samples and export skip information as frame side data - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note: AVPanScan is now (28/09/2014) defined in libavutil/frame.pas to workaround a reference problem *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -{$IFDEF FF_API_GET_BUFFER} - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - -{$IFDEF FF_API_AFD} - {attribute_deprecated} - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; -{$IFEND} - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_CODER_TYPE_DEFLATE = 4; -{$ENDIF} - - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - FF_EC_FAVOR_INTER = 256; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DEBUG_PTS = $00000200; -{$ENDIF} - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; ///< only access through AVOptions from outside libavcodec - FF_DEBUG_VIS_MB_TYPE = $00004000; ///< only access through AVOptions from outside libavcodec -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - FF_DEBUG_NOMC = $01000000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; ///< detect bitstream specification deviations - AV_EF_BUFFER = 4; ///< detect improper bitstream length - AV_EF_EXPLODE = 8; ///< abort decoding on minor error detection - - AV_EF_IGNORE_ERR = 32768; ///< ignore errors and continue - AV_EF_CAREFUL = 65536; ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors - AV_EF_COMPLIANT = 131072; ///< consider all spec non compliances as errors - AV_EF_AGGRESSIVE = 262144; ///< consider things that a sane encoder should not do as an error - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DCT_INT = 2; -{$ENDIF} - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; -{$IFDEF FF_API_ARCH_SH4} - FF_IDCT_SH4 = 9; -{$ENDIF} - FF_IDCT_SIMPLEARM = 10; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_IDCT_IPP = 13; -{$ENDIF} - FF_IDCT_XVID = 14; -{$IFDEF FF_API_IDCT_XVIDMMX} - FF_IDCT_XVIDMMX = 14; -{$ENDIF} - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; -{$IFDEF FF_API_ARCH_SPARC} - FF_IDCT_SIMPLEVIS = 18; -{$ENDIF} - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - FF_IDCT_SIMPLEAUTO = 128; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 1; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 2; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - FF_PROFILE_HEVC_REXT = 4; - - FF_LEVEL_UNKNOWN = -99; - -type - TAVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * This side data should be associated with an audio stream and contains - * ReplayGain information in form of the AVReplayGain struct. - *9 - AV_PKT_DATA_REPLAYGAIN, - - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the decoded video frames for - * correct presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_PKT_DATA_DISPLAYMATRIX, - - (** - * This side data should be associated with a video stream and contains - * Stereoscopic 3D information in form of the AVStereo3D struct. - *) - AV_PKT_DATA_STEREO3D, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE - ); - - PAVPacketSideData = ^TAVPacketSideData; - TAVPacketSideData = record - data: PByte; - size: cint; - type_: TAVPacketSideDataType; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf or destruct (deprecated) - * fields. If either is set, the packet data is dynamically allocated and is - * valid indefinitely until av_free_packet() is called (which in turn calls - * av_buffer_unref()/the destruct callback to free the data). If neither is set, - * the packet data is typically backed by some static buffer somewhere and is - * only valid for a limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideData; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; -{$IFDEF FF_API_DESTRUCT_PACKET} - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; -{$ENDIF} - - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; -{$IFDEF FF_API_CODEC_NAME} - (** - * @deprecated this field is not used for anything in libavcodec - *) - {attribute_deprecated} - codec_name: array [0..31] of AnsiChar; -{$IFEND} - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: cuint; - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * This often, but not always is the inverse of the frame rate or field rate - * for video. - * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this field is unused (see initial_padding). - * - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @note The callback may be called again immediately if initialization for - * the selected (hardware-accelerated) pixel format failed. - * @warning Behavior is undefined if the callback returns a value not - * in the fmt list of formats. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - -{$IFDEF FF_API_AFD} - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - * @deprecated Deprecated in favor of AVSideData - *) - {attribute_deprecated} - dtg_active_format: cint; -{$IFEND} - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - me_threshold: cint; - - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - mb_threshold: cint; -{$ENDIF} - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - border_masking: cfloat; -{$ENDIF} - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - -{$IFDEF FF_API_UNUSED_MEMBERS} - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; {attribute_deprecated} -{$IFEND} - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - -{$IFDEF FF_API_GET_BUFFER} - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated use get_buffer2() - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated custom freeing callbacks should be set from get_buffer2() - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; {deprecated;} - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} -{$ENDIF} - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise exended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_qsquish: cfloat; - - {attribute_deprecated} - rc_qmod_amp: cfloat; - {attribute_deprecated} - rc_qmod_freq: cint; -{$ENDIF} - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_eq: {const} PAnsiChar; -{$ENDIF} - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - -{$IFDEF FF_API_MPV_OPT} - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_buffer_aggressivity: cfloat; - - {attribute_deprecated} - rc_initial_cplx: cfloat; -{$ENDIF} - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmin: cint; - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmax: cint; -{$ENDIF} - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - -{$IFDEF FF_API_THREAD_OPAQUE} - (** - * @deprecated this field should not be used from outside of lavc - *) - thread_opaque: pointer; -{$ENDIF} - - (** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_CODEC_PKT} - (** - * @deprecated this field is not supposed to be accessed from outside lavc - *) - pkt: PAVPacket; -{$ENDIF} - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Encoding only. Allow encoders to output packets that do not contain any - * encoded data, only side data. - * - * Some encoders need to output such packets, e.g. to update some stream - * parameters at the end of encoding. - * - * All callers are strongly recommended to set this option to 1 and update - * their code to deal with such packets, since this behaviour may become - * always enabled in the future (then this option will be deprecated and - * later removed). To avoid ABI issues when this happens, the callers should - * use AVOptions to set this field. - *) - side_data_only_packets: cint; - - (** - * Audio only. The number of "priming" samples (padding) inserted by the - * encoder at the beginning of the audio. I.e. this number of leading - * decoded samples must be discarded by the caller to get the original audio - * without leading padding. - * - * - decoding: unused - * - encoding: Set by libavcodec. The timestamps on the output packets are - * adjusted by the encoder so that they always refer to the - * first sample of the data actually contained in the packet, - * including any added padding. E.g. if the timebase is - * 1/samplerate and the timestamp of the first input sample is - * 0, the timestamp of the first output packet will be - * -initial_padding. - *) - initial_padding: cint; - - (** - * - decoding: For codecs that store a framerate value in the compressed - * bitstream, the decoder may export it here. { 0, 1} when - * unknown. - * - encoding: unused - *) - framerate: TAVRational; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * Code outside libavcodec should access this field using AVOptions - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavcodec should access this field using AVOptions - * (NO direct access). - * - encoding: Set by user. - * - decoding: Set by user. - *) - dump_separator: Pcuint8; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - codec_whitelist: PAnsiChar; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * @defgroup lavc_hwaccel AVHWAccel - * @{ - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVHWAccel; - - (** - * Allocate a custom buffer - *) - alloc_frame: function (avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - frame_priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the ff_mpv_decode_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - decode_mb: procedure(s: PMpegEncContext); cdecl; - - (** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - *) - init: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - *) - uninit: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - *) - priv_data_size: cint; - end; {TAVHWAccel} - -const - (** - * Hardware acceleration should be used for decoding even if the codec level - * used is unknown or higher than the maximum supported level reported by the - * hardware driver. - *) - AV_HWACCEL_FLAG_IGNORE_LEVEL = (1 << 0); - - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct should be freed with avcodec_free_context(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Free the codec context and everything associated with it and write NULL to - * the provided pointer. - *) -procedure avcodec_free_context(var avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVFRAME_LAVC} -(** - * @deprecated use av_frame_alloc() - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; -{$ENDIF} - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - * - * @deprecated use av_frame_unref() - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - * - * @deprecated use av_frame_free() - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -{$IFDEF FF_API_DESTRUCT_PACKET} -(* - * Default packet destructor. - * @deprecated use the AVBuffer API instead - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Convert valid timing fields (timestamps / durations) in a packet from one - * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be - * ignored. - * - * @param pkt packet on which the conversion will be performed - * @param tb_src source timebase, in which the timing fields in pkt are - * expressed - * @param tb_dst destination timebase, to which the timing fields will be - * converted - *) -procedure av_packet_rescale_ts(pkt: PAVPacket; tb_src, tb_dst: TAVRational); - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_GET_BUFFER} -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; deprecated; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame and the return value would be - * less than the packet size. In this case, avcodec_decode_audio4 has to be - * called again with an AVPacket containing the remaining data in order to - * decode the second frame, etc... Even if no frames are returned, the packet - * needs to be fed to the decoder with remaining data until it is completely - * consumed or an error occurs. - * - * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning samples. It is safe to flush even those decoders that are not - * marked with CODEC_CAP_DELAY, then no samples will be returned. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. Note that this field being set to zero - * does not mean that an error has occurred. For - * decoders with CODEC_CAP_DELAY set, no given decode - * call is guaranteed to produce a frame. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, - * must be freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - (** - * Picture number incremented in presentation or output order. - * This field may be reinitialized at the first picture of a new sequence. - * - * For example, this corresponds to H.264 PicOrderCnt. - *) - output_picture_number: cint; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: {const} PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_DEINTERLACE} -(** - * deinterlace - if not supported return -1 - * - * @deprecated - use yadif (in libavfilter) instead - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * @deprecated see av_get_pix_fmt_loss() - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @deprecated see av_find_best_pix_fmt_of_2() - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is available in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output output buffer is not allocated - * and the output buffer should be considered identical to the input - * buffer, or in case *poutbuf was set it points to the input buffer - * (not necessarily to its starting address). - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: {const} PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: {const} PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. The "mutex" argument to the function points - * to a (void * ) where the lockmgr should store/get a pointer to a user - * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the - * value left by the last call for all other ops. If the lock manager is - * unable to perform the op then it should leave the mutex in the same - * state as when it was called and return a non-zero value. However, - * when called with AV_LOCK_DESTROY the mutex will always be assumed to - * have been successfully destroyed. If av_lockmgr_register succeeds - * it will return a non-negative value, if it fails it will return a - * negative value and destroy all mutex and unregister all callbacks. - * av_lockmgr_register is not thread-safe, it must be called from a - * single thread before any calls which make use of locking are used. - * - * @param cb User defined callback. av_lockmgr_register invokes calls - * to this callback and the previously registered callback. - * The callback will be used to create more than one mutex - * each of which must be backed by its own underlying locking - * mechanism (i.e. do not use a single static object to - * implement your lock manager). If cb is set to NULL the - * lockmgr will be unregistered. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-2.5/avformat.pas b/src/lib/ffmpeg-2.5/avformat.pas deleted file mode 100644 index ce2effce..00000000 --- a/src/lib/ffmpeg-2.5/avformat.pas +++ /dev/null @@ -1,2892 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 56.4.101 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 2.4.* - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 56; - LIBAVFORMAT_MAX_VERSION_MINOR = 15; - LIBAVFORMAT_MAX_VERSION_RELEASE = 102; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 56; - LIBAVFORMAT_MIN_VERSION_MINOR = 15; - LIBAVFORMAT_MIN_VERSION_RELEASE = 102; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @ - * - * @defgroup lavf_encoding Muxing - * @ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codec "stream codec context" information, such as the - * codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVStream.time_base "stream timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase - * requested by the caller. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -//type - -(* - * @defgroup metadata_api Public Metadata API - * @ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @ - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_LAVF_FRAC} -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; -{$ENDIF} - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - {const} mime_type: PAnsiChar; (**< mime_type, when known. *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MIME = 75; ///< score for file mime type - AVPROBE_SCORE_MAX = 100; ///< maximum score - - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_FLUSH_PACKETS = $0200; ///< Flush the AVIOContext every packet. -(** - * When muxing, try to avoid writing any random/volatile data to the output. - * This includes any random IDs, real-time timestamps/dates, muxer version, etc. - * - * This flag is mainly intended for testing. - *) - AVFMT_FLAG_BITEXACT = $0400; - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - - // used by AVStream - AVSTREAM_EVENT_FLAG_METADATA_UPDATED = $0001; ///< The call resulted in updated metadata. - MAX_STD_TIMEBASES = (60*12+6); - MAX_PROBE_PACKETS = 2500; - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - AVFMT_EVENT_FLAG_METADATA_UPDATED = 0001; ///< The call resulted in updated metadata. - - RAW_PACKET_BUFFER_SIZE = 2500000; - - AVFMT_AVOID_NEG_TS_AUTO = -1; ///< Enabled when required by target format - AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 1; ///< Shift timestamps so they are non negative - AVFMT_AVOID_NEG_TS_MAKE_ZERO = 2; ///< Shift timestamps so that they start at 0 - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - - PAVDeviceCapabilitiesQuery = ^TAVDeviceCapabilitiesQuery; - TAVDeviceCapabilitiesQuery = record - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (** - * Comma-separated list of mime types. - * It is used check for matching mime types while probing. - * @see av_probe_input_format2 - *) - mime_type: {const} PAnsiChar; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - priv_data: pointer; - -{$IFDEF FF_API_LAVF_FRAC} - (** - * @deprecated this field is unused - *) - pts: TAVFrac; {attribute_deprecated} -{$ENDIF} - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the desired timebase. In - * avformat_write_header(), the muxer will overwrite this field - * with the timebase that will actually be used for the timestamps - * written into the file (which may or may not be related to the - * user-provided one, depending on the format). - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - * - * - demuxing: May be set by libavformat when creating the stream or in - * avformat_find_stream_info(). - * - muxing: May be set by the caller before avformat_write_header(). - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (** - * An array of side data that applies to the whole stream (i.e. the - * container does not allow it to change between packets). - * - * There may be no overlap between the side data in this array and side data - * in the packets. I.e. a given side data is either exported by the muxer - * (demuxing) / set by the caller (muxing) in this array, then it never - * appears in the packets, or the side data is exported / sent through - * the packets (always in the first packet where the value becomes known or - * changes), then it does not appear in this array. - * - * - demuxing: Set by libavformat when the stream is created. - * - muxing: May be set by the caller before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - * - * @see av_format_inject_global_side_data() - *) - side_data: PAVPacketSideData; - - (** - * The number of elements in the AVStream.side_data array. - *) - nb_side_data: cint; - - (** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. - *) - event_flags: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * If not 0, the first audio sample that should be discarded from the stream. - * This is broken by design (needs global sample count), but can't be - * avoided for broken by design formats such as mp3 with ad-hoc gapless - * audio support. - *) - first_discard_sample: cint64; - - (** - * The sample after last sample that is intended to be discarded after - * first_discard_sample. Works on frame boundaries only. Used to prevent - * early EOF if the gapless info is broken (considered concatenated mp3s). - *) - last_discard_sample: cint64; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - (** - * Internal data to inject global side data - *) - inject_global_side_data: cint; - - (** - * String containing paris of key and values describing recommended encoder configuration. - * Paris are separated by ','. - * Keys are separated from values by '='. - *) - recommended_encoder_configuration: PAnsiChar; - - (** - * display aspect ratio (0 if unknown) - * - encoding: unused - * - decoding: Set by libavformat to calculate sample_aspect_ratio internally - *) - display_aspect_ratio: TAVRational; - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - (** - * Flags signalling stream properties. A combination of AVFMTCTX_*. - * Set by libavformat. - *) - ctx_flags: cint; - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - (** - * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. - * Set by the user before avformat_open_input() / avformat_write_header(). - *) - flags: cint; - - (** - * @deprecated deprecated in favor of probesize2 - *) - probesize: cuint; - - (** - * @deprecated deprecated in favor of max_analyze_duration2 - *) - max_analyze_duration: cint; {attribute_deprecated} - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * - muxing: Set by the caller before avformat_write_header(). If set to - * either 0 or AV_NOPTS_VALUE, then the current wall-time will - * be used. - * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that - * the value may become known after some number of frames - * have been received. - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Allow non-standard and experimental extension - * @see AVCodecContext.strict_std_compliance - *) - strict_std_compliance: cint; - - (** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. - *) - event_flags: cint; - - (** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - *) - max_ts_probe: cint; - - (** - * Avoid negative timestamps during muxing. - * Any value of the AVFMT_AVOID_NEG_TS_* constants. - * Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) - * - muxing: Set by user - * - demuxing: unused - *) - avoid_negative_ts: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cint64; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (** - * format probing score. - * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes - * the format. - * - encoding: unused - * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) - *) - probe_score: cint; - - (** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - format_probesize: cint; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (** - * ',' separated list of allowed demuxers. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - format_whitelist: PAnsiChar; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - packet_buffer_end_: PAVPacketList; - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer_: PAVPacketList; - raw_packet_buffer_end_: PAVPacketList; - (** - * Packets split by the parser get queued here. - *) - parse_queue: PAVPacketList; - parse_queue_end: PAVPacketList; - (** - * Remaining size available for raw_packet_buffer, in bytes. - *) - raw_packet_buffer_remaining_size: cint; - - (** - * Offset to remap timestamps to be non-negative. - * Expressed in timebase units. - * @see AVStream.mux_ts_offset - *) - offset: cint64; - - (** - * Timebase for the timestamp offset. - *) - offset_timebase: TAVRational; - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_video_codec (NO direct access). - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). - *) - subtitle_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - * Mostly usable with control_message_cb or any future callbacks in device's context. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user via AVOptions (NO direct access) - *) - output_ts_offset: cint64; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info() - * via AVOptions (NO direct access). - * Can be set to 0 to let avformat choose using a heuristic. - *) - max_analyze_duration2: cint64; - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input() - * via AVOptions (NO direct access). - *) - probesize2: cint64; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavformat should access this field using AVOptions - * (NO direct access). - * - muxing: Set by user. - * - demuxing: Set by user. - *) - dump_separator: Pcuint8; - end; (** TAVFormatContext **) - -function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; -procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; -procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; -function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; -procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; - -(** - * This function will cause global side data to be injected in the next packet - * of each stream as well as after any subsequent seek. - *) -procedure av_format_inject_global_side_data(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; -function av_stream_get_parser(s: {const} PAVStream): PAVCodecParserContext; - cdecl; external av__format; -function av_stream_get_recommended_encoder_configuration({const} s: PAVStream): PAnsiChar; - cdecl; external av__format; -procedure av_stream_set_recommended_encoder_configuration(s: PAVStream; configuration: PAnsiChar); - cdecl; external av__format; - -(** - * Returns the pts of the last muxed packet + its duration - * - * the retuned value is undefined when used with a demuxer. - *) -function av_stream_get_end_pts(st: {const} PAVStream): cint64; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: {const} PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: {const} PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -(** - * Get side information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_stream_get_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * If the muxer supports it, this function allows to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: {const} PAVPacket; dump_payload: cint; st: {const} PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: {const} PAVPacket; dump_payload: cint; - st: {const} PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - url: {const} PAnsiChar); - cdecl; external av__format; - -(** - * Print detailed information about the input or output format, such as - * duration, bitrate, streams, container, programs, metadata, side data, - * codec and time base. - * - * @param ic the context to analyze - * @param index index of the stream to dump information about - * @param url the URL to print, such as source or destination file - * @param is_output Select whether the specified context is an input(0) or output(1) - *) -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: {const} PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: {const} PAVOutputFormat; codec_id: TAVCodecID; - std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.5/avio.pas b/src/lib/ffmpeg-2.5/avio.pas deleted file mode 100644 index c342f8de..00000000 --- a/src/lib/ffmpeg-2.5/avio.pas +++ /dev/null @@ -1,634 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 56.4.101 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - - (** - * Original buffer size - * used internally after probing and ensure seekback to reset the buffer size - * This field is internal to libavformat and access from outside is not allowed. - *) - orig_buffer_size: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * It may be freed and replaced with a new buffer by libavformat. - * AVIOContext.buffer holds the buffer currently in use, - * which must be later freed with av_free(). - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const -(** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function avio_feof(s: PAVIOContext): cint; - cdecl; external av__format; -{$IFDEF FF_API_URL_FEOF} -(** - * @deprecated use avio_feof() - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; {attribute_deprecated} -{$ENDIF} - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data. - * - * For write streams, force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - * - * For read streams, discard all currently buffered data, and advance the - * reported file position to that of the underlying stream. This does not - * read new data, and does not perform any seeks. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -(* Avoid a warning. The header can not be included because it breaks c++. *) -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; - -(** - * Read contents of h into print buffer, up to max_size bytes, or up to EOF. - * - * @return 0 for success (max_size bytes read or EOF reached), negative error - * code otherwise - *) -function avio_read_to_bprint(h: PAVIOContext; pb: PAVBPrint; max_size: size_t): cint; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-2.5/avutil.pas b/src/lib/ffmpeg-2.5/avutil.pas deleted file mode 100644 index ac35be59..00000000 --- a/src/lib/ffmpeg-2.5/avutil.pas +++ /dev/null @@ -1,353 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 54.7.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 54; - LIBAVUTIL_MAX_VERSION_MINOR = 15; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 54; - LIBAVUTIL_MIN_VERSION_MINOR = 15; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -(** - * Return the fractional representation of the internal time base. - *) -function av_get_time_base_q: TAVRational; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-2.5/ff_api-defines.inc b/src/lib/ffmpeg-2.5/ff_api-defines.inc deleted file mode 100644 index a964caaf..00000000 --- a/src/lib/ffmpeg-2.5/ff_api-defines.inc +++ /dev/null @@ -1,263 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEINTERLACE} -{$define FF_API_DEINTERLACE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DESTRUCT_PACKET} -{$define FF_API_DESTRUCT_PACKET := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GET_BUFFER} -{$define FF_API_GET_BUFFER := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_THREAD_OPAQUE} -{$define FF_API_THREAD_OPAQUE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_PKT} -{$define FF_API_CODEC_PKT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_SH4} -{$define FF_API_ARCH_SH4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_SPARC} -{$define FF_API_ARCH_SPARC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_UNUSED_MEMBERS} -{$define FF_API_UNUSED_MEMBERS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_IDCT_XVIDMMX} -{$define FF_API_IDCT_XVIDMMX := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_INPUT_PRESERVED} -{$define FF_API_INPUT_PRESERVED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NORMALIZE_AQP} -{$define FF_API_NORMALIZE_AQP := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GMC} -{$define FF_API_GMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MV0} -{$define FF_API_MV0 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_NAME} -{$define FF_API_CODEC_NAME := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AFD} -{$define FF_API_AFD := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VISMV} -(* XXX: don't forget to drop the -vismv documentation *) -{$define FF_API_VISMV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DV_FRAME_PROFILE} -{$define FF_API_DV_FRAME_PROFILE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AUDIOENC_DELAY} -{$define FF_API_AUDIOENC_DELAY := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCTX_TIMEBASE} -{$define FF_API_AVCTX_TIMEBASE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MPV_OPT} -{$define FF_API_MPV_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_GET_BITS_PER_SAMPLE_FMT} -{$define FF_API_GET_BITS_PER_SAMPLE_FMT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_FIND_OPT} -{$define FF_API_FIND_OPT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OLD_AVOPTIONS} -{$define FF_API_OLD_AVOPTIONS := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT} -{$define FF_API_PIX_FMT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CONTEXT_SIZE} -{$define FF_API_CONTEXT_SIZE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT_DESC} -{$define FF_API_PIX_FMT_DESC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AV_REVERSE} -{$define FF_API_AV_REVERSE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AUDIOCONVERT} -{$define FF_API_AUDIOCONVERT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CPU_FLAG_MMX2} -{$define FF_API_CPU_FLAG_MMX2 := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO} -{$define FF_API_SAMPLES_UTILS_RETURN_ZERO := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_LLS_PRIVATE} -{$define FF_API_LLS_PRIVATE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_LLS1} -{$define FF_API_LLS1 :=(LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AVFRAME_LAVC} -{$define FF_API_AVFRAME_LAVC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT} -{$define FF_API_GET_CHANNEL_LAYOUT_COMPAT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_OPENCL} -{$define FF_API_OLD_OPENCL := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_INTFLOAT -{$define FF_API_INTFLOAT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_CONST_AVUTIL55} -{$IFDEF LIBAVUTIL_VERSION_MAJOR >= 55} - {$define FF_CONST_AVUTIL55 := const} -{$ELSE} - {$define FF_CONST_AVUTIL55} -{$ENDIF} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_LAVF_BITEXACT} -{$define FF_API_LAVF_BITEXACT := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_FRAC} -{$define FF_API_LAVF_FRAC := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_CODEC_TB} -{$define FF_API_LAVF_CODEC_TB := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_URL_FEOF} -{$define FF_API_URL_FEOF := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} -{$define FF_API_ALLOC_OUTPUT_CONTEXT := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} -{$define FF_API_FORMAT_PARAMETERS := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_NEW_STREAM} -{$define FF_API_NEW_STREAM := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_SET_PTS_INFO} -{$define FF_API_SET_PTS_INFO := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} -{$define FF_API_CLOSE_INPUT_FILE := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_READ_PACKET} -{$define FF_API_READ_PACKET := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ASS_SSA} -{$define FF_API_ASS_SSA := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** swscale FF_API defines *) -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_ARCH_BFIN} -{$define FF_API_ARCH_BFIN := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} - -{$ENDIF PASDOC} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.5/libavcodec/audioconvert.pas b/src/lib/ffmpeg-2.5/libavcodec/audioconvert.pas deleted file mode 100644 index 03e3fb10..00000000 --- a/src/lib/ffmpeg-2.5/libavcodec/audioconvert.pas +++ /dev/null @@ -1,291 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.5/libavutil/buffer.pas b/src/lib/ffmpeg-2.5/libavutil/buffer.pas deleted file mode 100644 index c1502f51..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/buffer.pas +++ /dev/null @@ -1,290 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 54.7.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Same as av_buffer_alloc(), except the returned buffer will be initialized - * to zero. - *) -function av_buffer_allocz(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferRef; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - * @see av_buffer_pool_can_uninit() - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.5/libavutil/cpu.pas b/src/lib/ffmpeg-2.5/libavutil/cpu.pas deleted file mode 100644 index 5d2e02da..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/cpu.pas +++ /dev/null @@ -1,119 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 54.7.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - AV_CPU_FLAG_ARMV8 = (1 << 6); - AV_CPU_FLAG_SETEND = (1 <<16); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.5/libavutil/dict.pas b/src/lib/ffmpeg-2.5/libavutil/dict.pas deleted file mode 100644 index a8cf4e32..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/dict.pas +++ /dev/null @@ -1,162 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 54.7.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get({const} m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, - * these arguments will be freed on error. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Convenience wrapper for av_dict_set that converts the value to a string - * and stores it. - * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. - *) -function av_dict_set_int(var pm: PAVDictionary; {const} key: PAnsiChar; - value: cint64; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; {const} src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Get dictionary entries as a string. - * - * Create a string containing dictionary's entries. - * Such string may be passed back to av_dict_parse_string(). - * @note String is escaped with backslashes ('\'). - * - * @param[in] m dictionary - * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. - * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other - * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. - *) -function av_dict_get_string({const} m: PAVDictionary; buffer: PPAnsiChar; - {const} key_val_sep: AnsiChar; {const} pairs_sep: AnsiChar): cint; - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.5/libavutil/error.pas b/src/lib/ffmpeg-2.5/libavutil/error.pas deleted file mode 100644 index 59580fab..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/error.pas +++ /dev/null @@ -1,166 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) - AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) -(* HTTP & RTSP errors *) - AVERROR_HTTP_BAD_REQUEST = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('0') shl 24)); - AVERROR_HTTP_UNAUTHORIZED = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('1') shl 24)); - AVERROR_HTTP_FORBIDDEN = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('3') shl 24)); - AVERROR_HTTP_NOT_FOUND = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('4') shl 24)); - AVERROR_HTTP_OTHER_4XX = -(ord($F8) or (ord('4') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - AVERROR_HTTP_SERVER_ERROR = -(ord($F8) or (ord('5') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-2.5/libavutil/frame.pas b/src/lib/ffmpeg-2.5/libavutil/frame.pas deleted file mode 100644 index 87eb21ff..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/frame.pas +++ /dev/null @@ -1,834 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 54.7.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - (** from the definitions of TAVFrame *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - AV_FRAME_FLAG_CORRUPT = (1 << 0); - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type -(* is already in pixfmt.pas - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); -*) - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO, - (** - * ReplayGain information in the form of the AVReplayGain struct. - *) - AV_FRAME_DATA_REPLAYGAIN, - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the frame for correct - * presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_FRAME_DATA_DISPLAYMATRIX, - (** - * Active Format Description data consisting of a single byte as specified - * in ETSI TS 101 154 using AVActiveFormatDescription enum. - *) - AV_FRAME_DATA_AFD, - (** - * Motion vectors exported by some codecs (on demand through the export_mvs - * flag set in the libavcodec AVCodecContext flags2 option). - * The data is the AVMotionVector struct defined in - * libavutil/motion_vector.h. - *) - AV_FRAME_DATA_MOTION_VECTORS, - (** - * Recommmends skipping the specified number of samples. This is exported - * only if the "skip_manual" AVOption is set in libavcodec. - * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_FRAME_DATA_SKIP_SAMPLES - ); - - TAVActiveFormatDescription = ( - AV_AFD_SAME = 8, - AV_AFD_4_3 = 9, - AV_AFD_16_9 = 10, - AV_AFD_14_9 = 11, - AV_AFD_4_3_SP_14_9 = 13, - AV_AFD_16_9_SP_14_9 = 14, - AV_AFD_SP_4_3 = 15 - ); {TAVActiveFormatDescription} - - PAVFrameSideData = ^TAVFrameSideData; - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. -*) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used in order to access all channels. - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - *) - key_frame: cint; - - (** - * Picture type of the frame - *) - pict_type: TAVPictureType; - -{$IFDEF FF_API_AVFRAME_LAVC} - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; {deprecated} -{$ENDIF} - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - *) - pkt_pts: cint64; - - (** - * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) - * This is also the Presentation time of this AVFrame calculated from - * only AVPacket.dts values without pts values. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - *) - coded_picture_number: cint; - - (** - * picture number in display order - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - *) - quality: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - reference: cint; {deprecated} - - (** - * QP table - *) - qscale_table: pbyte; {deprecated} - - (** - * QP store stride - *) - qstride: cint; {deprecated} - qscale_type: cint; {deprecated} - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - *) - mbskip_table: pbyte; {deprecated} - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - *) - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - *) - mb_type: PCuint; {deprecated} - - (** - * DCT coefficients - *) - dct_coeff: PsmallInt; {deprecated} - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - *) - ref_index: array [0..1] of pbyte; {deprecated} -{$ENDIF} - - (** - * for some private data of the user - *) - opaque: pointer; - - (** - * error - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - type_: cint; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - *) - palette_has_changed: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - buffer_hints: cint; {deprecated} - (** - * Pan scan. - *) - pan_scan: PAVPanScan; {deprecated} -{$ENDIF} - - (** - * reordered opaque 64bit (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - *) - reordered_opaque: cint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - (** - * @deprecated this field is unused - *) - hwaccel_picture_private: pointer; {deprecated} - owner: pointer; {deprecated} (** Note: Should be a PAVCodecContext, but a type pointer is used to avoid a reference problem. *) - thread_opaque: pointer; {deprecated} - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - *) - motion_subsample_log2: cuint8; {deprecated} -{$ENDIF} - - (** - * Sample rate of the audio data. - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * Flags describing additional frame properties. - * - * @ - *) - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - color_primaries: TAVColorPrimaries; - - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - chroma_location: TAVChromaLocation; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Move everythnig contained in src to dst and reset src. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - -(** - * If side data of the supplied type exists in the frame, free it and remove it - * from the frame. - *) -procedure av_frame_remove_side_data(frame: PAVFrame; type_: TAVFrameSideDataType); - cdecl; external av__codec; - -(** - * @return a string identifying the side data type - *) -function av_frame_side_data_name(type_: TAVFrameSideDataType): PAnsiChar; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-2.5/libavutil/log.pas b/src/lib/ffmpeg-2.5/libavutil/log.pas deleted file mode 100644 index d0854c31..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/log.pas +++ /dev/null @@ -1,530 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * log - *) - -type - (* from opt.h *) - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_DICT, - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is inteded for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, - AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, - AV_CLASS_CATEGORY_DEVICE_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_INPUT, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(* -#define AV_IS_INPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) - -#define AV_IS_OUTPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -*) - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - (** - * Value range. - * For string ranges this represents the min/max length. - * For dimensions this represents the min/max pixel count or width/height in multi-component case. - *) - value_min, value_max: cdouble; - (** - * Value's component range. - * For string this represents the unicode range for chars, 0-127 limits to ASCII. - *) - component_min, component_max: cdouble; - (** - * Range flag. - * If set to 1 the struct encodes a range, if set to 0 a single value. - *) - is_range: cint; - end; - - (** - * List of AVOptionRange structs. - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - (** - * Array of option ranges. - * - * Most of option types use just one component. - * Following describes multi-component option types: - * - * AV_OPT_TYPE_IMAGE_SIZE: - * component index 0: range of pixel count (width * height). - * component index 1: range of width. - * component index 2: range of height. - * - * @note To obtain multi-component version of this structure, user must - * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or - * av_opt_query_ranges_default function. - * - * Multi-component range can be read as in following example: - * - * @code - * int range_index, component_index; - * AVOptionRanges *ranges; - * AVOptionRange *range[3]; //may require more than 3 in the future. - * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); - * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { - * for (component_index = 0; component_index < ranges->nb_components; component_index++) - * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; - * //do something with range here. - * } - * av_opt_freep_ranges(&ranges); - * @endcode - *) - range: PPAVOptionRange; - (** - * Number of ranges per component. - *) - nb_ranges: cint; - (** - * Number of componentes. - *) - nb_components: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Sets additional colors for extended debugging sessions. - * @code - av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); - @endcode - * Requires 256color terminal support. Uses outside debugging is not - * recommended. - *) -{** to be translated if needed - AV_LOG_C(x) (x << 8) -**} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -const -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) - AV_LOG_SKIP_REPEATED = 1; - -(** - * Include the log severity in messages originating from codecs. - * - * Results in messages such as: - * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts - *) - AV_LOG_PRINT_LEVEL = 2; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; - -function av_log_get_flags: cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.5/libavutil/mathematics.pas b/src/lib/ffmpeg-2.5/libavutil/mathematics.pas deleted file mode 100644 index 1025bbf3..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/mathematics.pas +++ /dev/null @@ -1,144 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 54.7.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a, b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a, b, modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timebase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timebase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function guarantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.5/libavutil/mem.pas b/src/lib/ffmpeg-2.5/libavutil/mem.pas deleted file mode 100644 index 43a38e4d..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/mem.pas +++ /dev/null @@ -1,353 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of size * nmemb bytes with av_malloc(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param size Size in bytes of the memory block to be allocated or - * reallocated. - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate a block of memory. - * If *ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param size Size in bytes for the memory block to be allocated or - * reallocated - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_reallocp(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array through a pointer to a pointer. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate a block of size * nmemb bytes with av_mallocz(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a substring of the string s. - * @param s string to be duplicated - * @param len the maximum length of the resulting string (not counting the - * terminating byte). - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strndup({const} s: PAnsiChar; len: size_t): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @note passing a pointer to a NULL pointer is safe and leads to no action. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray_add_nofree(), av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * Function has the same functionality as av_dynarray_add(), - * but it doesn't free memory on fails. It returns error code - * instead and leave current buffer untouched. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @return >=0 on success, negative otherwise. - * @see av_dynarray_add(), av_dynarray2_add() - *) -function av_dynarray_add_nofree(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer): cint; - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add(), av_dynarray_add_nofree() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.5/libavutil/opt.pas b/src/lib/ffmpeg-2.5/libavutil/opt.pas deleted file mode 100644 index 485a9ff6..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/opt.pas +++ /dev/null @@ -1,542 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 54.7.100 - * - *) - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - * @deprecated use av_opt_set() - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -{$IFDEF FF_API_OLD_AVOPTIONS} -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all allocated objects in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict2(obj: pointer; var options: PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than - * one component for certain option types. - * @see AVOptionRanges for details. - *) - AV_OPT_MULTI_COMPONENT_RANGE = 1000; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * @note Any old dictionary present is discarded and replaced with a copy of the new one. The - * caller still owns val is and responsible for freeing it. - *) -function av_opt_set_dict_val(obj: pointer; name: {const} PAnsiChar; val: {const} PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @param[out] out_val The returned dictionary is a copy of the actual value and must - * be freed with av_dict_free() by the caller - *) -function av_opt_get_dict_val (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: PAVDictionary): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -function av_opt_copy(dest: pointer;src: pointer): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-2.5/libavutil/pixfmt.pas b/src/lib/ffmpeg-2.5/libavutil/pixfmt.pas deleted file mode 100644 index f0539c9a..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/pixfmt.pas +++ /dev/null @@ -1,577 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * Make sure that all newly added big-endian formats have (pix_fmt & 1) == 1 - * and that all newly added little-endian formats have (pix_fmt & 1) == 0. - * This allows simpler detection of big vs little-endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - {$define AV_PIX_FMT_XVMC := (AV_PIX_FMT_XVMC_MPEG2_IDCT)} -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_YA8, ///< 8bit gray, 8bit alpha -(* see const declaration way down - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -*) - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - *) - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since Sat Sep 24 06:01:45 2011 +0200 (commits 9569a3c9f41387a8c7d1ce97d8693520477a66c3) - * also see Fri Nov 25 01:38:21 2011 +0100 92afb431621c79155fcb7171d26f137eb1bee028 - * Libav added them Sun Mar 16 23:05:47 2014 +0100 with incompatible values (commit 1481d24c3a0abf81e1d7a514547bd5305232be30) - *) - AV_PIX_FMT_RGBA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - - AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb - - AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef - - AV_PIX_FMT_YA16BE, ///< 16bit gray, 16bit alpha (big-endian) - AV_PIX_FMT_YA16LE, ///< 16bit gray, 16bit alpha (little-endian) - - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB... - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0... - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR... - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0... - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -const - AV_PIX_FMT_YUVA422P = AV_PIX_FMT_YUVA422P_LIBAV; - AV_PIX_FMT_YUVA444P = AV_PIX_FMT_YUVA444P_LIBAV; - AV_PIX_FMT_RGBA64BE = AV_PIX_FMT_RGBA64BE_LIBAV; - AV_PIX_FMT_RGBA64LE = AV_PIX_FMT_RGBA64LE_LIBAV; - AV_PIX_FMT_BGRA64BE = AV_PIX_FMT_BGRA64BE_LIBAV; - AV_PIX_FMT_BGRA64LE = AV_PIX_FMT_BGRA64LE_LIBAV; -{$ENDIF} - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - TPixelFormat = TAVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} - -type -(** - * Chromaticity coordinates of the source primaries. - *) - TAVColorPrimaries = ( - AVCOL_PRI_RESERVED0 = 0, - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_RESERVED = 3, - AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - -(** - * Color Transfer Characteristic. - *) - TAVColorTransferCharacteristic = ( - AVCOL_TRC_RESERVED0 = 0, - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_RESERVED = 3, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * YUV colorspace type. - *) - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_RESERVED = 3, - AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - -const - AVCOL_SPC_YCGCO = AVCOL_SPC_YCOCG; - -type -(** - * MPEG vs JPEG YUV range. - *) - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * Location of chroma samples. - * - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); diff --git a/src/lib/ffmpeg-2.5/libavutil/samplefmt.pas b/src/lib/ffmpeg-2.5/libavutil/samplefmt.pas deleted file mode 100644 index b5d5bb03..00000000 --- a/src/lib/ffmpeg-2.5/libavutil/samplefmt.pas +++ /dev/null @@ -1,286 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 54.7.100 - * - *) - -type -(** - * @addtogroup lavu_audio - * @ - * - * @defgroup lavu_sampfmts Audio sample formats - * - * Audio sample format enumeration and related convenience functions. - * @ - * - *) - -(** - * Audio sample formats - * - * - The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * - The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * @par - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - * - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * @ - * - * @defgroup lavu_sampmanip Samples manipulation - * - * Functions that manipulate audio samples - * @ - *) - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.5/rational.pas b/src/lib/ffmpeg-2.5/rational.pas deleted file mode 100644 index 35ade835..00000000 --- a/src/lib/ffmpeg-2.5/rational.pas +++ /dev/null @@ -1,233 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 54.7.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-2.5/swresample.pas b/src/lib/ffmpeg-2.5/swresample.pas deleted file mode 100644 index c99531c6..00000000 --- a/src/lib/ffmpeg-2.5/swresample.pas +++ /dev/null @@ -1,414 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 1.1.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 1; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 1; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type -(** Dithering algorithms *) - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - -(** Resampling Engines *) - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - -(** Resampling Filter Types *) - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - -(** - * The libswresample context. Unlike libavcodec and libavformat, this structure - * is opaque. This means that if you would like to set options, you must use - * the @ref avoptions API and cannot directly set values to members of the - * structure. - *) - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * - * @param[in,out] s Swr context to initialize - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @param[in] s Swr context to check - * @see swr_init() - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - * - * @param[in] s a pointer to a pointer to Swr context - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Closes the context so that swr_is_initialized() returns 0. - * - * The context can be brought back to life by running swr_init(), - * swr_init() can also be used without swr_close(). - * This function is mainly provided for simplifying the usecase - * where one tries to support libavresample and libswresample. - * - * @param[in,out] s Swr context to be closed - *) -procedure swr_close(s: PSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - var in_: {const} PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation ("soft" compensation). This function is - * internally called when needed in swr_next_pts(). - * - * @param[in,out] s allocated Swr context. If it is not initialized, - * or SWR_FLAG_RESAMPLE is not set, swr_init() is - * called with the flag set. - * @param[in] sample_delta delta in PTS per sample - * @param[in] compensation_distance number of samples to compensate for - * @return >= 0 on success, AVERROR error codes if: - * @li @c s is NULL, - * @li @c compensation_distance is less than 0, - * @li @c compensation_distance is 0 but sample_delta is not, - * @li compensation unsupported by resampler, or - * @li swr_init() fails when called. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param[in,out] s allocated Swr context, not yet initialized - * @param[in] channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - * - * This function, along with swr_inject_silence(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - * - * This function, along with swr_drop_output(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be: - * @li if it's set to 1 the returned delay is in seconds - * @li if it's set to 1000 the returned delay is in milliseconds - * @li if it's set to the input sample rate then the returned - * delay is in input samples - * @li if it's set to the output sample rate then the returned - * delay is in output samples - * @li if it's the least common multiple of in_sample_rate and - * out_sample_rate then an exact rounding-free delay will be - * returned - * @returns the delay in 1 / @c base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. - * - * This is useful to check if the build-time libswresample has the same version - * as the run-time one. - * - * @returns the unsigned int-typed version - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - * - * @returns the build-time @c ./configure flags - *) -function swresample_configuration(): PAnsiChar; - cdecl; external sw__resample; - -(** - * Return the swr license. - * - * @returns the license of libswresample, determined at build-time - *) -function swresample_license(): PAnsiChar; - cdecl; external sw__resample; - -implementation - -end. - diff --git a/src/lib/ffmpeg-2.5/swscale.pas b/src/lib/ffmpeg-2.5/swscale.pas deleted file mode 100644 index e50cde16..00000000 --- a/src/lib/ffmpeg-2.5/swscale.pas +++ /dev/null @@ -1,490 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 3.0.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 3; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 101; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} -{$define FF_API_SWS_GETCONTEXT := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IFDEF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; -{$IFDEF FF_API_ARCH_BFIN} - SWS_CPU_CAPS_BFIN = $01000000; -{$IFEND} - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: {const} PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.6/How to update the ffmpeg files.txt b/src/lib/ffmpeg-2.6/How to update the ffmpeg files.txt deleted file mode 100644 index ae65d477..00000000 --- a/src/lib/ffmpeg-2.6/How to update the ffmpeg files.txt +++ /dev/null @@ -1,20 +0,0 @@ -how to update the ffmpeg files: - -1) buffer.pas - cpu.pas - dict.pas - error.pas - frame.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas - swresample.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-2.6/ToDo.txt b/src/lib/ffmpeg-2.6/ToDo.txt deleted file mode 100644 index 44a1a058..00000000 --- a/src/lib/ffmpeg-2.6/ToDo.txt +++ /dev/null @@ -1,11 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog diff --git a/src/lib/ffmpeg-2.6/avcodec.pas b/src/lib/ffmpeg-2.6/avcodec.pas deleted file mode 100644 index 18bb091a..00000000 --- a/src/lib/ffmpeg-2.6/avcodec.pas +++ /dev/null @@ -1,6035 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 56.1.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 56; - LIBAVCODEC_MAX_VERSION_MINOR = 26; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 56; - LIBAVCODEC_MIN_VERSION_MINOR = 26; - LIBAVCODEC_MIN_VERSION_RELEASE = 100; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130_DEPRECATED, - AV_CODEC_ID_G2M_DEPRECATED, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC_DEPRECATED, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX_DEPRECATED, - AV_CODEC_ID_PAF_VIDEO_DEPRECATED, - AV_CODEC_ID_EXR_DEPRECATED, - AV_CODEC_ID_VP7_DEPRECATED, - AV_CODEC_ID_SANM_DEPRECATED, - AV_CODEC_ID_SGIRLE_DEPRECATED, - AV_CODEC_ID_MVC1_DEPRECATED, - AV_CODEC_ID_MVC2_DEPRECATED, - AV_CODEC_ID_HQX, - -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'), - AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'), - AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'), - AV_CODEC_ID_HEVC = MKBETAG('H','2','6','5'), - AV_CODEC_ID_H265 = AV_CODEC_ID_HEVC, - AV_CODEC_ID_VP7 = MKBETAG('V','P','7','0'), - AV_CODEC_ID_APNG = MKBETAG('A','P','N','G') - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_ADPCM_VIMA = MKBETAG('V','I','M','A'), -{$IFDEF FF_API_VIMA_DECODER} - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), -{$IFEND} - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '), - AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '), - AV_CODEC_ID_ADPCM_G726LE = MKBETAG('6','2','7','G'), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, - AV_CODEC_ID_PAF_AUDIO_DEPRECATED, - AV_CODEC_ID_ON2AVC, - AV_CODEC_ID_DSS_SP, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'), - AV_CODEC_ID_DSD_LSBF = MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = MKBETAG('D','S','D','M'), - AV_CODEC_ID_DSD_LSBF_PLANAR = MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = MKBETAG('D','S','D','8'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_STL = MKBETAG('S','p','T','L'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'), - AV_CODEC_ID_TIMED_ID3 = MKBETAG('T','I','D','3'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), - AV_CODEC_ID_ADPCM_G726LE= $36323747, // MKBETAG('6','2','7','G'), - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_ASS = $41534B20, // MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_DVD_NAV = $444E4156, // MKBETAG('D','N','A','V'), - AV_CODEC_ID_DSD_LSBF_PLANAR = $44534431, // MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = $44534438, // MKBETAG('D','S','D','8'), - AV_CODEC_ID_DSD_LSBF = $4453444C, // MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = $4453444D, // MKBETAG('D','S','D','M'), - AV_CODEC_ID_ADPCM_DTK = $44544B20, // MKBETAG('D','T','K',' '), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_ADPCM_IMA_RAD = $52414420, // MKBETAG('R','A','D',' '), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SMVJPEG = $534D564A, // MKBETAG('S','M','V','J'), - AV_CODEC_ID_SNOW = $534E4F57, // MKBETAG('S','N','O','W'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_TIMED_ID3 = $54494433, // MKBETAG('T','I','D','3'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_ADPCM_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBP = $57454250, // MKBETAG('W','E','B','P'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D') - AV_CODEC_ID_EVRC = $73657663, // MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = $73736D76, // MKBETAG('s','s','m','v'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_descriptor_get() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - - (** - * MIME type(s) associated with the codec. - * May be NULL; if not, a NULL-terminated array of MIME types. - * The first item is always non-NULL and is the preferred MIME type. - *) - mime_types: PAnsiChar; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Codec supports frame reordering. That is, the coded order (the order in which - * the encoded packets are output by the encoders / stored / input to the - * decoders) may be different from the presentation order of the corresponding - * frames. - * - * For codecs that do not have this property set, PTS and DTS should always be - * equal. - *) - AV_CODEC_PROP_REORDER = 1 << 3; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONINTRA= 24, ///< discard all non intra frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{ removed, kept for the moment - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -} - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = $0001; - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_OUTPUT_CORRUPT = $0008; ///< Output even those frames that might be corrupted - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. -{$IFDEF FF_API_GMC} -(** - * @deprecated use the "gmc" private option of the libxvid encoder - *) - CODEC_FLAG_GMC = $0020; ///< use GMC. -{$IFEND} -{$IFDEF FF_API_MV0} -(** - * @deprecated use the flag "mv0" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. -{$IFEND} -{$IFDEF FF_API_INPUT_PRESERVED} -(** - * @deprecated passing reference-counted frames to the encoders replaces this - * flag - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; -{$IFEND} - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ -{$IFDEF FF_API_NORMALIZE_AQP} -(** - * @deprecated use the flag "naq" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization -{$IFEND} - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! - CODEC_FLAG2_IGNORE_CROP = $00010000; ///< Discard cropping information from SPS. - - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - CODEC_FLAG2_EXPORT_MVS = $10000000; ///< Export motion vectors through frame side data - CODEC_FLAG2_SKIP_MANUAL = $20000000; ///< Do not skip samples and export skip information as frame side data - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note: AVPanScan is now (28/09/2014) defined in libavutil/frame.pas to workaround a reference problem *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -{$IFDEF FF_API_GET_BUFFER} - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - -{$IFDEF FF_API_AFD} - {attribute_deprecated} - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; -{$IFEND} - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_CODER_TYPE_DEFLATE = 4; -{$ENDIF} - - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - FF_EC_FAVOR_INTER = 256; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DEBUG_PTS = $00000200; -{$ENDIF} - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; ///< only access through AVOptions from outside libavcodec - FF_DEBUG_VIS_MB_TYPE = $00004000; ///< only access through AVOptions from outside libavcodec -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - FF_DEBUG_NOMC = $01000000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; ///< detect bitstream specification deviations - AV_EF_BUFFER = 4; ///< detect improper bitstream length - AV_EF_EXPLODE = 8; ///< abort decoding on minor error detection - - AV_EF_IGNORE_ERR = 32768; ///< ignore errors and continue - AV_EF_CAREFUL = 65536; ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors - AV_EF_COMPLIANT = 131072; ///< consider all spec non compliances as errors - AV_EF_AGGRESSIVE = 262144; ///< consider things that a sane encoder should not do as an error - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DCT_INT = 2; -{$ENDIF} - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; -{$IFDEF FF_API_ARCH_SH4} - FF_IDCT_SH4 = 9; -{$ENDIF} - FF_IDCT_SIMPLEARM = 10; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_IDCT_IPP = 13; -{$ENDIF} - FF_IDCT_XVID = 14; -{$IFDEF FF_API_IDCT_XVIDMMX} - FF_IDCT_XVIDMMX = 14; -{$ENDIF} - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; -{$IFDEF FF_API_ARCH_SPARC} - FF_IDCT_SIMPLEVIS = 18; -{$ENDIF} - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - FF_IDCT_SIMPLEAUTO = 128; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 1; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 2; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - FF_PROFILE_HEVC_REXT = 4; - - FF_LEVEL_UNKNOWN = -99; - -type - TAVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * This side data should be associated with an audio stream and contains - * ReplayGain information in form of the AVReplayGain struct. - *9 - AV_PKT_DATA_REPLAYGAIN, - - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the decoded video frames for - * correct presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_PKT_DATA_DISPLAYMATRIX, - - (** - * This side data should be associated with a video stream and contains - * Stereoscopic 3D information in form of the AVStereo3D struct. - *) - AV_PKT_DATA_STEREO3D, - - (** - * This side data should be associated with an audio stream and corresponds - * to enum AVAudioServiceType. - *) - AV_PKT_DATA_AUDIO_SERVICE_TYPE, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE - ); - - PAVPacketSideData = ^TAVPacketSideData; - TAVPacketSideData = record - data: PByte; - size: cint; - type_: TAVPacketSideDataType; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf or destruct (deprecated) - * fields. If either is set, the packet data is dynamically allocated and is - * valid indefinitely until av_free_packet() is called (which in turn calls - * av_buffer_unref()/the destruct callback to free the data). If neither is set, - * the packet data is typically backed by some static buffer somewhere and is - * only valid for a limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideData; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; -{$IFDEF FF_API_DESTRUCT_PACKET} - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; -{$ENDIF} - - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; -{$IFDEF FF_API_CODEC_NAME} - (** - * @deprecated this field is not used for anything in libavcodec - *) - {attribute_deprecated} - codec_name: array [0..31] of AnsiChar; -{$IFEND} - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - -{$IFDEF FF_API_STREAM_CODEC_TAG} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - stream_codec_tag: cuint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * This often, but not always is the inverse of the frame rate or field rate - * for video. - * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this field is unused (see initial_padding). - * - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @note The callback may be called again immediately if initialization for - * the selected (hardware-accelerated) pixel format failed. - * @warning Behavior is undefined if the callback returns a value not - * in the fmt list of formats. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - -{$IFDEF FF_API_AFD} - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - * @deprecated Deprecated in favor of AVSideData - *) - {attribute_deprecated} - dtg_active_format: cint; -{$IFEND} - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - me_threshold: cint; - - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - mb_threshold: cint; -{$ENDIF} - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - border_masking: cfloat; -{$ENDIF} - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - -{$IFDEF FF_API_UNUSED_MEMBERS} - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; {attribute_deprecated} -{$IFEND} - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - -{$IFDEF FF_API_GET_BUFFER} - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated use get_buffer2() - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated custom freeing callbacks should be set from get_buffer2() - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; {deprecated;} - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} -{$ENDIF} - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise exended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_qsquish: cfloat; - - {attribute_deprecated} - rc_qmod_amp: cfloat; - {attribute_deprecated} - rc_qmod_freq: cint; -{$ENDIF} - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_eq: {const} PAnsiChar; -{$ENDIF} - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - -{$IFDEF FF_API_MPV_OPT} - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_buffer_aggressivity: cfloat; - - {attribute_deprecated} - rc_initial_cplx: cfloat; -{$ENDIF} - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmin: cint; - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmax: cint; -{$ENDIF} - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - -{$IFDEF FF_API_THREAD_OPAQUE} - (** - * @deprecated this field should not be used from outside of lavc - *) - thread_opaque: pointer; -{$ENDIF} - - (** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_CODEC_PKT} - (** - * @deprecated this field is not supposed to be accessed from outside lavc - *) - pkt: PAVPacket; -{$ENDIF} - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Encoding only. Allow encoders to output packets that do not contain any - * encoded data, only side data. - * - * Some encoders need to output such packets, e.g. to update some stream - * parameters at the end of encoding. - * - * All callers are strongly recommended to set this option to 1 and update - * their code to deal with such packets, since this behaviour may become - * always enabled in the future (then this option will be deprecated and - * later removed). To avoid ABI issues when this happens, the callers should - * use AVOptions to set this field. - *) - side_data_only_packets: cint; - - (** - * Audio only. The number of "priming" samples (padding) inserted by the - * encoder at the beginning of the audio. I.e. this number of leading - * decoded samples must be discarded by the caller to get the original audio - * without leading padding. - * - * - decoding: unused - * - encoding: Set by libavcodec. The timestamps on the output packets are - * adjusted by the encoder so that they always refer to the - * first sample of the data actually contained in the packet, - * including any added padding. E.g. if the timebase is - * 1/samplerate and the timestamp of the first input sample is - * 0, the timestamp of the first output packet will be - * -initial_padding. - *) - initial_padding: cint; - - (** - * - decoding: For codecs that store a framerate value in the compressed - * bitstream, the decoder may export it here. { 0, 1} when - * unknown. - * - encoding: unused - *) - framerate: TAVRational; - - (** - * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - * - encoding: unused. - * - decoding: Set by libavcodec before calling get_format() - *) - sw_pix_fmt: TAVPixelFormat; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * Code outside libavcodec should access this field using AVOptions - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavcodec should access this field using AVOptions - * (NO direct access). - * - encoding: Set by user. - * - decoding: Set by user. - *) - dump_separator: Pcuint8; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - codec_whitelist: PAnsiChar; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they are rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * @defgroup lavc_hwaccel AVHWAccel - * @{ - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVHWAccel; - - (** - * Allocate a custom buffer - *) - alloc_frame: function (avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - frame_priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the ff_mpv_decode_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - decode_mb: procedure(s: PMpegEncContext); cdecl; - - (** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - *) - init: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - *) - uninit: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - *) - priv_data_size: cint; - end; {TAVHWAccel} - -const - (** - * Hardware acceleration should be used for decoding even if the codec level - * used is unknown or higher than the maximum supported level reported by the - * hardware driver. - *) - AV_HWACCEL_FLAG_IGNORE_LEVEL = (1 << 0); - - (** - * Hardware acceleration can output YUV pixel formats with a different chroma - * sampling than 4:2:0 and/or other than 8 bits per component. - *) - AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = (1 << 1); - - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct should be freed with avcodec_free_context(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Free the codec context and everything associated with it and write NULL to - * the provided pointer. - *) -procedure avcodec_free_context(var avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVFRAME_LAVC} -(** - * @deprecated use av_frame_alloc() - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; -{$ENDIF} - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - * - * @deprecated use av_frame_unref() - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - * - * @deprecated use av_frame_free() - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_decode_video2()). - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -{$IFDEF FF_API_DESTRUCT_PACKET} -(* - * Default packet destructor. - * @deprecated use the AVBuffer API instead - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Convert valid timing fields (timestamps / durations) in a packet from one - * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be - * ignored. - * - * @param pkt packet on which the conversion will be performed - * @param tb_src source timebase, in which the timing fields in pkt are - * expressed - * @param tb_dst destination timebase, to which the timing fields will be - * converted - *) -procedure av_packet_rescale_ts(pkt: PAVPacket; tb_src, tb_dst: TAVRational); - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_GET_BUFFER} -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; deprecated; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame and the return value would be - * less than the packet size. In this case, avcodec_decode_audio4 has to be - * called again with an AVPacket containing the remaining data in order to - * decode the second frame, etc... Even if no frames are returned, the packet - * needs to be fed to the decoder with remaining data until it is completely - * consumed or an error occurs. - * - * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning samples. It is safe to flush even those decoders that are not - * marked with CODEC_CAP_DELAY, then no samples will be returned. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. Note that this field being set to zero - * does not mean that an error has occurred. For - * decoders with CODEC_CAP_DELAY set, no given decode - * call is guaranteed to produce a frame. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning subtitles. It is safe to flush even those decoders that are not - * marked with CODEC_CAP_DELAY, then no subtitles will be returned. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, - * must be freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - (** - * Picture number incremented in presentation or output order. - * This field may be reinitialized at the first picture of a new sequence. - * - * For example, this corresponds to H.264 PicOrderCnt. - *) - output_picture_number: cint; - - (** - * Dimensions of the decoded video intended for presentation. - *) - width: cint; - height: cint; - - (** - * Dimensions of the coded video. - *) - coded_width: cint; - coded_height: cint; - - (** - * The format of the coded data, corresponds to enum AVPixelFormat for video - * and for enum AVSampleFormat for audio. - * - * Note that a decoder can have considerable freedom in how exactly it - * decodes the data, so the format reported here might be different from the - * one returned by a decoder. - *) - format: cint; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - (* This callback never returns an error, a negative value means that - * the frame start was in a previous packet. *) - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: {const} PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_DEINTERLACE} -(** - * deinterlace - if not supported return -1 - * - * @deprecated - use yadif (in libavfilter) instead - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * @deprecated see av_get_pix_fmt_loss() - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @deprecated see av_find_best_pix_fmt_of_2() - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is available in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output output buffer is not allocated - * and the output buffer should be considered identical to the input - * buffer, or in case *poutbuf was set it points to the input buffer - * (not necessarily to its starting address). - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: {const} PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: {const} PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. The "mutex" argument to the function points - * to a (void * ) where the lockmgr should store/get a pointer to a user - * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the - * value left by the last call for all other ops. If the lock manager is - * unable to perform the op then it should leave the mutex in the same - * state as when it was called and return a non-zero value. However, - * when called with AV_LOCK_DESTROY the mutex will always be assumed to - * have been successfully destroyed. If av_lockmgr_register succeeds - * it will return a non-negative value, if it fails it will return a - * negative value and destroy all mutex and unregister all callbacks. - * av_lockmgr_register is not thread-safe, it must be called from a - * single thread before any calls which make use of locking are used. - * - * @param cb User defined callback. av_lockmgr_register invokes calls - * to this callback and the previously registered callback. - * The callback will be used to create more than one mutex - * each of which must be backed by its own underlying locking - * mechanism (i.e. do not use a single static object to - * implement your lock manager). If cb is set to NULL the - * lockmgr will be unregistered. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-2.6/avformat.pas b/src/lib/ffmpeg-2.6/avformat.pas deleted file mode 100644 index fdf97dca..00000000 --- a/src/lib/ffmpeg-2.6/avformat.pas +++ /dev/null @@ -1,2887 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 56.4.101 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 2.4.* - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 56; - LIBAVFORMAT_MAX_VERSION_MINOR = 25; - LIBAVFORMAT_MAX_VERSION_RELEASE = 101; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 56; - LIBAVFORMAT_MIN_VERSION_MINOR = 25; - LIBAVFORMAT_MIN_VERSION_RELEASE = 101; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * Lavf allows to configure muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @ - * - * @defgroup lavf_encoding Muxing - * @ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codec "stream codec context" information, such as the - * codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVStream.time_base "stream timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - It is advised to manually initialize only the relevant fields in - * AVCodecContext, rather than using @ref avcodec_copy_context() during - * remuxing: there is no guarantee that the codec context values remain valid - * for both input and output format contexts. - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase - * requested by the caller. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -//type - -(* - * @defgroup metadata_api Public Metadata API - * @ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @ - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_LAVF_FRAC} -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; -{$ENDIF} - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - {const} mime_type: PAnsiChar; (**< mime_type, when known. *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MIME = 75; ///< score for file mime type - AVPROBE_SCORE_MAX = 100; ///< maximum score - - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_FLUSH_PACKETS = $0200; ///< Flush the AVIOContext every packet. -(** - * When muxing, try to avoid writing any random/volatile data to the output. - * This includes any random IDs, real-time timestamps/dates, muxer version, etc. - * - * This flag is mainly intended for testing. - *) - AVFMT_FLAG_BITEXACT = $0400; - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - - // used by AVStream - AVSTREAM_EVENT_FLAG_METADATA_UPDATED = $0001; ///< The call resulted in updated metadata. - MAX_STD_TIMEBASES = (60*12+6); - MAX_PROBE_PACKETS = 2500; - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - AVFMT_EVENT_FLAG_METADATA_UPDATED = 0001; ///< The call resulted in updated metadata. - - RAW_PACKET_BUFFER_SIZE = 2500000; - - AVFMT_AVOID_NEG_TS_AUTO = -1; ///< Enabled when required by target format - AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 1; ///< Shift timestamps so they are non negative - AVFMT_AVOID_NEG_TS_MAKE_ZERO = 2; ///< Shift timestamps so that they start at 0 - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - - PAVDeviceCapabilitiesQuery = ^TAVDeviceCapabilitiesQuery; - TAVDeviceCapabilitiesQuery = record - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - data_codec: TAVCodecID; (**< default data codec *) - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (** - * Comma-separated list of mime types. - * It is used check for matching mime types while probing. - * @see av_probe_input_format2 - *) - mime_type: {const} PAnsiChar; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - priv_data: pointer; - -{$IFDEF FF_API_LAVF_FRAC} - (** - * @deprecated this field is unused - *) - pts: TAVFrac; {attribute_deprecated} -{$ENDIF} - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the desired timebase. In - * avformat_write_header(), the muxer will overwrite this field - * with the timebase that will actually be used for the timestamps - * written into the file (which may or may not be related to the - * user-provided one, depending on the format). - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - * - * - demuxing: May be set by libavformat when creating the stream or in - * avformat_find_stream_info(). - * - muxing: May be set by the caller before avformat_write_header(). - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (** - * An array of side data that applies to the whole stream (i.e. the - * container does not allow it to change between packets). - * - * There may be no overlap between the side data in this array and side data - * in the packets. I.e. a given side data is either exported by the muxer - * (demuxing) / set by the caller (muxing) in this array, then it never - * appears in the packets, or the side data is exported / sent through - * the packets (always in the first packet where the value becomes known or - * changes), then it does not appear in this array. - * - * - demuxing: Set by libavformat when the stream is created. - * - muxing: May be set by the caller before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - * - * @see av_format_inject_global_side_data() - *) - side_data: PAVPacketSideData; - - (** - * The number of elements in the AVStream.side_data array. - *) - nb_side_data: cint; - - (** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. - *) - event_flags: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * If not 0, the first audio sample that should be discarded from the stream. - * This is broken by design (needs global sample count), but can't be - * avoided for broken by design formats such as mp3 with ad-hoc gapless - * audio support. - *) - first_discard_sample: cint64; - - (** - * The sample after last sample that is intended to be discarded after - * first_discard_sample. Works on frame boundaries only. Used to prevent - * early EOF if the gapless info is broken (considered concatenated mp3s). - *) - last_discard_sample: cint64; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - (** - * Internal data to inject global side data - *) - inject_global_side_data: cint; - - (** - * String containing paris of key and values describing recommended encoder configuration. - * Paris are separated by ','. - * Keys are separated from values by '='. - *) - recommended_encoder_configuration: PAnsiChar; - - (** - * display aspect ratio (0 if unknown) - * - encoding: unused - * - decoding: Set by libavformat to calculate sample_aspect_ratio internally - *) - display_aspect_ratio: TAVRational; - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - (** - * Flags signalling stream properties. A combination of AVFMTCTX_*. - * Set by libavformat. - *) - ctx_flags: cint; - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - (** - * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. - * Set by the user before avformat_open_input() / avformat_write_header(). - *) - flags: cint; - - (** - * @deprecated deprecated in favor of probesize2 - *) - probesize: cuint; - - (** - * @deprecated deprecated in favor of max_analyze_duration2 - *) - max_analyze_duration: cint; {attribute_deprecated} - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * - muxing: Set by the caller before avformat_write_header(). If set to - * either 0 or AV_NOPTS_VALUE, then the current wall-time will - * be used. - * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that - * the value may become known after some number of frames - * have been received. - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Allow non-standard and experimental extension - * @see AVCodecContext.strict_std_compliance - *) - strict_std_compliance: cint; - - (** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. - *) - event_flags: cint; - - (** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - *) - max_ts_probe: cint; - - (** - * Avoid negative timestamps during muxing. - * Any value of the AVFMT_AVOID_NEG_TS_* constants. - * Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) - * - muxing: Set by user - * - demuxing: unused - *) - avoid_negative_ts: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cint64; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (** - * format probing score. - * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes - * the format. - * - encoding: unused - * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) - *) - probe_score: cint; - - (** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - format_probesize: cint; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (** - * ',' separated list of allowed demuxers. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - format_whitelist: PAnsiChar; - - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_video_codec (NO direct access). - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). - *) - subtitle_codec: PAVCodec; - - (** - * Forced data codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_data_codec (NO direct access). - *) - data_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - * Mostly usable with control_message_cb or any future callbacks in device's context. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user via AVOptions (NO direct access) - *) - output_ts_offset: cint64; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info() - * via AVOptions (NO direct access). - * Can be set to 0 to let avformat choose using a heuristic. - *) - max_analyze_duration2: cint64; - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input() - * via AVOptions (NO direct access). - *) - probesize2: cint64; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavformat should access this field using AVOptions - * (NO direct access). - * - muxing: Set by user. - * - demuxing: Set by user. - *) - dump_separator: Pcuint8; - - (** - * Forced Data codec_id. - * Demuxing: Set by user. - *) - data_codec_id: TAVCodecID; - end; (** TAVFormatContext **) - -function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_data_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_data_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; -procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; -procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; -function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; -procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; - -(** - * This function will cause global side data to be injected in the next packet - * of each stream as well as after any subsequent seek. - *) -procedure av_format_inject_global_side_data(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; -function av_stream_get_parser(s: {const} PAVStream): PAVCodecParserContext; - cdecl; external av__format; -function av_stream_get_recommended_encoder_configuration({const} s: PAVStream): PAnsiChar; - cdecl; external av__format; -procedure av_stream_set_recommended_encoder_configuration(s: PAVStream; configuration: PAnsiChar); - cdecl; external av__format; - -(** - * Returns the pts of the last muxed packet + its duration - * - * the retuned value is undefined when used with a demuxer. - *) -function av_stream_get_end_pts(st: {const} PAVStream): cint64; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: {const} PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: {const} PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -(** - * Get side information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_stream_get_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Discard all internally buffered data. This can be useful when dealing with - * discontinuities in the byte stream. Generally works only with formats that - * can resync. This includes headerless formats like MPEG-TS/TS but should also - * work with NUT, Ogg and in a limited way AVI for example. - * - * The set of streams, the detected duration, stream parameters and codecs do - * not change when calling this function. If you want a complete reset, it's - * better to open a new AVFormatContext. - * - * This does not flush the AVIOContext (s->pb). If necessary, call - * avio_flush(s->pb) before calling this function. - * - * @param s media file handle - * @return >=0 on success, error code otherwise - *) -function avformat_flush(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * If the muxer supports it, this function allows to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: {const} PAVPacket; dump_payload: cint; st: {const} PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: {const} PAVPacket; dump_payload: cint; - st: {const} PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - url: {const} PAnsiChar); - cdecl; external av__format; - -(** - * Print detailed information about the input or output format, such as - * duration, bitrate, streams, container, programs, metadata, side data, - * codec and time base. - * - * @param ic the context to analyze - * @param index index of the stream to dump information about - * @param url the URL to print, such as source or destination file - * @param is_output Select whether the specified context is an input(0) or output(1) - *) -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: {const} PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: {const} PAVOutputFormat; codec_id: TAVCodecID; - std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.6/avio.pas b/src/lib/ffmpeg-2.6/avio.pas deleted file mode 100644 index db3a84e6..00000000 --- a/src/lib/ffmpeg-2.6/avio.pas +++ /dev/null @@ -1,641 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 56.4.101 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - - (** - * Original buffer size - * used internally after probing and ensure seekback to reset the buffer size - * This field is internal to libavformat and access from outside is not allowed. - *) - orig_buffer_size: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * It may be freed and replaced with a new buffer by libavformat. - * AVIOContext.buffer holds the buffer currently in use, - * which must be later freed with av_free(). - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16BE and write it. - * @return number of bytes written. - *) -function avio_put_str16be(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const -(** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function avio_feof(s: PAVIOContext): cint; - cdecl; external av__format; -{$IFDEF FF_API_URL_FEOF} -(** - * @deprecated use avio_feof() - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; {attribute_deprecated} -{$ENDIF} - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data. - * - * For write streams, force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - * - * For read streams, discard all currently buffered data, and advance the - * reported file position to that of the underlying stream. This does not - * read new data, and does not perform any seeks. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -(* Avoid a warning. The header can not be included because it breaks c++. *) -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; - -(** - * Read contents of h into print buffer, up to max_size bytes, or up to EOF. - * - * @return 0 for success (max_size bytes read or EOF reached), negative error - * code otherwise - *) -function avio_read_to_bprint(h: PAVIOContext; pb: PAVBPrint; max_size: size_t): cint; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-2.6/avutil.pas b/src/lib/ffmpeg-2.6/avutil.pas deleted file mode 100644 index 1cfbbfcb..00000000 --- a/src/lib/ffmpeg-2.6/avutil.pas +++ /dev/null @@ -1,353 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 54.7.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 54; - LIBAVUTIL_MAX_VERSION_MINOR = 20; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 54; - LIBAVUTIL_MIN_VERSION_MINOR = 20; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -(** - * Return the fractional representation of the internal time base. - *) -function av_get_time_base_q: TAVRational; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-2.6/ff_api-defines.inc b/src/lib/ffmpeg-2.6/ff_api-defines.inc deleted file mode 100644 index 5c9b4bb2..00000000 --- a/src/lib/ffmpeg-2.6/ff_api-defines.inc +++ /dev/null @@ -1,269 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_VIMA_DECODER} -{$define FF_API_VIMA_DECODER := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEINTERLACE} -{$define FF_API_DEINTERLACE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DESTRUCT_PACKET} -{$define FF_API_DESTRUCT_PACKET := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GET_BUFFER} -{$define FF_API_GET_BUFFER := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_THREAD_OPAQUE} -{$define FF_API_THREAD_OPAQUE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_PKT} -{$define FF_API_CODEC_PKT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_SH4} -{$define FF_API_ARCH_SH4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_SPARC} -{$define FF_API_ARCH_SPARC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_UNUSED_MEMBERS} -{$define FF_API_UNUSED_MEMBERS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_IDCT_XVIDMMX} -{$define FF_API_IDCT_XVIDMMX := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_INPUT_PRESERVED} -{$define FF_API_INPUT_PRESERVED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NORMALIZE_AQP} -{$define FF_API_NORMALIZE_AQP := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GMC} -{$define FF_API_GMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MV0} -{$define FF_API_MV0 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_NAME} -{$define FF_API_CODEC_NAME := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AFD} -{$define FF_API_AFD := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VISMV} -(* XXX: don't forget to drop the -vismv documentation *) -{$define FF_API_VISMV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DV_FRAME_PROFILE} -{$define FF_API_DV_FRAME_PROFILE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AUDIOENC_DELAY} -{$define FF_API_AUDIOENC_DELAY := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCTX_TIMEBASE} -{$define FF_API_AVCTX_TIMEBASE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MPV_OPT} -{$define FF_API_MPV_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STREAM_CODEC_TAG} -{$define FF_API_STREAM_CODEC_TAG := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_GET_BITS_PER_SAMPLE_FMT} -{$define FF_API_GET_BITS_PER_SAMPLE_FMT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_FIND_OPT} -{$define FF_API_FIND_OPT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OLD_AVOPTIONS} -{$define FF_API_OLD_AVOPTIONS := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT} -{$define FF_API_PIX_FMT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CONTEXT_SIZE} -{$define FF_API_CONTEXT_SIZE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT_DESC} -{$define FF_API_PIX_FMT_DESC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AV_REVERSE} -{$define FF_API_AV_REVERSE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AUDIOCONVERT} -{$define FF_API_AUDIOCONVERT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CPU_FLAG_MMX2} -{$define FF_API_CPU_FLAG_MMX2 := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO} -{$define FF_API_SAMPLES_UTILS_RETURN_ZERO := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_LLS_PRIVATE} -{$define FF_API_LLS_PRIVATE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_LLS1} -{$define FF_API_LLS1 :=(LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AVFRAME_LAVC} -{$define FF_API_AVFRAME_LAVC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT} -{$define FF_API_GET_CHANNEL_LAYOUT_COMPAT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_OPENCL} -{$define FF_API_OLD_OPENCL := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_INTFLOAT -{$define FF_API_INTFLOAT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_CONST_AVUTIL55} -{$IFDEF LIBAVUTIL_VERSION_MAJOR >= 55} - {$define FF_CONST_AVUTIL55 := const} -{$ELSE} - {$define FF_CONST_AVUTIL55} -{$ENDIF} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_LAVF_BITEXACT} -{$define FF_API_LAVF_BITEXACT := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_FRAC} -{$define FF_API_LAVF_FRAC := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_CODEC_TB} -{$define FF_API_LAVF_CODEC_TB := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_URL_FEOF} -{$define FF_API_URL_FEOF := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} -{$define FF_API_ALLOC_OUTPUT_CONTEXT := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} -{$define FF_API_FORMAT_PARAMETERS := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_NEW_STREAM} -{$define FF_API_NEW_STREAM := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_SET_PTS_INFO} -{$define FF_API_SET_PTS_INFO := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} -{$define FF_API_CLOSE_INPUT_FILE := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_READ_PACKET} -{$define FF_API_READ_PACKET := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ASS_SSA} -{$define FF_API_ASS_SSA := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** swscale FF_API defines *) -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_ARCH_BFIN} -{$define FF_API_ARCH_BFIN := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} - -{$ENDIF PASDOC} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.6/libavcodec/audioconvert.pas b/src/lib/ffmpeg-2.6/libavcodec/audioconvert.pas deleted file mode 100644 index 03e3fb10..00000000 --- a/src/lib/ffmpeg-2.6/libavcodec/audioconvert.pas +++ /dev/null @@ -1,291 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.6/libavutil/buffer.pas b/src/lib/ffmpeg-2.6/libavutil/buffer.pas deleted file mode 100644 index c1502f51..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/buffer.pas +++ /dev/null @@ -1,290 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 54.7.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Same as av_buffer_alloc(), except the returned buffer will be initialized - * to zero. - *) -function av_buffer_allocz(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferRef; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - * @see av_buffer_pool_can_uninit() - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.6/libavutil/cpu.pas b/src/lib/ffmpeg-2.6/libavutil/cpu.pas deleted file mode 100644 index 5d2e02da..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/cpu.pas +++ /dev/null @@ -1,119 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 54.7.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - AV_CPU_FLAG_ARMV8 = (1 << 6); - AV_CPU_FLAG_SETEND = (1 <<16); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.6/libavutil/dict.pas b/src/lib/ffmpeg-2.6/libavutil/dict.pas deleted file mode 100644 index a8cf4e32..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/dict.pas +++ /dev/null @@ -1,162 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 54.7.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get({const} m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, - * these arguments will be freed on error. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Convenience wrapper for av_dict_set that converts the value to a string - * and stores it. - * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. - *) -function av_dict_set_int(var pm: PAVDictionary; {const} key: PAnsiChar; - value: cint64; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; {const} src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Get dictionary entries as a string. - * - * Create a string containing dictionary's entries. - * Such string may be passed back to av_dict_parse_string(). - * @note String is escaped with backslashes ('\'). - * - * @param[in] m dictionary - * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. - * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other - * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. - *) -function av_dict_get_string({const} m: PAVDictionary; buffer: PPAnsiChar; - {const} key_val_sep: AnsiChar; {const} pairs_sep: AnsiChar): cint; - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.6/libavutil/error.pas b/src/lib/ffmpeg-2.6/libavutil/error.pas deleted file mode 100644 index 59580fab..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/error.pas +++ /dev/null @@ -1,166 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) - AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) -(* HTTP & RTSP errors *) - AVERROR_HTTP_BAD_REQUEST = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('0') shl 24)); - AVERROR_HTTP_UNAUTHORIZED = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('1') shl 24)); - AVERROR_HTTP_FORBIDDEN = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('3') shl 24)); - AVERROR_HTTP_NOT_FOUND = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('4') shl 24)); - AVERROR_HTTP_OTHER_4XX = -(ord($F8) or (ord('4') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - AVERROR_HTTP_SERVER_ERROR = -(ord($F8) or (ord('5') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-2.6/libavutil/frame.pas b/src/lib/ffmpeg-2.6/libavutil/frame.pas deleted file mode 100644 index f47f2397..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/frame.pas +++ /dev/null @@ -1,842 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 54.7.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - (** from the definitions of TAVFrame *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - AV_FRAME_FLAG_CORRUPT = (1 << 0); - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type -(* is already in pixfmt.pas - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); -*) - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO, - (** - * ReplayGain information in the form of the AVReplayGain struct. - *) - AV_FRAME_DATA_REPLAYGAIN, - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the frame for correct - * presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_FRAME_DATA_DISPLAYMATRIX, - (** - * Active Format Description data consisting of a single byte as specified - * in ETSI TS 101 154 using AVActiveFormatDescription enum. - *) - AV_FRAME_DATA_AFD, - (** - * Motion vectors exported by some codecs (on demand through the export_mvs - * flag set in the libavcodec AVCodecContext flags2 option). - * The data is the AVMotionVector struct defined in - * libavutil/motion_vector.h. - *) - AV_FRAME_DATA_MOTION_VECTORS, - (** - * Recommmends skipping the specified number of samples. This is exported - * only if the "skip_manual" AVOption is set in libavcodec. - * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_FRAME_DATA_SKIP_SAMPLES, - - (** - * This side data must be associated with an audio frame and corresponds to - * enum AVAudioServiceType defined in avcodec.h. - *) - AV_FRAME_DATA_AUDIO_SERVICE_TYPE - ); - - TAVActiveFormatDescription = ( - AV_AFD_SAME = 8, - AV_AFD_4_3 = 9, - AV_AFD_16_9 = 10, - AV_AFD_14_9 = 11, - AV_AFD_4_3_SP_14_9 = 13, - AV_AFD_16_9_SP_14_9 = 14, - AV_AFD_SP_4_3 = 15 - ); {TAVActiveFormatDescription} - - PAVFrameSideData = ^TAVFrameSideData; - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. -*) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used in order to access all channels. - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - *) - key_frame: cint; - - (** - * Picture type of the frame - *) - pict_type: TAVPictureType; - -{$IFDEF FF_API_AVFRAME_LAVC} - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; {deprecated} -{$ENDIF} - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - *) - pkt_pts: cint64; - - (** - * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) - * This is also the Presentation time of this AVFrame calculated from - * only AVPacket.dts values without pts values. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - *) - coded_picture_number: cint; - - (** - * picture number in display order - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - *) - quality: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - reference: cint; {deprecated} - - (** - * QP table - *) - qscale_table: pbyte; {deprecated} - - (** - * QP store stride - *) - qstride: cint; {deprecated} - qscale_type: cint; {deprecated} - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - *) - mbskip_table: pbyte; {deprecated} - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - *) - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - *) - mb_type: PCuint; {deprecated} - - (** - * DCT coefficients - *) - dct_coeff: PsmallInt; {deprecated} - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - *) - ref_index: array [0..1] of pbyte; {deprecated} -{$ENDIF} - - (** - * for some private data of the user - *) - opaque: pointer; - - (** - * error - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - type_: cint; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - *) - palette_has_changed: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - buffer_hints: cint; {deprecated} - (** - * Pan scan. - *) - pan_scan: PAVPanScan; {deprecated} -{$ENDIF} - - (** - * reordered opaque 64bit (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - *) - reordered_opaque: cint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - (** - * @deprecated this field is unused - *) - hwaccel_picture_private: pointer; {deprecated} - owner: pointer; {deprecated} (** Note: Should be a PAVCodecContext, but a type pointer is used to avoid a reference problem. *) - thread_opaque: pointer; {deprecated} - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - *) - motion_subsample_log2: cuint8; {deprecated} -{$ENDIF} - - (** - * Sample rate of the audio data. - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. This array - * must be filled contiguously -- if buf[i] is non-NULL then buf[j] must - * also be non-NULL for all j < i. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * Flags describing additional frame properties. - * - * @ - *) - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - color_primaries: TAVColorPrimaries; - - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - chroma_location: TAVChromaLocation; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Move everythnig contained in src to dst and reset src. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - -(** - * If side data of the supplied type exists in the frame, free it and remove it - * from the frame. - *) -procedure av_frame_remove_side_data(frame: PAVFrame; type_: TAVFrameSideDataType); - cdecl; external av__codec; - -(** - * @return a string identifying the side data type - *) -function av_frame_side_data_name(type_: TAVFrameSideDataType): PAnsiChar; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-2.6/libavutil/log.pas b/src/lib/ffmpeg-2.6/libavutil/log.pas deleted file mode 100644 index d0854c31..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/log.pas +++ /dev/null @@ -1,530 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * log - *) - -type - (* from opt.h *) - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_DICT, - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is inteded for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, - AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, - AV_CLASS_CATEGORY_DEVICE_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_INPUT, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(* -#define AV_IS_INPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) - -#define AV_IS_OUTPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -*) - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - (** - * Value range. - * For string ranges this represents the min/max length. - * For dimensions this represents the min/max pixel count or width/height in multi-component case. - *) - value_min, value_max: cdouble; - (** - * Value's component range. - * For string this represents the unicode range for chars, 0-127 limits to ASCII. - *) - component_min, component_max: cdouble; - (** - * Range flag. - * If set to 1 the struct encodes a range, if set to 0 a single value. - *) - is_range: cint; - end; - - (** - * List of AVOptionRange structs. - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - (** - * Array of option ranges. - * - * Most of option types use just one component. - * Following describes multi-component option types: - * - * AV_OPT_TYPE_IMAGE_SIZE: - * component index 0: range of pixel count (width * height). - * component index 1: range of width. - * component index 2: range of height. - * - * @note To obtain multi-component version of this structure, user must - * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or - * av_opt_query_ranges_default function. - * - * Multi-component range can be read as in following example: - * - * @code - * int range_index, component_index; - * AVOptionRanges *ranges; - * AVOptionRange *range[3]; //may require more than 3 in the future. - * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); - * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { - * for (component_index = 0; component_index < ranges->nb_components; component_index++) - * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; - * //do something with range here. - * } - * av_opt_freep_ranges(&ranges); - * @endcode - *) - range: PPAVOptionRange; - (** - * Number of ranges per component. - *) - nb_ranges: cint; - (** - * Number of componentes. - *) - nb_components: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Sets additional colors for extended debugging sessions. - * @code - av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); - @endcode - * Requires 256color terminal support. Uses outside debugging is not - * recommended. - *) -{** to be translated if needed - AV_LOG_C(x) (x << 8) -**} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formated line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * av_dlog macros - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) - -const -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) - AV_LOG_SKIP_REPEATED = 1; - -(** - * Include the log severity in messages originating from codecs. - * - * Results in messages such as: - * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts - *) - AV_LOG_PRINT_LEVEL = 2; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; - -function av_log_get_flags: cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.6/libavutil/mathematics.pas b/src/lib/ffmpeg-2.6/libavutil/mathematics.pas deleted file mode 100644 index 1025bbf3..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/mathematics.pas +++ /dev/null @@ -1,144 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 54.7.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a, b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a, b, modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timebase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timebase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function guarantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.6/libavutil/mem.pas b/src/lib/ffmpeg-2.6/libavutil/mem.pas deleted file mode 100644 index 43a38e4d..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/mem.pas +++ /dev/null @@ -1,353 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of size * nmemb bytes with av_malloc(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param size Size in bytes of the memory block to be allocated or - * reallocated. - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate a block of memory. - * If *ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param size Size in bytes for the memory block to be allocated or - * reallocated - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_reallocp(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array through a pointer to a pointer. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate a block of size * nmemb bytes with av_mallocz(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a substring of the string s. - * @param s string to be duplicated - * @param len the maximum length of the resulting string (not counting the - * terminating byte). - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strndup({const} s: PAnsiChar; len: size_t): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @note passing a pointer to a NULL pointer is safe and leads to no action. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray_add_nofree(), av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * Function has the same functionality as av_dynarray_add(), - * but it doesn't free memory on fails. It returns error code - * instead and leave current buffer untouched. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @return >=0 on success, negative otherwise. - * @see av_dynarray_add(), av_dynarray2_add() - *) -function av_dynarray_add_nofree(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer): cint; - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add(), av_dynarray_add_nofree() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.6/libavutil/opt.pas b/src/lib/ffmpeg-2.6/libavutil/opt.pas deleted file mode 100644 index 485a9ff6..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/opt.pas +++ /dev/null @@ -1,542 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 54.7.100 - * - *) - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - * @deprecated use av_opt_set() - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -{$IFDEF FF_API_OLD_AVOPTIONS} -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all allocated objects in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict2(obj: pointer; var options: PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than - * one component for certain option types. - * @see AVOptionRanges for details. - *) - AV_OPT_MULTI_COMPONENT_RANGE = 1000; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * @note Any old dictionary present is discarded and replaced with a copy of the new one. The - * caller still owns val is and responsible for freeing it. - *) -function av_opt_set_dict_val(obj: pointer; name: {const} PAnsiChar; val: {const} PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @param[out] out_val The returned dictionary is a copy of the actual value and must - * be freed with av_dict_free() by the caller - *) -function av_opt_get_dict_val (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: PAVDictionary): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -function av_opt_copy(dest: pointer;src: pointer): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-2.6/libavutil/pixfmt.pas b/src/lib/ffmpeg-2.6/libavutil/pixfmt.pas deleted file mode 100644 index 7709d7f7..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/pixfmt.pas +++ /dev/null @@ -1,593 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB32 palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * @note - * Make sure that all newly added big-endian formats have (pix_fmt & 1) == 1 - * and that all newly added little-endian formats have (pix_fmt & 1) == 0. - * This allows simpler detection of big vs little-endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - {$define AV_PIX_FMT_XVMC := (AV_PIX_FMT_XVMC_MPEG2_IDCT)} -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_YA8, ///< 8bit gray, 8bit alpha -(* see const declaration way down - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -*) - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - *) - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since Sat Sep 24 06:01:45 2011 +0200 (commits 9569a3c9f41387a8c7d1ce97d8693520477a66c3) - * also see Fri Nov 25 01:38:21 2011 +0100 92afb431621c79155fcb7171d26f137eb1bee028 - * Libav added them Sun Mar 16 23:05:47 2014 +0100 with incompatible values (commit 1481d24c3a0abf81e1d7a514547bd5305232be30) - *) - AV_PIX_FMT_RGBA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - - AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb - - AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef - - AV_PIX_FMT_YA16BE, ///< 16bit gray, 16bit alpha (big-endian) - AV_PIX_FMT_YA16LE, ///< 16bit gray, 16bit alpha (little-endian) - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 3 2013 (commit e6d4e687558d08187e7a415a7725e4b1a416f782) - * Libav added them Jan 14 2015 with incompatible values (commit 0e6c7dfa650e8b0497bfa7a06394b7a462ddc33a) - *) - AV_PIX_FMT_GBRAP_LIBAV, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE_LIBAV, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE_LIBAV, ///< planar GBRA 4:4:4:4 64bpp, little-endian - (** - * HW acceleration through QSV, data[3] contains a pointer to the - * mfxFrameSurface1 structure. - *) - AV_PIX_FMT_QSV, - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -const - AV_PIX_FMT_YUVA422P = AV_PIX_FMT_YUVA422P_LIBAV; - AV_PIX_FMT_YUVA444P = AV_PIX_FMT_YUVA444P_LIBAV; - AV_PIX_FMT_RGBA64BE = AV_PIX_FMT_RGBA64BE_LIBAV; - AV_PIX_FMT_RGBA64LE = AV_PIX_FMT_RGBA64LE_LIBAV; - AV_PIX_FMT_BGRA64BE = AV_PIX_FMT_BGRA64BE_LIBAV; - AV_PIX_FMT_BGRA64LE = AV_PIX_FMT_BGRA64LE_LIBAV; - AV_PIX_FMT_GBRAP = AV_PIX_FMT_GBRAP_LIBAV; - AV_PIX_FMT_GBRAP16BE = AV_PIX_FMT_GBRAP16BE_LIBAV; - AV_PIX_FMT_GBRAP16LE = AV_PIX_FMT_GBRAP16LE_LIBAV; -{$ENDIF} - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - TPixelFormat = TAVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} - -type -(** - * Chromaticity coordinates of the source primaries. - *) - TAVColorPrimaries = ( - AVCOL_PRI_RESERVED0 = 0, - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_RESERVED = 3, - AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - -(** - * Color Transfer Characteristic. - *) - TAVColorTransferCharacteristic = ( - AVCOL_TRC_RESERVED0 = 0, - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_RESERVED = 3, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * YUV colorspace type. - *) - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_RESERVED = 3, - AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - -const - AVCOL_SPC_YCGCO = AVCOL_SPC_YCOCG; - -type -(** - * MPEG vs JPEG YUV range. - *) - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * Location of chroma samples. - * - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); diff --git a/src/lib/ffmpeg-2.6/libavutil/samplefmt.pas b/src/lib/ffmpeg-2.6/libavutil/samplefmt.pas deleted file mode 100644 index b5d5bb03..00000000 --- a/src/lib/ffmpeg-2.6/libavutil/samplefmt.pas +++ /dev/null @@ -1,286 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 54.7.100 - * - *) - -type -(** - * @addtogroup lavu_audio - * @ - * - * @defgroup lavu_sampfmts Audio sample formats - * - * Audio sample format enumeration and related convenience functions. - * @ - * - *) - -(** - * Audio sample formats - * - * - The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * - The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * @par - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - * - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * @ - * - * @defgroup lavu_sampmanip Samples manipulation - * - * Functions that manipulate audio samples - * @ - *) - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.6/rational.pas b/src/lib/ffmpeg-2.6/rational.pas deleted file mode 100644 index 35ade835..00000000 --- a/src/lib/ffmpeg-2.6/rational.pas +++ /dev/null @@ -1,233 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 54.7.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-2.6/swresample.pas b/src/lib/ffmpeg-2.6/swresample.pas deleted file mode 100644 index 77d2f95e..00000000 --- a/src/lib/ffmpeg-2.6/swresample.pas +++ /dev/null @@ -1,414 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 0.18.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 1; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 1; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type -(** Dithering algorithms *) - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - -(** Resampling Engines *) - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - -(** Resampling Filter Types *) - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - -(** - * The libswresample context. Unlike libavcodec and libavformat, this structure - * is opaque. This means that if you would like to set options, you must use - * the @ref avoptions API and cannot directly set values to members of the - * structure. - *) - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * - * @param[in,out] s Swr context to initialize - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @param[in] s Swr context to check - * @see swr_init() - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - * - * @param[in] s a pointer to a pointer to Swr context - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Closes the context so that swr_is_initialized() returns 0. - * - * The context can be brought back to life by running swr_init(), - * swr_init() can also be used without swr_close(). - * This function is mainly provided for simplifying the usecase - * where one tries to support libavresample and libswresample. - * - * @param[in,out] s Swr context to be closed - *) -procedure swr_close(s: PSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space then the input will be buffered. - * You can avoid this buffering by providing more output space than input. - * Convertion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - var in_: {const} PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation ("soft" compensation). This function is - * internally called when needed in swr_next_pts(). - * - * @param[in,out] s allocated Swr context. If it is not initialized, - * or SWR_FLAG_RESAMPLE is not set, swr_init() is - * called with the flag set. - * @param[in] sample_delta delta in PTS per sample - * @param[in] compensation_distance number of samples to compensate for - * @return >= 0 on success, AVERROR error codes if: - * @li @c s is NULL, - * @li @c compensation_distance is less than 0, - * @li @c compensation_distance is 0 but sample_delta is not, - * @li compensation unsupported by resampler, or - * @li swr_init() fails when called. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param[in,out] s allocated Swr context, not yet initialized - * @param[in] channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - * - * This function, along with swr_inject_silence(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - * - * This function, along with swr_drop_output(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be: - * @li if it's set to 1 the returned delay is in seconds - * @li if it's set to 1000 the returned delay is in milliseconds - * @li if it's set to the input sample rate then the returned - * delay is in input samples - * @li if it's set to the output sample rate then the returned - * delay is in output samples - * @li if it's the least common multiple of in_sample_rate and - * out_sample_rate then an exact rounding-free delay will be - * returned - * @returns the delay in 1 / @c base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. - * - * This is useful to check if the build-time libswresample has the same version - * as the run-time one. - * - * @returns the unsigned int-typed version - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - * - * @returns the build-time @c ./configure flags - *) -function swresample_configuration(): PAnsiChar; - cdecl; external sw__resample; - -(** - * Return the swr license. - * - * @returns the license of libswresample, determined at build-time - *) -function swresample_license(): PAnsiChar; - cdecl; external sw__resample; - -implementation - -end. - diff --git a/src/lib/ffmpeg-2.6/swscale.pas b/src/lib/ffmpeg-2.6/swscale.pas deleted file mode 100644 index e50cde16..00000000 --- a/src/lib/ffmpeg-2.6/swscale.pas +++ /dev/null @@ -1,490 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 3.0.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 3; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 101; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} -{$define FF_API_SWS_GETCONTEXT := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IFDEF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; -{$IFDEF FF_API_ARCH_BFIN} - SWS_CPU_CAPS_BFIN = $01000000; -{$IFEND} - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: {const} PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.7/How to update the ffmpeg files.txt b/src/lib/ffmpeg-2.7/How to update the ffmpeg files.txt deleted file mode 100644 index ae65d477..00000000 --- a/src/lib/ffmpeg-2.7/How to update the ffmpeg files.txt +++ /dev/null @@ -1,20 +0,0 @@ -how to update the ffmpeg files: - -1) buffer.pas - cpu.pas - dict.pas - error.pas - frame.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas - swresample.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-2.7/ToDo.txt b/src/lib/ffmpeg-2.7/ToDo.txt deleted file mode 100644 index 44a1a058..00000000 --- a/src/lib/ffmpeg-2.7/ToDo.txt +++ /dev/null @@ -1,11 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog diff --git a/src/lib/ffmpeg-2.7/avcodec.pas b/src/lib/ffmpeg-2.7/avcodec.pas deleted file mode 100644 index bdedb4de..00000000 --- a/src/lib/ffmpeg-2.7/avcodec.pas +++ /dev/null @@ -1,6052 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 56.1.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 56; - LIBAVCODEC_MAX_VERSION_MINOR = 57; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 56; - LIBAVCODEC_MIN_VERSION_MINOR = 41; - LIBAVCODEC_MIN_VERSION_RELEASE = 100; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130_DEPRECATED, - AV_CODEC_ID_G2M_DEPRECATED, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC_DEPRECATED, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX_DEPRECATED, - AV_CODEC_ID_PAF_VIDEO_DEPRECATED, - AV_CODEC_ID_EXR_DEPRECATED, - AV_CODEC_ID_VP7_DEPRECATED, - AV_CODEC_ID_SANM_DEPRECATED, - AV_CODEC_ID_SGIRLE_DEPRECATED, - AV_CODEC_ID_MVC1_DEPRECATED, - AV_CODEC_ID_MVC2_DEPRECATED, - AV_CODEC_ID_HQX, - AV_CODEC_ID_TDSC, - AV_CODEC_ID_HQ_HQA, - -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'), - AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'), - AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'), - AV_CODEC_ID_HEVC = MKBETAG('H','2','6','5'), - AV_CODEC_ID_H265 = AV_CODEC_ID_HEVC, - AV_CODEC_ID_VP7 = MKBETAG('V','P','7','0'), - AV_CODEC_ID_APNG = MKBETAG('A','P','N','G') - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_ADPCM_VIMA = MKBETAG('V','I','M','A'), -{$IFDEF FF_API_VIMA_DECODER} - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), -{$IFEND} - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '), - AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '), - AV_CODEC_ID_ADPCM_G726LE = MKBETAG('6','2','7','G'), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, - AV_CODEC_ID_PAF_AUDIO_DEPRECATED, - AV_CODEC_ID_ON2AVC, - AV_CODEC_ID_DSS_SP, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'), - AV_CODEC_ID_DSD_LSBF = MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = MKBETAG('D','S','D','M'), - AV_CODEC_ID_DSD_LSBF_PLANAR = MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = MKBETAG('D','S','D','8'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_STL = MKBETAG('S','p','T','L'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'), - AV_CODEC_ID_TIMED_ID3 = MKBETAG('T','I','D','3'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), - AV_CODEC_ID_ADPCM_G726LE= $36323747, // MKBETAG('6','2','7','G'), - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_ASS = $41534B20, // MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_DVD_NAV = $444E4156, // MKBETAG('D','N','A','V'), - AV_CODEC_ID_DSD_LSBF_PLANAR = $44534431, // MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = $44534438, // MKBETAG('D','S','D','8'), - AV_CODEC_ID_DSD_LSBF = $4453444C, // MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = $4453444D, // MKBETAG('D','S','D','M'), - AV_CODEC_ID_ADPCM_DTK = $44544B20, // MKBETAG('D','T','K',' '), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_ADPCM_IMA_RAD = $52414420, // MKBETAG('R','A','D',' '), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SMVJPEG = $534D564A, // MKBETAG('S','M','V','J'), - AV_CODEC_ID_SNOW = $534E4F57, // MKBETAG('S','N','O','W'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_TIMED_ID3 = $54494433, // MKBETAG('T','I','D','3'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_ADPCM_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBP = $57454250, // MKBETAG('W','E','B','P'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D') - AV_CODEC_ID_EVRC = $73657663, // MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = $73736D76, // MKBETAG('s','s','m','v'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_descriptor_get() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - - (** - * MIME type(s) associated with the codec. - * May be NULL; if not, a NULL-terminated array of MIME types. - * The first item is always non-NULL and is the preferred MIME type. - *) - mime_types: PAnsiChar; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Codec supports frame reordering. That is, the coded order (the order in which - * the encoded packets are output by the encoders / stored / input to the - * decoders) may be different from the presentation order of the corresponding - * frames. - * - * For codecs that do not have this property set, PTS and DTS should always be - * equal. - *) - AV_CODEC_PROP_REORDER = 1 << 3; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - FF_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - FF_MIN_BUFFER_SIZE = 16384; - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - *) - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONINTRA= 24, ///< discard all non intra frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{ removed, kept for the moment - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -} - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = $0001; - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_OUTPUT_CORRUPT = $0008; ///< Output even those frames that might be corrupted - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. -{$IFDEF FF_API_GMC} -(** - * @deprecated use the "gmc" private option of the libxvid encoder - *) - CODEC_FLAG_GMC = $0020; ///< use GMC. -{$IFEND} -{$IFDEF FF_API_MV0} -(** - * @deprecated use the flag "mv0" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. -{$IFEND} -{$IFDEF FF_API_INPUT_PRESERVED} -(** - * @deprecated passing reference-counted frames to the encoders replaces this - * flag - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; -{$IFEND} - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random - // location instead of only at frame boundaries */ -{$IFDEF FF_API_NORMALIZE_AQP} -(** - * @deprecated use the flag "naq" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization -{$IFEND} - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - (* Fx : Flag for h263+ extra options *) - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. DEPRECATED!!!! - CODEC_FLAG2_IGNORE_CROP = $00010000; ///< Discard cropping information from SPS. - - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_SHOW_ALL = $00400000; ///< Show all frames before the first keyframe - CODEC_FLAG2_EXPORT_MVS = $10000000; ///< Export motion vectors through frame side data - CODEC_FLAG2_SKIP_MANUAL = $20000000; ///< Do not skip samples and export skip information as frame side data - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - CODEC_CAP_TRUNCATED = $0008; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = $0020; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = $0400; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = $1000; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = $2000; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = $4000; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = $8000; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = $80000000; - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note: AVPanScan is now (28/09/2014) defined in libavutil/frame.pas to workaround a reference problem *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -{$IFDEF FF_API_GET_BUFFER} - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - - FF_RC_STRATEGY_XVID = 1; - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - -{$IFDEF FF_API_AFD} - {attribute_deprecated} - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; -{$IFEND} - - FF_DEFAULT_QUANT_BIAS = 999999; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_CODER_TYPE_DEFLATE = 4; -{$ENDIF} - - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - FF_EC_FAVOR_INTER = 256; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DEBUG_PTS = $00000200; -{$ENDIF} - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; ///< only access through AVOptions from outside libavcodec - FF_DEBUG_VIS_MB_TYPE = $00004000; ///< only access through AVOptions from outside libavcodec -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - FF_DEBUG_NOMC = $01000000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; ///< detect bitstream specification deviations - AV_EF_BUFFER = 4; ///< detect improper bitstream length - AV_EF_EXPLODE = 8; ///< abort decoding on minor error detection - - AV_EF_IGNORE_ERR = 32768; ///< ignore errors and continue - AV_EF_CAREFUL = 65536; ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors - AV_EF_COMPLIANT = 131072; ///< consider all spec non compliances as errors - AV_EF_AGGRESSIVE = 262144; ///< consider things that a sane encoder should not do as an error - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DCT_INT = 2; -{$ENDIF} - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; -{$IFDEF FF_API_ARCH_SH4} - FF_IDCT_SH4 = 9; -{$ENDIF} - FF_IDCT_SIMPLEARM = 10; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_IDCT_IPP = 13; -{$ENDIF} - FF_IDCT_XVID = 14; -{$IFDEF FF_API_IDCT_XVIDMMX} - FF_IDCT_XVIDMMX = 14; -{$ENDIF} - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; -{$IFDEF FF_API_ARCH_SPARC} - FF_IDCT_SIMPLEVIS = 18; -{$ENDIF} - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - FF_IDCT_SIMPLEAUTO = 128; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_DTS_EXPRESS = 70; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 1; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 2; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - FF_PROFILE_HEVC_REXT = 4; - - FF_PROFILE_VP9_0 = 0; - FF_PROFILE_VP9_1 = 1; - FF_PROFILE_VP9_2 = 2; - FF_PROFILE_VP9_3 = 3; - - - FF_LEVEL_UNKNOWN = -99; - -type - TAVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * This side data should be associated with an audio stream and contains - * ReplayGain information in form of the AVReplayGain struct. - *9 - AV_PKT_DATA_REPLAYGAIN, - - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the decoded video frames for - * correct presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_PKT_DATA_DISPLAYMATRIX, - - (** - * This side data should be associated with a video stream and contains - * Stereoscopic 3D information in form of the AVStereo3D struct. - *) - AV_PKT_DATA_STEREO3D, - - (** - * This side data should be associated with an audio stream and corresponds - * to enum AVAudioServiceType. - *) - AV_PKT_DATA_AUDIO_SERVICE_TYPE, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE - ); - - PAVPacketSideData = ^TAVPacketSideData; - TAVPacketSideData = record - data: PByte; - size: cint; - type_: TAVPacketSideDataType; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf or destruct (deprecated) - * fields. If either is set, the packet data is dynamically allocated and is - * valid indefinitely until av_free_packet() is called (which in turn calls - * av_buffer_unref()/the destruct callback to free the data). If neither is set, - * the packet data is typically backed by some static buffer somewhere and is - * only valid for a limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideData; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; -{$IFDEF FF_API_DESTRUCT_PACKET} - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; -{$ENDIF} - - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; -{$IFDEF FF_API_CODEC_NAME} - (** - * @deprecated this field is not used for anything in libavcodec - *) - {attribute_deprecated} - codec_name: array [0..31] of AnsiChar; -{$IFEND} - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - -{$IFDEF FF_API_STREAM_CODEC_TAG} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - stream_codec_tag: cuint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * This often, but not always is the inverse of the frame rate or field rate - * for video. - * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this field is unused (see initial_padding). - * - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @note The callback may be called again immediately if initialization for - * the selected (hardware-accelerated) pixel format failed. - * @warning Behavior is undefined if the callback returns a value not - * in the fmt list of formats. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - -{$IFDEF FF_API_AFD} - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - * @deprecated Deprecated in favor of AVSideData - *) - {attribute_deprecated} - dtg_active_format: cint; -{$IFEND} - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - me_threshold: cint; - - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - mb_threshold: cint; -{$ENDIF} - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: Set by libavcodec - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - border_masking: cfloat; -{$ENDIF} - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - -{$IFDEF FF_API_UNUSED_MEMBERS} - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; {attribute_deprecated} -{$IFEND} - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - -{$IFDEF FF_API_GET_BUFFER} - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated use get_buffer2() - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated custom freeing callbacks should be set from get_buffer2() - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; {deprecated;} - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} -{$ENDIF} - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise exended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_qsquish: cfloat; - - {attribute_deprecated} - rc_qmod_amp: cfloat; - {attribute_deprecated} - rc_qmod_freq: cint; -{$ENDIF} - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_eq: {const} PAnsiChar; -{$ENDIF} - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - -{$IFDEF FF_API_MPV_OPT} - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_buffer_aggressivity: cfloat; - - {attribute_deprecated} - rc_initial_cplx: cfloat; -{$ENDIF} - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmin: cint; - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmax: cint; -{$ENDIF} - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - *) - coded_frame: PAVFrame; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - -{$IFDEF FF_API_THREAD_OPAQUE} - (** - * @deprecated this field should not be used from outside of lavc - *) - thread_opaque: pointer; -{$ENDIF} - - (** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_CODEC_PKT} - (** - * @deprecated this field is not supposed to be accessed from outside lavc - *) - pkt: PAVPacket; -{$ENDIF} - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Encoding only. Allow encoders to output packets that do not contain any - * encoded data, only side data. - * - * Some encoders need to output such packets, e.g. to update some stream - * parameters at the end of encoding. - * - * All callers are strongly recommended to set this option to 1 and update - * their code to deal with such packets, since this behaviour may become - * always enabled in the future (then this option will be deprecated and - * later removed). To avoid ABI issues when this happens, the callers should - * use AVOptions to set this field. - *) - side_data_only_packets: cint; - - (** - * Audio only. The number of "priming" samples (padding) inserted by the - * encoder at the beginning of the audio. I.e. this number of leading - * decoded samples must be discarded by the caller to get the original audio - * without leading padding. - * - * - decoding: unused - * - encoding: Set by libavcodec. The timestamps on the output packets are - * adjusted by the encoder so that they always refer to the - * first sample of the data actually contained in the packet, - * including any added padding. E.g. if the timebase is - * 1/samplerate and the timestamp of the first input sample is - * 0, the timestamp of the first output packet will be - * -initial_padding. - *) - initial_padding: cint; - - (** - * - decoding: For codecs that store a framerate value in the compressed - * bitstream, the decoder may export it here. { 0, 1} when - * unknown. - * - encoding: unused - *) - framerate: TAVRational; - - (** - * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - * - encoding: unused. - * - decoding: Set by libavcodec before calling get_format() - *) - sw_pix_fmt: TAVPixelFormat; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * Code outside libavcodec should access this field using AVOptions - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavcodec should access this field using AVOptions - * (NO direct access). - * - encoding: Set by user. - * - decoding: Set by user. - *) - dump_separator: Pcuint8; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - codec_whitelist: PAnsiChar; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they are rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - (** - * Internal codec capabilities. - * See FF_CODEC_CAP_* in internal.h - *) - caps_internal: cint; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * @defgroup lavc_hwaccel AVHWAccel - * @{ - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVHWAccel; - - (** - * Allocate a custom buffer - *) - alloc_frame: function (avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - frame_priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the ff_mpv_decode_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - decode_mb: procedure(s: PMpegEncContext); cdecl; - - (** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - *) - init: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - *) - uninit: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - *) - priv_data_size: cint; - end; {TAVHWAccel} - -const - (** - * Hardware acceleration should be used for decoding even if the codec level - * used is unknown or higher than the maximum supported level reported by the - * hardware driver. - *) - AV_HWACCEL_FLAG_IGNORE_LEVEL = (1 << 0); - - (** - * Hardware acceleration can output YUV pixel formats with a different chroma - * sampling than 4:2:0 and/or other than 8 bits per component. - *) - AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = (1 << 1); - - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct should be freed with avcodec_free_context(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Free the codec context and everything associated with it and write NULL to - * the provided pointer. - *) -procedure avcodec_free_context(var avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVFRAME_LAVC} -(** - * @deprecated use av_frame_alloc() - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; -{$ENDIF} - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - * - * @deprecated use av_frame_unref() - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - * - * @deprecated use av_frame_free() - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_decode_video2()). - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -{$IFDEF FF_API_DESTRUCT_PACKET} -(* - * Default packet destructor. - * @deprecated use the AVBuffer API instead - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_side_data_name(type_: TAVPacketSideDataType): PAnsiChar; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Convert valid timing fields (timestamps / durations) in a packet from one - * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be - * ignored. - * - * @param pkt packet on which the conversion will be performed - * @param tb_src source timebase, in which the timing fields in pkt are - * expressed - * @param tb_dst destination timebase, to which the timing fields will be - * converted - *) -procedure av_packet_rescale_ts(pkt: PAVPacket; tb_src, tb_dst: TAVRational); - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_GET_BUFFER} -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; deprecated; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame and the return value would be - * less than the packet size. In this case, avcodec_decode_audio4 has to be - * called again with an AVPacket containing the remaining data in order to - * decode the second frame, etc... Even if no frames are returned, the packet - * needs to be fed to the decoder with remaining data until it is completely - * consumed or an error occurs. - * - * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning samples. It is safe to flush even those decoders that are not - * marked with CODEC_CAP_DELAY, then no samples will be returned. - * - * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. Note that this field being set to zero - * does not mean that an error has occurred. For - * decoders with CODEC_CAP_DELAY set, no given decode - * call is guaranteed to produce a frame. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning subtitles. It is safe to flush even those decoders that are not - * marked with CODEC_CAP_DELAY, then no subtitles will be returned. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, - * must be freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - (** - * Picture number incremented in presentation or output order. - * This field may be reinitialized at the first picture of a new sequence. - * - * For example, this corresponds to H.264 PicOrderCnt. - *) - output_picture_number: cint; - - (** - * Dimensions of the decoded video intended for presentation. - *) - width: cint; - height: cint; - - (** - * Dimensions of the coded video. - *) - coded_width: cint; - coded_height: cint; - - (** - * The format of the coded data, corresponds to enum AVPixelFormat for video - * and for enum AVSampleFormat for audio. - * - * Note that a decoder can have considerable freedom in how exactly it - * decodes the data, so the format reported here might be different from the - * one returned by a decoder. - *) - format: cint; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - (* This callback never returns an error, a negative value means that - * the frame start was in a previous packet. *) - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: {const} PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_DEINTERLACE} -(** - * deinterlace - if not supported return -1 - * - * @deprecated - use yadif (in libavfilter) instead - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * @deprecated see av_get_pix_fmt_loss() - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @deprecated see av_find_best_pix_fmt_of_2() - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is available in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output output buffer is not allocated - * and the output buffer should be considered identical to the input - * buffer, or in case *poutbuf was set it points to the input buffer - * (not necessarily to its starting address). - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: {const} PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: {const} PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. The "mutex" argument to the function points - * to a (void * ) where the lockmgr should store/get a pointer to a user - * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the - * value left by the last call for all other ops. If the lock manager is - * unable to perform the op then it should leave the mutex in the same - * state as when it was called and return a non-zero value. However, - * when called with AV_LOCK_DESTROY the mutex will always be assumed to - * have been successfully destroyed. If av_lockmgr_register succeeds - * it will return a non-negative value, if it fails it will return a - * negative value and destroy all mutex and unregister all callbacks. - * av_lockmgr_register is not thread-safe, it must be called from a - * single thread before any calls which make use of locking are used. - * - * @param cb User defined callback. av_lockmgr_register invokes calls - * to this callback and the previously registered callback. - * The callback will be used to create more than one mutex - * each of which must be backed by its own underlying locking - * mechanism (i.e. do not use a single static object to - * implement your lock manager). If cb is set to NULL the - * lockmgr will be unregistered. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-2.7/avformat.pas b/src/lib/ffmpeg-2.7/avformat.pas deleted file mode 100644 index 60046791..00000000 --- a/src/lib/ffmpeg-2.7/avformat.pas +++ /dev/null @@ -1,2968 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 56.4.101 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 2.4.* - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 56; - LIBAVFORMAT_MAX_VERSION_MINOR = 40; - LIBAVFORMAT_MAX_VERSION_RELEASE = 101; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 56; - LIBAVFORMAT_MIN_VERSION_MINOR = 36; - LIBAVFORMAT_MIN_VERSION_RELEASE = 100; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * It is possible to configure lavf muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @ - * - * @defgroup lavf_encoding Muxing - * @ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codec "stream codec context" information, such as the - * codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVStream.time_base "stream timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - It is advised to manually initialize only the relevant fields in - * AVCodecContext, rather than using @ref avcodec_copy_context() during - * remuxing: there is no guarantee that the codec context values remain valid - * for both input and output format contexts. - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase - * requested by the caller. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @section lavf_io_dirlist Directory listing - * The directory listing API makes it possible to list files on remote servers. - * - * Some of possible use cases: - * - an "open file" dialog to choose files from a remote location, - * - a recursive media finder providing a player with an ability to play all - * files from a given directory. - * - * @subsection lavf_io_dirlist_open Opening a directory - * At first, a directory needs to be opened by calling avio_open_dir() - * supplied with a URL and, optionally, ::AVDictionary containing - * protocol-specific parameters. The function returns zero or positive - * integer and allocates AVIODirContext on success. - * - * @code - * AVIODirContext *ctx = NULL; - * if (avio_open_dir(&ctx, "smb://example.com/some_dir", NULL) < 0) { - * fprintf(stderr, "Cannot open directory.\n"); - * abort(); - * } - * @endcode - * - * This code tries to open a sample directory using smb protocol without - * any additional parameters. - * - * @subsection lavf_io_dirlist_read Reading entries - * Each directory's entry (i.e. file, another directory, anything else - * within ::AVIODirEntryType) is represented by AVIODirEntry. - * Reading consecutive entries from an opened AVIODirContext is done by - * repeatedly calling avio_read_dir() on it. Each call returns zero or - * positive integer if successful. Reading can be stopped right after the - * NULL entry has been read -- it means there are no entries left to be - * read. The following code reads all entries from a directory associated - * with ctx and prints their names to standard output. - * @code - * AVIODirEntry *entry = NULL; - * for (;;) { - * if (avio_read_dir(ctx, &entry) < 0) { - * fprintf(stderr, "Cannot list directory.\n"); - * abort(); - * } - * if (!entry) - * break; - * printf("%s\n", entry->name); - * avio_free_directory_entry(&entry); - * } - * @endcode - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -//type - -(* - * @defgroup metadata_api Public Metadata API - * @ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @ - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_LAVF_FRAC} -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; -{$ENDIF} - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - {const} mime_type: PAnsiChar; (**< mime_type, when known. *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MIME = 75; ///< score for file mime type - AVPROBE_SCORE_MAX = 100; ///< maximum score - - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_FLUSH_PACKETS = $0200; ///< Flush the AVIOContext every packet. -(** - * When muxing, try to avoid writing any random/volatile data to the output. - * This includes any random IDs, real-time timestamps/dates, muxer version, etc. - * - * This flag is mainly intended for testing. - *) - AVFMT_FLAG_BITEXACT = $0400; - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - AVFMT_FLAG_FAST_SEEK = $80000; ///< Enable fast, but inaccurate seeks for some formats - - // used by AVStream - AVSTREAM_EVENT_FLAG_METADATA_UPDATED = $0001; ///< The call resulted in updated metadata. - MAX_STD_TIMEBASES = (60*12+6); - MAX_PROBE_PACKETS = 2500; - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - AVFMT_EVENT_FLAG_METADATA_UPDATED = 0001; ///< The call resulted in updated metadata. - - RAW_PACKET_BUFFER_SIZE = 2500000; - - AVFMT_AVOID_NEG_TS_AUTO = -1; ///< Enabled when required by target format - AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 1; ///< Shift timestamps so they are non negative - AVFMT_AVOID_NEG_TS_MAKE_ZERO = 2; ///< Shift timestamps so that they start at 0 - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - - PAVDeviceCapabilitiesQuery = ^TAVDeviceCapabilitiesQuery; - TAVDeviceCapabilitiesQuery = record - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - data_codec: TAVCodecID; (**< default data codec *) - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (** - * Comma-separated list of mime types. - * It is used check for matching mime types while probing. - * @see av_probe_input_format2 - *) - mime_type: {const} PAnsiChar; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - priv_data: pointer; - -{$IFDEF FF_API_LAVF_FRAC} - (** - * @deprecated this field is unused - *) - pts: TAVFrac; {attribute_deprecated} -{$ENDIF} - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the desired timebase. In - * avformat_write_header(), the muxer will overwrite this field - * with the timebase that will actually be used for the timestamps - * written into the file (which may or may not be related to the - * user-provided one, depending on the format). - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - * - * - demuxing: May be set by libavformat when creating the stream or in - * avformat_find_stream_info(). - * - muxing: May be set by the caller before avformat_write_header(). - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (** - * An array of side data that applies to the whole stream (i.e. the - * container does not allow it to change between packets). - * - * There may be no overlap between the side data in this array and side data - * in the packets. I.e. a given side data is either exported by the muxer - * (demuxing) / set by the caller (muxing) in this array, then it never - * appears in the packets, or the side data is exported / sent through - * the packets (always in the first packet where the value becomes known or - * changes), then it does not appear in this array. - * - * - demuxing: Set by libavformat when the stream is created. - * - muxing: May be set by the caller before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - * - * @see av_format_inject_global_side_data() - *) - side_data: PAVPacketSideData; - - (** - * The number of elements in the AVStream.side_data array. - *) - nb_side_data: cint; - - (** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. - *) - event_flags: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * If not 0, the number of samples that should be skipped from the start of - * the stream (the samples are removed from packets with pts==0, which also - * assumes negative timestamps do not happen). - * Intended for use with formats such as mp3 with ad-hoc gapless audio - * support. - *) - start_skip_samples: cint64; - - (** - * If not 0, the first audio sample that should be discarded from the stream. - * This is broken by design (needs global sample count), but can't be - * avoided for broken by design formats such as mp3 with ad-hoc gapless - * audio support. - *) - first_discard_sample: cint64; - - (** - * The sample after last sample that is intended to be discarded after - * first_discard_sample. Works on frame boundaries only. Used to prevent - * early EOF if the gapless info is broken (considered concatenated mp3s). - *) - last_discard_sample: cint64; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - (** - * Internal data to inject global side data - *) - inject_global_side_data: cint; - - (** - * String containing paris of key and values describing recommended encoder configuration. - * Paris are separated by ','. - * Keys are separated from values by '='. - *) - recommended_encoder_configuration: PAnsiChar; - - (** - * display aspect ratio (0 if unknown) - * - encoding: unused - * - decoding: Set by libavformat to calculate sample_aspect_ratio internally - *) - display_aspect_ratio: TAVRational; - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - TAVOpenCallback = function (s: PAVFormatContext; pb: PPAVIOContext; url: {const} PAnsiChar; flags: cint; - int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - (** - * Flags signalling stream properties. A combination of AVFMTCTX_*. - * Set by libavformat. - *) - ctx_flags: cint; - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - (** - * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. - * Set by the user before avformat_open_input() / avformat_write_header(). - *) - flags: cint; - - (** - * @deprecated deprecated in favor of probesize2 - *) - probesize: cuint; - - (** - * @deprecated deprecated in favor of max_analyze_duration2 - *) - max_analyze_duration: cint; {attribute_deprecated} - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * - muxing: Set by the caller before avformat_write_header(). If set to - * either 0 or AV_NOPTS_VALUE, then the current wall-time will - * be used. - * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that - * the value may become known after some number of frames - * have been received. - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Allow non-standard and experimental extension - * @see AVCodecContext.strict_std_compliance - *) - strict_std_compliance: cint; - - (** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. - *) - event_flags: cint; - - (** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - *) - max_ts_probe: cint; - - (** - * Avoid negative timestamps during muxing. - * Any value of the AVFMT_AVOID_NEG_TS_* constants. - * Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) - * - muxing: Set by user - * - demuxing: unused - *) - avoid_negative_ts: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cint64; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (** - * format probing score. - * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes - * the format. - * - encoding: unused - * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) - *) - probe_score: cint; - - (** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - format_probesize: cint; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (** - * ',' separated list of allowed demuxers. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - format_whitelist: PAnsiChar; - - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_video_codec (NO direct access). - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). - *) - subtitle_codec: PAVCodec; - - (** - * Forced data codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_data_codec (NO direct access). - *) - data_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - * Mostly usable with control_message_cb or any future callbacks in device's context. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user via AVOptions (NO direct access) - *) - output_ts_offset: cint64; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info() - * via AVOptions (NO direct access). - * Can be set to 0 to let avformat choose using a heuristic. - *) - max_analyze_duration2: cint64; - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input() - * via AVOptions (NO direct access). - *) - probesize2: cint64; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavformat should access this field using AVOptions - * (NO direct access). - * - muxing: Set by user. - * - demuxing: Set by user. - *) - dump_separator: Pcuint8; - - (** - * Forced Data codec_id. - * Demuxing: Set by user. - *) - data_codec_id: TAVCodecID; - - (** - * Called to open further IO contexts when needed for demuxing. - * - * This can be set by the user application to perform security checks on - * the URLs before opening them. - * The function should behave like avio_open2(), AVFormatContext is provided - * as contextual information and to reach AVFormatContext.opaque. - * - * If NULL then some simple checks are used together with avio_open2(). - * - * Must not be accessed directly from outside avformat. - * @See av_format_set_open_cb() - * - * Demuxing: Set by user. - *) - open_cb: function(s: PAVFormatContext; p: PPAVIOContext; url: {const} PAnsiChar; flags: cint; int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; - end; (** TAVFormatContext **) - -function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_data_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_data_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; -procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; -procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; -function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; -procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; -function av_format_get_open_cb(s: {const} PAVFormatContext): TAVOpenCallback; - cdecl; external av__format; -procedure av_format_set_open_cb(s: PAVFormatContext; callback: TAVOpenCallback); - cdecl; external av__format; - -(** - * This function will cause global side data to be injected in the next packet - * of each stream as well as after any subsequent seek. - *) -procedure av_format_inject_global_side_data(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; -function av_stream_get_parser(s: {const} PAVStream): PAVCodecParserContext; - cdecl; external av__format; -function av_stream_get_recommended_encoder_configuration({const} s: PAVStream): PAnsiChar; - cdecl; external av__format; -procedure av_stream_set_recommended_encoder_configuration(s: PAVStream; configuration: PAnsiChar); - cdecl; external av__format; - -(** - * Returns the pts of the last muxed packet + its duration - * - * the retuned value is undefined when used with a demuxer. - *) -function av_stream_get_end_pts(st: {const} PAVStream): cint64; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: {const} PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: {const} PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -(** - * Get side information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_stream_get_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Discard all internally buffered data. This can be useful when dealing with - * discontinuities in the byte stream. Generally works only with formats that - * can resync. This includes headerless formats like MPEG-TS/TS but should also - * work with NUT, Ogg and in a limited way AVI for example. - * - * The set of streams, the detected duration, stream parameters and codecs do - * not change when calling this function. If you want a complete reset, it's - * better to open a new AVFormatContext. - * - * This does not flush the AVIOContext (s->pb). If necessary, call - * avio_flush(s->pb) before calling this function. - * - * @param s media file handle - * @return >=0 on success, error code otherwise - *) -function avformat_flush(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * If the muxer supports it, this function makes it possible to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: {const} PAVPacket; dump_payload: cint; st: {const} PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: {const} PAVPacket; dump_payload: cint; - st: {const} PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - url: {const} PAnsiChar); - cdecl; external av__format; - -(** - * Print detailed information about the input or output format, such as - * duration, bitrate, streams, container, programs, metadata, side data, - * codec and time base. - * - * @param ic the context to analyze - * @param index index of the stream to dump information about - * @param url the URL to print, such as source or destination file - * @param is_output Select whether the specified context is an input(0) or output(1) - *) -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: {const} PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: {const} PAVOutputFormat; codec_id: TAVCodecID; - std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.7/avio.pas b/src/lib/ffmpeg-2.7/avio.pas deleted file mode 100644 index ae9dd5ef..00000000 --- a/src/lib/ffmpeg-2.7/avio.pas +++ /dev/null @@ -1,744 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 56.4.101 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - - (** - * Directory entry types. - *) - TAVIODirEntryType = ( - AVIO_ENTRY_UNKNOWN, - AVIO_ENTRY_BLOCK_DEVICE, - AVIO_ENTRY_CHARACTER_DEVICE, - AVIO_ENTRY_DIRECTORY, - AVIO_ENTRY_NAMED_PIPE, - AVIO_ENTRY_SYMBOLIC_LINK, - AVIO_ENTRY_SOCKET, - AVIO_ENTRY_FILE, - AVIO_ENTRY_SERVER, - AVIO_ENTRY_SHARE, - AVIO_ENTRY_WORKGROUP - ); - - - (** - * Describes single entry of the directory. - * - * Only name and type fields are guaranteed be set. - * Rest of fields are protocol or/and platform dependent and might be unknown. - *) - PPAVIODirEntry = ^PAVIODirEntry; - PAVIODirEntry = ^TAVIODirEntry; - TAVIODirEntry = record - name: PAnsiChar; (**< Filename *) - type_: cint; (**< Type of the entry *) - utf8: cint; (**< Set to 1 when name is encoded with UTF-8, 0 otherwise. - Name can be encoded with UTF-8 even though 0 is set. *) - size: cint64; (**< File size in bytes, -1 if unknown. *) - modification_timestamp: cint64; (**< Time of last modification in microseconds since unix - epoch, -1 if unknown. *) - access_timestamp: cint64; (**< Time of last access in microseconds since unix epoch, - -1 if unknown. *) - status_change_timestamp: cint64; (**< Time of last status change in microseconds since unix - epoch, -1 if unknown. *) - user_id: cint64; (**< User ID of owner, -1 if unknown. *) - group_id: cint64; (**< Group ID of owner, -1 if unknown. *) - filemode: cint64; (**< Unix file mode, -1 if unknown. *) - end; - - PPAVIODirContext = ^PAVIODirContext; - PAVIODirContext = ^TAVIODirContext; - TAVIODirContext = record - url_context: pointer; - (** struct URLContext *url_context; *) - end; - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - - (** - * Original buffer size - * used internally after probing and ensure seekback to reset the buffer size - * This field is internal to libavformat and access from outside is not allowed. - *) - orig_buffer_size: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Open directory for reading. - * - * @param s directory read context. Pointer to a NULL pointer must be passed. - * @param url directory to be listed. - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dictionary - * containing options that were not found. May be NULL. - * @return >=0 on success or negative on error. - *) -function avio_open_dir(s: PPAVIODirContext; url: {const} PAnsiChar; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Get next directory entry. - * - * Returned entry must be freed with avio_free_directory_entry(). In particular - * it may outlive AVIODirContext. - * - * @param s directory read context. - * @param[out] next next entry or NULL when no more entries. - * @return >=0 on success or negative on error. End of list is not considered an - * error. - *) -function avio_read_dir(s: PAVIODirContext; next: PPAVIODirEntry): cint; - cdecl; external av__format; - -(** - * Close directory. - * - * @note Entries created using avio_read_dir() are not deleted and must be - * freeded with avio_free_directory_entry(). - * - * @param s directory read context. - * @return >=0 on success or negative on error. - *) -function avio_close_dir(s: PPAVIODirContext): cint; - cdecl; external av__format; - -(** - * Free entry allocated by avio_read_dir(). - * - * @param entry entry to be freed. - *) -procedure avio_free_directory_entry(entry: PPAVIODirEntry); - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * It may be freed and replaced with a new buffer by libavformat. - * AVIOContext.buffer holds the buffer currently in use, - * which must be later freed with av_free(). - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16BE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16be(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const -(** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function avio_feof(s: PAVIOContext): cint; - cdecl; external av__format; -{$IFDEF FF_API_URL_FEOF} -(** - * @deprecated use avio_feof() - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; {attribute_deprecated} -{$ENDIF} - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data. - * - * For write streams, force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - * - * For read streams, discard all currently buffered data, and advance the - * reported file position to that of the underlying stream. This does not - * read new data, and does not perform any seeks. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -(* Avoid a warning. The header can not be included because it breaks c++. *) -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; - -(** - * Read contents of h into print buffer, up to max_size bytes, or up to EOF. - * - * @return 0 for success (max_size bytes read or EOF reached), negative error - * code otherwise - *) -function avio_read_to_bprint(h: PAVIOContext; pb: PAVBPrint; max_size: size_t): cint; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-2.7/avutil.pas b/src/lib/ffmpeg-2.7/avutil.pas deleted file mode 100644 index 94b5220e..00000000 --- a/src/lib/ffmpeg-2.7/avutil.pas +++ /dev/null @@ -1,353 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 54.7.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 54; - LIBAVUTIL_MAX_VERSION_MINOR = 30; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 54; - LIBAVUTIL_MIN_VERSION_MINOR = 27; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -(** - * Return the fractional representation of the internal time base. - *) -function av_get_time_base_q: TAVRational; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-2.7/ff_api-defines.inc b/src/lib/ffmpeg-2.7/ff_api-defines.inc deleted file mode 100644 index e66a59a6..00000000 --- a/src/lib/ffmpeg-2.7/ff_api-defines.inc +++ /dev/null @@ -1,272 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_VIMA_DECODER} -{$define FF_API_VIMA_DECODER := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEINTERLACE} -{$define FF_API_DEINTERLACE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DESTRUCT_PACKET} -{$define FF_API_DESTRUCT_PACKET := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GET_BUFFER} -{$define FF_API_GET_BUFFER := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_THREAD_OPAQUE} -{$define FF_API_THREAD_OPAQUE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_PKT} -{$define FF_API_CODEC_PKT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_SH4} -{$define FF_API_ARCH_SH4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_SPARC} -{$define FF_API_ARCH_SPARC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_UNUSED_MEMBERS} -{$define FF_API_UNUSED_MEMBERS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_IDCT_XVIDMMX} -{$define FF_API_IDCT_XVIDMMX := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_INPUT_PRESERVED} -{$define FF_API_INPUT_PRESERVED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NORMALIZE_AQP} -{$define FF_API_NORMALIZE_AQP := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GMC} -{$define FF_API_GMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MV0} -{$define FF_API_MV0 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_NAME} -{$define FF_API_CODEC_NAME := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AFD} -{$define FF_API_AFD := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VISMV} -(* XXX: don't forget to drop the -vismv documentation *) -{$define FF_API_VISMV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DV_FRAME_PROFILE} -{$define FF_API_DV_FRAME_PROFILE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AUDIOENC_DELAY} -{$define FF_API_AUDIOENC_DELAY := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCTX_TIMEBASE} -{$define FF_API_AVCTX_TIMEBASE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MPV_OPT} -{$define FF_API_MPV_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STREAM_CODEC_TAG} -{$define FF_API_STREAM_CODEC_TAG := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_GET_BITS_PER_SAMPLE_FMT} -{$define FF_API_GET_BITS_PER_SAMPLE_FMT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_FIND_OPT} -{$define FF_API_FIND_OPT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OLD_AVOPTIONS} -{$define FF_API_OLD_AVOPTIONS := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT} -{$define FF_API_PIX_FMT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CONTEXT_SIZE} -{$define FF_API_CONTEXT_SIZE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT_DESC} -{$define FF_API_PIX_FMT_DESC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AV_REVERSE} -{$define FF_API_AV_REVERSE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AUDIOCONVERT} -{$define FF_API_AUDIOCONVERT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CPU_FLAG_MMX2} -{$define FF_API_CPU_FLAG_MMX2 := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO} -{$define FF_API_SAMPLES_UTILS_RETURN_ZERO := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_LLS_PRIVATE} -{$define FF_API_LLS_PRIVATE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_LLS1} -{$define FF_API_LLS1 :=(LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AVFRAME_LAVC} -{$define FF_API_AVFRAME_LAVC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT} -{$define FF_API_GET_CHANNEL_LAYOUT_COMPAT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_OPENCL} -{$define FF_API_OLD_OPENCL := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_INTFLOAT -{$define FF_API_INTFLOAT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_DLOG} -{$define FF_API_DLOG := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_CONST_AVUTIL55} -{$IFDEF LIBAVUTIL_VERSION_MAJOR >= 55} - {$define FF_CONST_AVUTIL55 := const} -{$ELSE} - {$define FF_CONST_AVUTIL55} -{$ENDIF} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_LAVF_BITEXACT} -{$define FF_API_LAVF_BITEXACT := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_FRAC} -{$define FF_API_LAVF_FRAC := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_CODEC_TB} -{$define FF_API_LAVF_CODEC_TB := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_URL_FEOF} -{$define FF_API_URL_FEOF := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ALLOC_OUTPUT_CONTEXT} -{$define FF_API_ALLOC_OUTPUT_CONTEXT := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FORMAT_PARAMETERS} -{$define FF_API_FORMAT_PARAMETERS := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_NEW_STREAM} -{$define FF_API_NEW_STREAM := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_SET_PTS_INFO} -{$define FF_API_SET_PTS_INFO := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CLOSE_INPUT_FILE} -{$define FF_API_CLOSE_INPUT_FILE := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_READ_PACKET} -{$define FF_API_READ_PACKET := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ASS_SSA} -{$define FF_API_ASS_SSA := (LIBAVFORMAT_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** swscale FF_API defines *) -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_ARCH_BFIN} -{$define FF_API_ARCH_BFIN := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} - -{$ENDIF PASDOC} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.7/libavcodec/audioconvert.pas b/src/lib/ffmpeg-2.7/libavcodec/audioconvert.pas deleted file mode 100644 index 03e3fb10..00000000 --- a/src/lib/ffmpeg-2.7/libavcodec/audioconvert.pas +++ /dev/null @@ -1,291 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.7/libavutil/buffer.pas b/src/lib/ffmpeg-2.7/libavutil/buffer.pas deleted file mode 100644 index c1502f51..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/buffer.pas +++ /dev/null @@ -1,290 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 54.7.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Same as av_buffer_alloc(), except the returned buffer will be initialized - * to zero. - *) -function av_buffer_allocz(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferRef; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - * @see av_buffer_pool_can_uninit() - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.7/libavutil/cpu.pas b/src/lib/ffmpeg-2.7/libavutil/cpu.pas deleted file mode 100644 index a05ee5bf..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/cpu.pas +++ /dev/null @@ -1,122 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 54.7.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_AVXSLOW = $8000000; ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer) - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - AV_CPU_FLAG_VSX = $0002; ///< ISA 2.06 - AV_CPU_FLAG_POWER8 = $0004; ///< ISA 2.07 - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - AV_CPU_FLAG_ARMV8 = (1 << 6); - AV_CPU_FLAG_SETEND = (1 <<16); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.7/libavutil/dict.pas b/src/lib/ffmpeg-2.7/libavutil/dict.pas deleted file mode 100644 index a8cf4e32..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/dict.pas +++ /dev/null @@ -1,162 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 54.7.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get({const} m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, - * these arguments will be freed on error. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Convenience wrapper for av_dict_set that converts the value to a string - * and stores it. - * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. - *) -function av_dict_set_int(var pm: PAVDictionary; {const} key: PAnsiChar; - value: cint64; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; {const} src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Get dictionary entries as a string. - * - * Create a string containing dictionary's entries. - * Such string may be passed back to av_dict_parse_string(). - * @note String is escaped with backslashes ('\'). - * - * @param[in] m dictionary - * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. - * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other - * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. - *) -function av_dict_get_string({const} m: PAVDictionary; buffer: PPAnsiChar; - {const} key_val_sep: AnsiChar; {const} pairs_sep: AnsiChar): cint; - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.7/libavutil/error.pas b/src/lib/ffmpeg-2.7/libavutil/error.pas deleted file mode 100644 index 59580fab..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/error.pas +++ /dev/null @@ -1,166 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) - AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) -(* HTTP & RTSP errors *) - AVERROR_HTTP_BAD_REQUEST = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('0') shl 24)); - AVERROR_HTTP_UNAUTHORIZED = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('1') shl 24)); - AVERROR_HTTP_FORBIDDEN = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('3') shl 24)); - AVERROR_HTTP_NOT_FOUND = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('4') shl 24)); - AVERROR_HTTP_OTHER_4XX = -(ord($F8) or (ord('4') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - AVERROR_HTTP_SERVER_ERROR = -(ord($F8) or (ord('5') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-2.7/libavutil/frame.pas b/src/lib/ffmpeg-2.7/libavutil/frame.pas deleted file mode 100644 index 59cabf7b..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/frame.pas +++ /dev/null @@ -1,849 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 54.7.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - (** from the definitions of TAVFrame *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - AV_FRAME_FLAG_CORRUPT = (1 << 0); - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type -(* is already in pixfmt.pas - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); -*) - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO, - (** - * ReplayGain information in the form of the AVReplayGain struct. - *) - AV_FRAME_DATA_REPLAYGAIN, - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the frame for correct - * presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_FRAME_DATA_DISPLAYMATRIX, - (** - * Active Format Description data consisting of a single byte as specified - * in ETSI TS 101 154 using AVActiveFormatDescription enum. - *) - AV_FRAME_DATA_AFD, - (** - * Motion vectors exported by some codecs (on demand through the export_mvs - * flag set in the libavcodec AVCodecContext flags2 option). - * The data is the AVMotionVector struct defined in - * libavutil/motion_vector.h. - *) - AV_FRAME_DATA_MOTION_VECTORS, - (** - * Recommmends skipping the specified number of samples. This is exported - * only if the "skip_manual" AVOption is set in libavcodec. - * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_FRAME_DATA_SKIP_SAMPLES, - - (** - * This side data must be associated with an audio frame and corresponds to - * enum AVAudioServiceType defined in avcodec.h. - *) - AV_FRAME_DATA_AUDIO_SERVICE_TYPE - ); - - TAVActiveFormatDescription = ( - AV_AFD_SAME = 8, - AV_AFD_4_3 = 9, - AV_AFD_16_9 = 10, - AV_AFD_14_9 = 11, - AV_AFD_4_3_SP_14_9 = 13, - AV_AFD_16_9_SP_14_9 = 14, - AV_AFD_SP_4_3 = 15 - ); {TAVActiveFormatDescription} - - PAVFrameSideData = ^TAVFrameSideData; -(** - * Structure to hold side data for an AVFrame. - * - * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - *) - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - buf: PAVBufferRef; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. -*) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used in order to access all channels. - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - *) - key_frame: cint; - - (** - * Picture type of the frame - *) - pict_type: TAVPictureType; - -{$IFDEF FF_API_AVFRAME_LAVC} - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; {deprecated} -{$ENDIF} - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - *) - pkt_pts: cint64; - - (** - * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) - * This is also the Presentation time of this AVFrame calculated from - * only AVPacket.dts values without pts values. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - *) - coded_picture_number: cint; - - (** - * picture number in display order - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - *) - quality: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - reference: cint; {deprecated} - - (** - * QP table - *) - qscale_table: pbyte; {deprecated} - - (** - * QP store stride - *) - qstride: cint; {deprecated} - qscale_type: cint; {deprecated} - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - *) - mbskip_table: pbyte; {deprecated} - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - *) - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - *) - mb_type: PCuint; {deprecated} - - (** - * DCT coefficients - *) - dct_coeff: PsmallInt; {deprecated} - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - *) - ref_index: array [0..1] of pbyte; {deprecated} -{$ENDIF} - - (** - * for some private data of the user - *) - opaque: pointer; - - (** - * error - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - type_: cint; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - *) - palette_has_changed: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - buffer_hints: cint; {deprecated} - (** - * Pan scan. - *) - pan_scan: PAVPanScan; {deprecated} -{$ENDIF} - - (** - * reordered opaque 64bit (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - *) - reordered_opaque: cint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - (** - * @deprecated this field is unused - *) - hwaccel_picture_private: pointer; {deprecated} - owner: pointer; {deprecated} (** Note: Should be a PAVCodecContext, but a type pointer is used to avoid a reference problem. *) - thread_opaque: pointer; {deprecated} - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - *) - motion_subsample_log2: cuint8; {deprecated} -{$ENDIF} - - (** - * Sample rate of the audio data. - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. This array - * must be filled contiguously -- if buf[i] is non-NULL then buf[j] must - * also be non-NULL for all j < i. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * Flags describing additional frame properties. - * - * @ - *) - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - color_primaries: TAVColorPrimaries; - - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - chroma_location: TAVChromaLocation; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Move everything contained in src to dst and reset src. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - -(** - * If side data of the supplied type exists in the frame, free it and remove it - * from the frame. - *) -procedure av_frame_remove_side_data(frame: PAVFrame; type_: TAVFrameSideDataType); - cdecl; external av__codec; - -(** - * @return a string identifying the side data type - *) -function av_frame_side_data_name(type_: TAVFrameSideDataType): PAnsiChar; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-2.7/libavutil/log.pas b/src/lib/ffmpeg-2.7/libavutil/log.pas deleted file mode 100644 index ea33ae43..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/log.pas +++ /dev/null @@ -1,538 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * log - *) - -type - (* from opt.h *) - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_DICT, - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is inteded for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, - AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, - AV_CLASS_CATEGORY_DEVICE_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_INPUT, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(* -#define AV_IS_INPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) - -#define AV_IS_OUTPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -*) - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - (** - * Value range. - * For string ranges this represents the min/max length. - * For dimensions this represents the min/max pixel count or width/height in multi-component case. - *) - value_min, value_max: cdouble; - (** - * Value's component range. - * For string this represents the unicode range for chars, 0-127 limits to ASCII. - *) - component_min, component_max: cdouble; - (** - * Range flag. - * If set to 1 the struct encodes a range, if set to 0 a single value. - *) - is_range: cint; - end; - - (** - * List of AVOptionRange structs. - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - (** - * Array of option ranges. - * - * Most of option types use just one component. - * Following describes multi-component option types: - * - * AV_OPT_TYPE_IMAGE_SIZE: - * component index 0: range of pixel count (width * height). - * component index 1: range of width. - * component index 2: range of height. - * - * @note To obtain multi-component version of this structure, user must - * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or - * av_opt_query_ranges_default function. - * - * Multi-component range can be read as in following example: - * - * @code - * int range_index, component_index; - * AVOptionRanges *ranges; - * AVOptionRange *range[3]; //may require more than 3 in the future. - * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); - * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { - * for (component_index = 0; component_index < ranges->nb_components; component_index++) - * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; - * //do something with range here. - * } - * av_opt_freep_ranges(&ranges); - * @endcode - *) - range: PPAVOptionRange; - (** - * Number of ranges per component. - *) - nb_ranges: cint; - (** - * Number of componentes. - *) - nb_components: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Extremely verbose debugging, useful for libav* development. - *) - AV_LOG_TRACE = 56; - -(** - * Sets additional colors for extended debugging sessions. - * @code - av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); - @endcode - * Requires 256color terminal support. Uses outside debugging is not - * recommended. - *) -{** to be translated if needed - AV_LOG_C(x) (x << 8) -**} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct or NULL if general log. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formatted line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -{$IFDEF FF_API_DLOG} -(** - * av_dlog macros - * @deprecated unused - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) -{$ENDIF} //FF_API_DLOG - -const -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) - AV_LOG_SKIP_REPEATED = 1; - -(** - * Include the log severity in messages originating from codecs. - * - * Results in messages such as: - * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts - *) - AV_LOG_PRINT_LEVEL = 2; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; - -function av_log_get_flags: cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.7/libavutil/mathematics.pas b/src/lib/ffmpeg-2.7/libavutil/mathematics.pas deleted file mode 100644 index 1025bbf3..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/mathematics.pas +++ /dev/null @@ -1,144 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 54.7.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a, b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a, b, modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timebase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timebase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function guarantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.7/libavutil/mem.pas b/src/lib/ffmpeg-2.7/libavutil/mem.pas deleted file mode 100644 index 43a38e4d..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/mem.pas +++ /dev/null @@ -1,353 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of size * nmemb bytes with av_malloc(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param size Size in bytes of the memory block to be allocated or - * reallocated. - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate a block of memory. - * If *ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param size Size in bytes for the memory block to be allocated or - * reallocated - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_reallocp(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array through a pointer to a pointer. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate a block of size * nmemb bytes with av_mallocz(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a substring of the string s. - * @param s string to be duplicated - * @param len the maximum length of the resulting string (not counting the - * terminating byte). - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strndup({const} s: PAnsiChar; len: size_t): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @note passing a pointer to a NULL pointer is safe and leads to no action. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray_add_nofree(), av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * Function has the same functionality as av_dynarray_add(), - * but it doesn't free memory on fails. It returns error code - * instead and leave current buffer untouched. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @return >=0 on success, negative otherwise. - * @see av_dynarray_add(), av_dynarray2_add() - *) -function av_dynarray_add_nofree(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer): cint; - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add(), av_dynarray_add_nofree() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.7/libavutil/opt.pas b/src/lib/ffmpeg-2.7/libavutil/opt.pas deleted file mode 100644 index 485a9ff6..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/opt.pas +++ /dev/null @@ -1,542 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 54.7.100 - * - *) - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - * @deprecated use av_opt_set() - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -{$IFDEF FF_API_OLD_AVOPTIONS} -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all allocated objects in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict2(obj: pointer; var options: PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than - * one component for certain option types. - * @see AVOptionRanges for details. - *) - AV_OPT_MULTI_COMPONENT_RANGE = 1000; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * @note Any old dictionary present is discarded and replaced with a copy of the new one. The - * caller still owns val is and responsible for freeing it. - *) -function av_opt_set_dict_val(obj: pointer; name: {const} PAnsiChar; val: {const} PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @param[out] out_val The returned dictionary is a copy of the actual value and must - * be freed with av_dict_free() by the caller - *) -function av_opt_get_dict_val (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: PAVDictionary): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -function av_opt_copy(dest: pointer;src: pointer): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-2.7/libavutil/pixfmt.pas b/src/lib/ffmpeg-2.7/libavutil/pixfmt.pas deleted file mode 100644 index cca4d6a0..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/pixfmt.pas +++ /dev/null @@ -1,612 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB32 palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with AV_PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - {$define AV_PIX_FMT_XVMC := (AV_PIX_FMT_XVMC_MPEG2_IDCT)} -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_YA8, ///< 8bit gray, 8bit alpha -(* see const declaration way down - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -*) - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - *) - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since Sat Sep 24 06:01:45 2011 +0200 (commits 9569a3c9f41387a8c7d1ce97d8693520477a66c3) - * also see Fri Nov 25 01:38:21 2011 +0100 92afb431621c79155fcb7171d26f137eb1bee028 - * Libav added them Sun Mar 16 23:05:47 2014 +0100 with incompatible values (commit 1481d24c3a0abf81e1d7a514547bd5305232be30) - *) - AV_PIX_FMT_RGBA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - - AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb - - AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef - - AV_PIX_FMT_YA16BE, ///< 16bit gray, 16bit alpha (big-endian) - AV_PIX_FMT_YA16LE, ///< 16bit gray, 16bit alpha (little-endian) - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 3 2013 (commit e6d4e687558d08187e7a415a7725e4b1a416f782) - * Libav added them Jan 14 2015 with incompatible values (commit 0e6c7dfa650e8b0497bfa7a06394b7a462ddc33a) - *) - AV_PIX_FMT_GBRAP_LIBAV, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE_LIBAV, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE_LIBAV, ///< planar GBRA 4:4:4:4 64bpp, little-endian - (** - * HW acceleration through QSV, data[3] contains a pointer to the - * mfxFrameSurface1 structure. - *) - AV_PIX_FMT_QSV, - (** - * HW acceleration though MMAL, data[3] contains a pointer to the - * MMAL_BUFFER_HEADER_T structure. - *) - AV_PIX_FMT_MMAL, - - AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -const - AV_PIX_FMT_YUVA422P = AV_PIX_FMT_YUVA422P_LIBAV; - AV_PIX_FMT_YUVA444P = AV_PIX_FMT_YUVA444P_LIBAV; - AV_PIX_FMT_RGBA64BE = AV_PIX_FMT_RGBA64BE_LIBAV; - AV_PIX_FMT_RGBA64LE = AV_PIX_FMT_RGBA64LE_LIBAV; - AV_PIX_FMT_BGRA64BE = AV_PIX_FMT_BGRA64BE_LIBAV; - AV_PIX_FMT_BGRA64LE = AV_PIX_FMT_BGRA64LE_LIBAV; - AV_PIX_FMT_GBRAP = AV_PIX_FMT_GBRAP_LIBAV; - AV_PIX_FMT_GBRAP16BE = AV_PIX_FMT_GBRAP16BE_LIBAV; - AV_PIX_FMT_GBRAP16LE = AV_PIX_FMT_GBRAP16LE_LIBAV; -{$ENDIF} - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - TPixelFormat = TAVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} - -type -(** - * Chromaticity coordinates of the source primaries. - *) - TAVColorPrimaries = ( - AVCOL_PRI_RESERVED0 = 0, - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_RESERVED = 3, - AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - -(** - * Color Transfer Characteristic. - *) - TAVColorTransferCharacteristic = ( - AVCOL_TRC_RESERVED0 = 0, - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_RESERVED = 3, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * YUV colorspace type. - *) - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_RESERVED = 3, - AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - -const - AVCOL_SPC_YCGCO = AVCOL_SPC_YCOCG; - -type -(** - * MPEG vs JPEG YUV range. - *) - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * Location of chroma samples. - * - * Illustration showing the location of the first (top left) chroma sample of the - * image, the left shows only luma, the right - * shows the location of the chroma sample, the 2 could be imagined to overlay - * each other but are drawn separately due to limitations of ASCII - * - * 1st 2nd 1st 2nd horizontal luma sample positions - * v v v v - * ______ ______ - *1st luma line > |X X ... |3 4 X ... X are luma samples, - * | |1 2 1-6 are possible chroma positions - *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4 4:2:0, h264 default for 4:2:0 - AVCHROMA_LOC_CENTER = 2, ///< mpeg1 4:2:0, jpeg 4:2:0, h263 4:2:0 - AVCHROMA_LOC_TOPLEFT = 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); diff --git a/src/lib/ffmpeg-2.7/libavutil/samplefmt.pas b/src/lib/ffmpeg-2.7/libavutil/samplefmt.pas deleted file mode 100644 index b5d5bb03..00000000 --- a/src/lib/ffmpeg-2.7/libavutil/samplefmt.pas +++ /dev/null @@ -1,286 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 54.7.100 - * - *) - -type -(** - * @addtogroup lavu_audio - * @ - * - * @defgroup lavu_sampfmts Audio sample formats - * - * Audio sample format enumeration and related convenience functions. - * @ - * - *) - -(** - * Audio sample formats - * - * - The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * - The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * @par - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - * - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * @ - * - * @defgroup lavu_sampmanip Samples manipulation - * - * Functions that manipulate audio samples - * @ - *) - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.7/rational.pas b/src/lib/ffmpeg-2.7/rational.pas deleted file mode 100644 index 0c795c54..00000000 --- a/src/lib/ffmpeg-2.7/rational.pas +++ /dev/null @@ -1,241 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 54.7.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-2.7/swresample.pas b/src/lib/ffmpeg-2.7/swresample.pas deleted file mode 100644 index 9d3440eb..00000000 --- a/src/lib/ffmpeg-2.7/swresample.pas +++ /dev/null @@ -1,434 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 0.18.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 2; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 2; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type -(** Dithering algorithms *) - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - -(** Resampling Engines *) - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - -(** Resampling Filter Types *) - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - -(** - * The libswresample context. Unlike libavcodec and libavformat, this structure - * is opaque. This means that if you would like to set options, you must use - * the @ref avoptions API and cannot directly set values to members of the - * structure. - *) - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * - * @param[in,out] s Swr context to initialize - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @param[in] s Swr context to check - * @see swr_init() - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - * - * @param[in] s a pointer to a pointer to Swr context - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Closes the context so that swr_is_initialized() returns 0. - * - * The context can be brought back to life by running swr_init(), - * swr_init() can also be used without swr_close(). - * This function is mainly provided for simplifying the usecase - * where one tries to support libavresample and libswresample. - * - * @param[in,out] s Swr context to be closed - *) -procedure swr_close(s: PSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space, then the input will be buffered. - * You can avoid this buffering by using swr_get_out_samples() to retrieve an - * upper bound on the required number of output samples for the given number of - * input samples. Conversion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - var in_: {const} PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation ("soft" compensation). This function is - * internally called when needed in swr_next_pts(). - * - * @param[in,out] s allocated Swr context. If it is not initialized, - * or SWR_FLAG_RESAMPLE is not set, swr_init() is - * called with the flag set. - * @param[in] sample_delta delta in PTS per sample - * @param[in] compensation_distance number of samples to compensate for - * @return >= 0 on success, AVERROR error codes if: - * @li @c s is NULL, - * @li @c compensation_distance is less than 0, - * @li @c compensation_distance is 0 but sample_delta is not, - * @li compensation unsupported by resampler, or - * @li swr_init() fails when called. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param[in,out] s allocated Swr context, not yet initialized - * @param[in] channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - * - * This function, along with swr_inject_silence(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - * - * This function, along with swr_drop_output(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be: - * @li if it's set to 1 the returned delay is in seconds - * @li if it's set to 1000 the returned delay is in milliseconds - * @li if it's set to the input sample rate then the returned - * delay is in input samples - * @li if it's set to the output sample rate then the returned - * delay is in output samples - * @li if it's the least common multiple of in_sample_rate and - * out_sample_rate then an exact rounding-free delay will be - * returned - * @returns the delay in 1 / @c base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Find an upper bound on the number of samples that the next swr_convert - * call will output, if called with in_samples of input samples. This - * depends on the internal state, and anything changing the internal state - * (like further swr_convert() calls) will may change the number of samples - * swr_get_out_samples() returns for the same number of input samples. - * - * @param in_samples number of input samples. - * @note any call to swr_inject_silence(), swr_convert(), swr_next_pts() - * or swr_set_compensation() invalidates this limit - * @note it is recommended to pass the correct available buffer size - * to all functions like swr_convert() even if swr_get_out_samples() - * indicates that less would be used. - * @returns an upper bound on the number of samples that the next swr_convert - * will output or a negative value to indicate an error - *) -function swr_get_out_samples(s: PSwrContext; in_samples: cint): cint; - cdecl; external sw__resample; - -(** - * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. - * - * This is useful to check if the build-time libswresample has the same version - * as the run-time one. - * - * @returns the unsigned int-typed version - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - * - * @returns the build-time @c ./configure flags - *) -function swresample_configuration(): PAnsiChar; - cdecl; external sw__resample; - -(** - * Return the swr license. - * - * @returns the license of libswresample, determined at build-time - *) -function swresample_license(): PAnsiChar; - cdecl; external sw__resample; - -implementation - -end. - diff --git a/src/lib/ffmpeg-2.7/swscale.pas b/src/lib/ffmpeg-2.7/swscale.pas deleted file mode 100644 index e50cde16..00000000 --- a/src/lib/ffmpeg-2.7/swscale.pas +++ /dev/null @@ -1,490 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 3.0.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 3; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 101; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} -{$define FF_API_SWS_GETCONTEXT := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IFDEF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; -{$IFDEF FF_API_ARCH_BFIN} - SWS_CPU_CAPS_BFIN = $01000000; -{$IFEND} - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: {const} PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.8/How to update the ffmpeg files.txt b/src/lib/ffmpeg-2.8/How to update the ffmpeg files.txt deleted file mode 100644 index ae65d477..00000000 --- a/src/lib/ffmpeg-2.8/How to update the ffmpeg files.txt +++ /dev/null @@ -1,20 +0,0 @@ -how to update the ffmpeg files: - -1) buffer.pas - cpu.pas - dict.pas - error.pas - frame.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas - swresample.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-2.8/ToDo.txt b/src/lib/ffmpeg-2.8/ToDo.txt deleted file mode 100644 index 44a1a058..00000000 --- a/src/lib/ffmpeg-2.8/ToDo.txt +++ /dev/null @@ -1,11 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog diff --git a/src/lib/ffmpeg-2.8/avcodec.pas b/src/lib/ffmpeg-2.8/avcodec.pas deleted file mode 100644 index a0f5c21b..00000000 --- a/src/lib/ffmpeg-2.8/avcodec.pas +++ /dev/null @@ -1,6364 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 56.1.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 56; - LIBAVCODEC_MAX_VERSION_MINOR = 99; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 56; - LIBAVCODEC_MIN_VERSION_MINOR = 60; - LIBAVCODEC_MIN_VERSION_RELEASE = 100; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec. - * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts. - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130_DEPRECATED, - AV_CODEC_ID_G2M_DEPRECATED, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC_DEPRECATED, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX_DEPRECATED, - AV_CODEC_ID_PAF_VIDEO_DEPRECATED, - AV_CODEC_ID_EXR_DEPRECATED, - AV_CODEC_ID_VP7_DEPRECATED, - AV_CODEC_ID_SANM_DEPRECATED, - AV_CODEC_ID_SGIRLE_DEPRECATED, - AV_CODEC_ID_MVC1_DEPRECATED, - AV_CODEC_ID_MVC2_DEPRECATED, - AV_CODEC_ID_HQX, - AV_CODEC_ID_TDSC, - AV_CODEC_ID_HQ_HQA, - AV_CODEC_ID_HAP, - AV_CODEC_ID_DDS, - -(** see below. they need to be hard coded. - AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), - AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'), - AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - - AV_CODEC_ID_012V = MKBETAG('0','1','2','V'), - AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'), - AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'), - AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'), - AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'), - AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'), - AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'), - AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'), - AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'), - AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'), - AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'), - AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'), - AV_CODEC_ID_HEVC = MKBETAG('H','2','6','5'), - AV_CODEC_ID_H265 = AV_CODEC_ID_HEVC, - AV_CODEC_ID_VP7 = MKBETAG('V','P','7','0'), - AV_CODEC_ID_APNG = MKBETAG('A','P','N','G') - *) - //* various PCM "codecs" */ -// AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, - AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED, - AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED, - AV_CODEC_ID_PCM_S16BE_PLANAR_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'), - AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16), - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA_DEPRECATED, -(** see below. they need to be hard coded. - AV_CODEC_ID_ADPCM_VIMA = MKBETAG('V','I','M','A'), -{$IFDEF FF_API_VIMA_DECODER} - AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'), -{$IFEND} - AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '), - AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '), - AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '), - AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '), - AV_CODEC_ID_ADPCM_G726LE = MKBETAG('6','2','7','G'), - AV_CODEC_ID_ADPCM_THP_LE = MKBETAG('T','H','P','L'), - *) - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS_DEPRECATED, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK_DEPRECATED, - AV_CODEC_ID_PAF_AUDIO_DEPRECATED, - AV_CODEC_ID_ON2AVC, - AV_CODEC_ID_DSS_SP, -(** see below. they need to be hard coded. - AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'), - AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'), - AV_CODEC_ID_DSD_LSBF = MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = MKBETAG('D','S','D','M'), - AV_CODEC_ID_DSD_LSBF_PLANAR = MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = MKBETAG('D','S','D','8'), - AV_CODEC_ID_4GV = MKBETAG('s','4','g','v'), - *) - - //* subtitle codecs */ -// AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, -(** see below. they need to be hard coded. - AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - AV_CODEC_ID_STL = MKBETAG('S','p','T','L'), - AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'), - AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'), - AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'), - AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'), - AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'), - AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - AV_CODEC_ID_HDMV_TEXT_SUBTITLE = MKBETAG('B','D','T','X'), - *) - - //* other specific kind of codecs (generally used for attachments) */ -// AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, -(** see below. they need to be hard coded. - AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'), - AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'), - AV_CODEC_ID_TIMED_ID3 = MKBETAG('T','I','D','3'), - *) - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - -(** hardcoded codecs from above. pascal needs them to be ordered **) - AV_CODEC_ID_G2M = $0047324D, // MKBETAG( 0 ,'G','2','M'), - AV_CODEC_ID_IDF = $00494446, // MKBETAG( 0 ,'I','D','F'), - AV_CODEC_ID_OTF = $004F5446, // MKBETAG( 0 ,'O','T','F'), - AV_CODEC_ID_PCM_S24LE_PLANAR = $18505350, // MKBETAG(24,'P','S','P'), - AV_CODEC_ID_PCM_S32LE_PLANAR = $20505350, // MKBETAG(32,'P','S','P'), - AV_CODEC_ID_012V = $30313256, // MKBETAG('0','1','2','V'), - AV_CODEC_ID_EXR = $30455852, // MKBETAG('0','E','X','R'), - AV_CODEC_ID_ADPCM_G726LE= $36323747, // MKBETAG('6','2','7','G'), - AV_CODEC_ID_ADPCM_AFC = $41464320, // MKBETAG('A','F','C',' '), - AV_CODEC_ID_ASS = $41534B20, // MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska - AV_CODEC_ID_AVRP = $41565250, // MKBETAG('A','V','R','P'), - AV_CODEC_ID_AVRN = $4156526E, // MKBETAG('A','V','R','n'), - AV_CODEC_ID_AVUI = $41565549, // MKBETAG('A','V','U','I'), - AV_CODEC_ID_AYUV = $41595556, // MKBETAG('A','Y','U','V'), - AV_CODEC_ID_HDMV_TEXT_SUBTITLE = $42445458, // MKBETAG('B','D','T','X'), - AV_CODEC_ID_BRENDER_PIX = $42504958, // MKBETAG('B','P','I','X'), - AV_CODEC_ID_BINTEXT = $42545854, // MKBETAG('B','T','X','T'), - AV_CODEC_ID_CPIA = $43504941, // MKBETAG('C','P','I','A'), - AV_CODEC_ID_DVD_NAV = $444E4156, // MKBETAG('D','N','A','V'), - AV_CODEC_ID_DSD_LSBF_PLANAR = $44534431, // MKBETAG('D','S','D','1'), - AV_CODEC_ID_DSD_MSBF_PLANAR = $44534438, // MKBETAG('D','S','D','8'), - AV_CODEC_ID_DSD_LSBF = $4453444C, // MKBETAG('D','S','D','L'), - AV_CODEC_ID_DSD_MSBF = $4453444D, // MKBETAG('D','S','D','M'), - AV_CODEC_ID_ADPCM_DTK = $44544B20, // MKBETAG('D','T','K',' '), - AV_CODEC_ID_ESCAPE130 = $45313330, // MKBETAG('E','1','3','0'), - AV_CODEC_ID_FFWAVESYNTH = $46465753, // MKBETAG('F','F','W','S'), - AV_CODEC_ID_JACOSUB = $4A535542, // MKBETAG('J','S','U','B'), - AV_CODEC_ID_SMPTE_KLV = $4B4C5641, // MKBETAG('K','L','V','A'), - AV_CODEC_ID_MPL2 = $4D504C32, // MKBETAG('M','P','L','2'), - AV_CODEC_ID_MVC1 = $4D564331, // MKBETAG('M','V','C','1'), - AV_CODEC_ID_MVC2 = $4D564332, // MKBETAG('M','V','C','2'), - AV_CODEC_ID_ADPCM_IMA_OKI=$4F4B4920, // MKBETAG('O','K','I',' '), - AV_CODEC_ID_OPUS = $4F505553, // MKBETAG('O','P','U','S'), - AV_CODEC_ID_PAF_AUDIO = $50414641, // MKBETAG('P','A','F','A'), - AV_CODEC_ID_PAF_VIDEO = $50414656, // MKBETAG('P','A','F','V'), - AV_CODEC_ID_PCM_S16BE_PLANAR = $50535010, // MKBETAG('P','S','P',16), - AV_CODEC_ID_PJS = $50684A53, // MKBETAG('P','h','J','S'), - AV_CODEC_ID_ADPCM_IMA_RAD = $52414420, // MKBETAG('R','A','D',' '), - AV_CODEC_ID_REALTEXT = $52545854, // MKBETAG('R','T','X','T'), - AV_CODEC_ID_SAMI = $53414D49, // MKBETAG('S','A','M','I'), - AV_CODEC_ID_SANM = $53414E4D, // MKBETAG('S','A','N','M'), - AV_CODEC_ID_SGIRLE = $53474952, // MKBETAG('S','G','I','R'), - AV_CODEC_ID_SMVJPEG = $534D564A, // MKBETAG('S','M','V','J'), - AV_CODEC_ID_SNOW = $534E4F57, // MKBETAG('S','N','O','W'), - AV_CODEC_ID_SONIC = $534F4E43, // MKBETAG('S','O','N','C'), - AV_CODEC_ID_SONIC_LS = $534F4E4C, // MKBETAG('S','O','N','L'), - AV_CODEC_ID_SUBRIP = $53526970, // MKBETAG('S','R','i','p'), - AV_CODEC_ID_SUBVIEWER1 = $53625631, // MKBETAG('S','b','V','1'), - AV_CODEC_ID_SUBVIEWER = $53756256, // MKBETAG('S','u','b','V'), - AV_CODEC_ID_TARGA_Y216 = $54323136, // MKBETAG('T','2','1','6'), - AV_CODEC_ID_ADPCM_THP_LE= $5448504C, // MKBETAG('T','H','P','L'), - AV_CODEC_ID_TIMED_ID3 = $54494433, // MKBETAG('T','I','D','3'), - AV_CODEC_ID_V308 = $56333038, // MKBETAG('V','3','0','8'), - AV_CODEC_ID_V408 = $56413038, // MKBETAG('V','4','0','8'), - AV_CODEC_ID_ADPCM_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VIMA = $56494D41, // MKBETAG('V','I','M','A'), - AV_CODEC_ID_VPLAYER = $56506C72, // MKBETAG('V','P','l','r'), - AV_CODEC_ID_WEBP = $57454250, // MKBETAG('W','E','B','P'), - AV_CODEC_ID_WEBVTT = $57565454, // MKBETAG('W','V','T','T'), - AV_CODEC_ID_XBIN = $5842494E, // MKBETAG('X','B','I','N'), - AV_CODEC_ID_XFACE = $58464143, // MKBETAG('X','F','A','C'), - AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), - AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), - AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D'), - AV_CODEC_ID_4GV = $73346776, // MKBETAG('s','4','g','v'), - AV_CODEC_ID_EVRC = $73657663, // MKBETAG('s','e','v','c'), - AV_CODEC_ID_SMV = $73736D76, // MKBETAG('s','s','m','v'), - AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), - - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_descriptor_get() - *) -type - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - - (** - * MIME type(s) associated with the codec. - * May be NULL; if not, a NULL-terminated array of MIME types. - * The first item is always non-NULL and is the preferred MIME type. - *) - mime_types: PAnsiChar; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Codec supports frame reordering. That is, the coded order (the order in which - * the encoded packets are output by the encoders / stored / input to the - * decoders) may be different from the presentation order of the corresponding - * frames. - * - * For codecs that do not have this property set, PTS and DTS should always be - * equal. - *) - AV_CODEC_PROP_REORDER = 1 << 3; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - AV_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - AV_INPUT_BUFFER_MIN_SIZE = 16384; - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead - *) - FF_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead - *) - FF_MIN_BUFFER_SIZE = 16384; -{$ENDIF} - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - * @deprecated use codec private option instead - *) -{$IFDEF FF_API_MOTION_EST} - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); -{$ENDIF} - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONINTRA= 24, ///< discard all non intra frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{ removed, kept for the moment - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -} - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - AV_CODEC_FLAG_UNALIGNED = $0001; // (1 << 0) -(** - * Use fixed qscale. - *) - AV_CODEC_FLAG_QSCALE = $0002; // (1 << 1) -(** - * 4 MV per MB allowed / advanced prediction for H.263. - *) - AV_CODEC_FLAG_4MV = $0004; // (1 << 2) -(** - * Output even those frames that might be corrupted. - *) - AV_CODEC_FLAG_OUTPUT_CORRUPT = $0008; // (1 << 3) -(** - * Use qpel MC. - *) - AV_CODEC_FLAG_QPEL = $0010; // (1 << 4) -(** - * Use internal 2pass ratecontrol in first pass mode. - *) - AV_CODEC_FLAG_PASS1 = $0200; // (1 << 9) -(** - * Use internal 2pass ratecontrol in second pass mode. - *) - AV_CODEC_FLAG_PASS2 = $0400; // (1 << 10) -(** - * loop filter. - *) - AV_CODEC_FLAG_LOOP_FILTER = $0800; // (1 << 11) -(** - * Only decode/encode grayscale. - *) - AV_CODEC_FLAG_GRAY = $2000; // (1 << 13) -(** - * error[?] variables will be set during encoding. - *) - AV_CODEC_FLAG_PSNR = $8000; // (1 << 15) -(** - * Input bitstream might be truncated at a random location - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG_TRUNCATED = $10000; // (1 << 16) -(** - * Use interlaced DCT. - *) - AV_CODEC_FLAG_INTERLACED_DCT = $40000; // (1 << 18) -(** - * Force low delay. - *) - AV_CODEC_FLAG_LOW_DELAY = $80000; // (1 << 19) -(** - * Place global headers in extradata instead of every keyframe. - *) - AV_CODEC_FLAG_GLOBAL_HEADER = $400000; // (1 << 22) -(** - * Use only bitexact stuff (except (I)DCT). - *) - AV_CODEC_FLAG_BITEXACT = $800000; // (1 << 23) -(* Fx : Flag for h263+ extra options *) -(** - * H.263 advanced intra coding / MPEG-4 AC prediction - *) - AV_CODEC_FLAG_AC_PRED = $1000000; // (1 << 24) -(** - * interlaced motion estimation - *) - AV_CODEC_FLAG_INTERLACED_ME = $20000000; // (1 << 29) -(** - * Allow non spec compliant speedup tricks. - *) - AV_CODEC_FLAG_CLOSED_GOP = $80000000; // (1U << 31) - - AV_CODEC_FLAG2_FAST = $0001; // (1 << 0) -(** - * Skip bitstream encoding. - *) - AV_CODEC_FLAG2_NO_OUTPUT = $0004; // (1 << 2) -(** - * Place global headers at every keyframe instead of in extradata. - *) - AV_CODEC_FLAG2_LOCAL_HEADER = $0008; // (1 << 3) - -(** - * timecode is in drop frame format. DEPRECATED!!!! - *) - AV_CODEC_FLAG2_DROP_FRAME_TIMECODE = $2000; // (1 << 13) - -(** - * Input bitstream might be truncated at a packet boundaries - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG2_CHUNKS = $8000; // (1 << 15) -(** - * Discard cropping information from SPS. - *) - AV_CODEC_FLAG2_IGNORE_CROP = $10000; // (1 << 16) - -(** - * Show all frames before the first keyframe - *) - AV_CODEC_FLAG2_SHOW_ALL = $400000; // (1 << 22) -(** - * Export motion vectors through frame side data - *) - AV_CODEC_FLAG2_EXPORT_MVS = $10000000; // (1 << 28) -(** - * Do not skip samples and export skip information as frame side data - *) - AV_CODEC_FLAG2_SKIP_MANUAL = $20000000; // (1 << 29) - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independent Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - -(** - * Decoder can use draw_horiz_band callback. - *) - AV_CODEC_CAP_DRAW_HORIZ_BAND = $0001; // (1 << 0) -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - AV_CODEC_CAP_DR1 = $0002; // (1 << 1) - AV_CODEC_CAP_TRUNCATED = $0008; // (1 << 3) -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - AV_CODEC_CAP_DELAY = $0020; // (1 << 5) -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - AV_CODEC_CAP_SMALL_LAST_FRAME = $0040; // (1 << 6) - -{$IFDEF FF_API_CAP_VDPAU} -(** - * Codec can export data for HW decoding (VDPAU). - *) - AV_CODEC_CAP_HWACCEL_VDPAU = $0080; // (1 << 7) -{$ENDIF} - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - AV_CODEC_CAP_SUBFRAMES = $0100; // (1 << 8) -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - AV_CODEC_CAP_EXPERIMENTAL = $0200; // (1 << 9) -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - AV_CODEC_CAP_CHANNEL_CONF = $0400; // (1 << 10) -(** - * Codec supports frame-level multithreading. - *) - AV_CODEC_CAP_FRAME_THREADS = $1000; // (1 << 12) -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - AV_CODEC_CAP_SLICE_THREADS = $2000; // (1 << 13) -(** - * Codec supports changed parameters at any point. - *) - AV_CODEC_CAP_PARAM_CHANGE = $4000; // (1 << 14) -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - AV_CODEC_CAP_AUTO_THREADS = $8000; // (1 << 15) -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - AV_CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; // (1 << 16) -(** - * Codec is intra only. - *) - AV_CODEC_CAP_INTRA_ONLY = $40000000; -(** - * Codec is lossless. - *) - AV_CODEC_CAP_LOSSLESS = $80000000; - - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = AV_CODEC_FLAG_UNALIGNED; - CODEC_FLAG_QSCALE = AV_CODEC_FLAG_QSCALE; - CODEC_FLAG_4MV = AV_CODEC_FLAG_4MV; - CODEC_FLAG_OUTPUT_CORRUPT = AV_CODEC_FLAG_OUTPUT_CORRUPT; - CODEC_FLAG_QPEL = AV_CODEC_FLAG_QPEL; -{$IFDEF FF_API_GMC} -(** - * @deprecated use the "gmc" private option of the libxvid encoder - *) - CODEC_FLAG_GMC = $0020; ///< use GMC. -{$IFEND} -{$IFDEF FF_API_MV0} -(** - * @deprecated use the flag "mv0" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. -{$IFEND} -{$IFDEF FF_API_INPUT_PRESERVED} -(** - * @deprecated passing reference-counted frames to the encoders replaces this - * flag - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; -{$IFEND} - CODEC_FLAG_PASS1 = AV_CODEC_FLAG_PASS1; - CODEC_FLAG_PASS2 = AV_CODEC_FLAG_PASS2; - CODEC_FLAG_GRAY = AV_CODEC_FLAG_GRAY; -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = AV_CODEC_FLAG_PSNR; - CODEC_FLAG_TRUNCATED = AV_CODEC_FLAG_TRUNCATED; - -{$IFDEF FF_API_NORMALIZE_AQP} -(** - * @deprecated use the flag "naq" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization -{$IFEND} - CODEC_FLAG_INTERLACED_DCT = AV_CODEC_FLAG_INTERLACED_DCT; - CODEC_FLAG_LOW_DELAY = AV_CODEC_FLAG_LOW_DELAY; - CODEC_FLAG_GLOBAL_HEADER = AV_CODEC_FLAG_GLOBAL_HEADER; - CODEC_FLAG_BITEXACT = AV_CODEC_FLAG_BITEXACT; - CODEC_FLAG_AC_PRED = AV_CODEC_FLAG_AC_PRED; - CODEC_FLAG_LOOP_FILTER = AV_CODEC_FLAG_LOOP_FILTER; - CODEC_FLAG_INTERLACED_ME = AV_CODEC_FLAG_INTERLACED_ME; - CODEC_FLAG_CLOSED_GOP = AV_CODEC_FLAG_CLOSED_GOP; - CODEC_FLAG2_FAST = AV_CODEC_FLAG2_FAST; - CODEC_FLAG2_NO_OUTPUT = AV_CODEC_FLAG2_NO_OUTPUT; - CODEC_FLAG2_LOCAL_HEADER = AV_CODEC_FLAG2_LOCAL_HEADER; - CODEC_FLAG2_DROP_FRAME_TIMECODE = AV_CODEC_FLAG2_DROP_FRAME_TIMECODE; - CODEC_FLAG2_IGNORE_CROP = AV_CODEC_FLAG2_IGNORE_CROP; - - CODEC_FLAG2_CHUNKS = AV_CODEC_FLAG2_CHUNKS; - CODEC_FLAG2_SHOW_ALL = AV_CODEC_FLAG2_SHOW_ALL; - CODEC_FLAG2_EXPORT_MVS = AV_CODEC_FLAG2_EXPORT_MVS; - CODEC_FLAG2_SKIP_MANUAL = AV_CODEC_FLAG2_SKIP_MANUAL; - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = AV_CODEC_CAP_DRAW_HORIZ_BAND; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = AV_CODEC_CAP_DR1; - CODEC_CAP_TRUNCATED = AV_CODEC_CAP_TRUNCATED; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = AV_CODEC_CAP_DELAY; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = AV_CODEC_CAP_SMALL_LAST_FRAME; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = AV_CODEC_CAP_HWACCEL_VDPAU; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = AV_CODEC_CAP_SUBFRAMES; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = AV_CODEC_CAP_EXPERIMENTAL; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = AV_CODEC_CAP_CHANNEL_CONF; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = AV_CODEC_CAP_FRAME_THREADS; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = AV_CODEC_CAP_SLICE_THREADS; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = AV_CODEC_CAP_PARAM_CHANGE; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = AV_CODEC_CAP_AUTO_THREADS; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = AV_CODEC_CAP_VARIABLE_FRAME_SIZE; - -(** - * Codec is intra only. - *) - CODEC_CAP_INTRA_ONLY = AV_CODEC_CAP_INTRA_ONLY; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = AV_CODEC_CAP_LOSSLESS; -{$ENDIF} (* FF_API_WITHOUT_PREFIX *) - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note: AVPanScan is now (28/09/2014) defined in libavutil/frame.pas to workaround a reference problem *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -{$IFDEF FF_API_GET_BUFFER} - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - -{$IFDEF FF_API_RC_STRATEGY} - FF_RC_STRATEGY_XVID = 1; -{$ENDIF} - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - -{$IFDEF FF_API_AFD} - {attribute_deprecated} - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; -{$IFEND} - -{$IFDEF FF_API_QUANT_BIAS} - FF_DEFAULT_QUANT_BIAS = 999999; -{$ENDIF} - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_CODER_TYPE_DEFLATE = 4; -{$ENDIF} - - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - FF_EC_FAVOR_INTER = 256; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DEBUG_PTS = $00000200; -{$ENDIF} - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; ///< only access through AVOptions from outside libavcodec - FF_DEBUG_VIS_MB_TYPE = $00004000; ///< only access through AVOptions from outside libavcodec -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - FF_DEBUG_GREEN_MD = $00800000; - FF_DEBUG_NOMC = $01000000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; ///< detect bitstream specification deviations - AV_EF_BUFFER = 4; ///< detect improper bitstream length - AV_EF_EXPLODE = 8; ///< abort decoding on minor error detection - - AV_EF_IGNORE_ERR = 32768; ///< ignore errors and continue - AV_EF_CAREFUL = 65536; ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors - AV_EF_COMPLIANT = 131072; ///< consider all spec non compliances as errors - AV_EF_AGGRESSIVE = 262144; ///< consider things that a sane encoder should not do as an error - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; -{$IFDEF FF_API_ARCH_SH4} - FF_IDCT_SH4 = 9; -{$ENDIF} - FF_IDCT_SIMPLEARM = 10; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_IDCT_IPP = 13; -{$ENDIF} - FF_IDCT_XVID = 14; -{$IFDEF FF_API_IDCT_XVIDMMX} - FF_IDCT_XVIDMMX = 14; -{$ENDIF} - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; -{$IFDEF FF_API_ARCH_SPARC} - FF_IDCT_SIMPLEVIS = 18; -{$ENDIF} - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - FF_IDCT_SIMPLEAUTO = 128; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_DTS_EXPRESS = 70; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 1; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 2; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_VP9_0 = 0; - FF_PROFILE_VP9_1 = 1; - FF_PROFILE_VP9_2 = 2; - FF_PROFILE_VP9_3 = 3; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - FF_PROFILE_HEVC_REXT = 4; - - - FF_LEVEL_UNKNOWN = -99; - -type - TAVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * This side data should be associated with an audio stream and contains - * ReplayGain information in form of the AVReplayGain struct. - *9 - AV_PKT_DATA_REPLAYGAIN, - - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the decoded video frames for - * correct presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_PKT_DATA_DISPLAYMATRIX, - - (** - * This side data should be associated with a video stream and contains - * Stereoscopic 3D information in form of the AVStereo3D struct. - *) - AV_PKT_DATA_STEREO3D, - - (** - * This side data should be associated with an audio stream and corresponds - * to enum AVAudioServiceType. - *) - AV_PKT_DATA_AUDIO_SERVICE_TYPE, - - (** - * This side data contains quality related information from the encoder. - * @code - * u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad). - * u8 picture type - * u8 error count - * u16 reserved - * u64le[error count] sum of squared differences between encoder in and output - * @endcode - *) - AV_PKT_DATA_QUALITY_STATS, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE - ); - - PAVPacketSideData = ^TAVPacketSideData; - TAVPacketSideData = record - data: PByte; - size: cint; - type_: TAVPacketSideDataType; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf or destruct (deprecated) - * fields. If either is set, the packet data is dynamically allocated and is - * valid indefinitely until av_free_packet() is called (which in turn calls - * av_buffer_unref()/the destruct callback to free the data). If neither is set, - * the packet data is typically backed by some static buffer somewhere and is - * only valid for a limited time (e.g. until the next read call when demuxing). - * - * The side data is always allocated with av_malloc() and is freed in - * av_free_packet(). - *) - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideData; - side_data_elems: cint; - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; -{$IFDEF FF_API_DESTRUCT_PACKET} - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; -{$ENDIF} - - pos: cint64; // byte position in stream, -1 if unknown - - (* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - - AV_PKT_DATA_QUALITY_FACTOR = AV_PKT_DATA_QUALITY_STATS; //DEPRECATED - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; -{$IFDEF FF_API_CODEC_NAME} - (** - * @deprecated this field is not used for anything in libavcodec - *) - {attribute_deprecated} - codec_name: array [0..31] of AnsiChar; -{$IFEND} - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - -{$IFDEF FF_API_STREAM_CODEC_TAG} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - stream_codec_tag: cuint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by user, may be overwritten by libavcodec - * if this info is available in the stream - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * AV_CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * AV_CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be AV_FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * This often, but not always is the inverse of the frame rate or field rate - * for video. - * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this field is unused (see initial_padding). - * - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - * @note Those fields may not match the values of the last - * AVFrame outputted by avcodec_decode_video2 due frame - * reordering. - * - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - * @note Those field may not match the value of the last - * AVFrame outputted by avcodec_decode_video2 due frame - * reordering. - * - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - * @note This field may not match the value of the last - * AVFrame outputted by avcodec_decode_video2 due frame - * reordering. - * - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec while - * parsing the data. - *) - pix_fmt: TAVPixelFormat; - -{$IFDEF FF_API_MOTION_EST} - (** - * This option does nothing - *@deprecated use codec private options instead - *) - {attribute_deprecated} - me_method: cint; -{$ENDIF} - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @note The callback may be called again immediately if initialization for - * the selected (hardware-accelerated) pixel format failed. - * @warning Behavior is undefined if the callback returns a value not - * in the fmt list of formats. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - -{$IFDEF FF_API_RC_STRATEGY} - (** @deprecated use codec private option instead *) - {attribute_deprecated} - rc_strategy: cint; -{$ENDIF} - - b_frame_strategy: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - -{$IFDEF FF_API_AFD} - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - * @deprecated Deprecated in favor of AVSideData - *) - {attribute_deprecated} - dtg_active_format: cint; -{$IFEND} - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - -{$IFDEF FF_API_QUANT_BIAS} - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - intra_quant_bias: cint; - - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - inter_quant_bias: cint; -{$ENDIF} - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - me_threshold: cint; - - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - mb_threshold: cint; -{$ENDIF} - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: Set by libavcodec - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - border_masking: cfloat; -{$ENDIF} - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - -{$IFDEF FF_API_UNUSED_MEMBERS} - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; {attribute_deprecated} -{$IFEND} - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjust sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - -{$IFDEF FF_API_REQUEST_CHANNELS} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; {deprecated} -{$IFEND} - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - -{$IFDEF FF_API_GET_BUFFER} - (** - * Called at the beginning of each frame to get a buffer for it. - * - * The function will set AVFrame.data[], AVFrame.linesize[]. - * AVFrame.extended_data[] must also be set, but it should be the same as - * AVFrame.data[] except for planar audio with more channels than can fit - * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as - * many data pointers as it can hold. - * - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't - * need it. avcodec_default_get_buffer() aligns the output buffer properly, - * but if get_buffer() is overridden then alignment considerations should - * be taken into account. - * - * @see avcodec_default_get_buffer() - * - * Video: - * - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * it may be called from a different thread, but not from more than one at - * once. Does not need to be reentrant. - * - * @see release_buffer(), reget_buffer() - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * Decoders cannot use the buffer after returning from - * avcodec_decode_audio4(), so they will not call release_buffer(), as it - * is assumed to be released immediately upon return. In some rare cases, - * a decoder may need to call get_buffer() more than once in a single - * call to avcodec_decode_audio4(). In that case, when get_buffer() is - * called again after it has already been called once, the previously - * acquired buffer is assumed to be released at that time and may not be - * reused by the decoder. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated use get_buffer2() - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - * - * @deprecated custom freeing callbacks should be set from get_buffer2() - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; {deprecated;} - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; {deprecated;} -{$ENDIF} - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise exended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_qsquish: cfloat; - - {attribute_deprecated} - rc_qmod_amp: cfloat; - {attribute_deprecated} - rc_qmod_freq: cint; -{$ENDIF} - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_eq: {const} PAnsiChar; -{$ENDIF} - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: Set by user, may be overwritten by libavcodec. - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - -{$IFDEF FF_API_MPV_OPT} - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_buffer_aggressivity: cfloat; - - {attribute_deprecated} - rc_initial_cplx: cfloat; -{$ENDIF} - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmin: cint; - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmax: cint; -{$ENDIF} - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user, in non drop frame format - * - decoding: Set by libavcodec (timecode in the 25 bits format, -1 if unset) - *) - timecode_frame_start: cint64; - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - -{$IFDEF FF_API_CODED_FRAME} - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - * - * @deprecated use the quality factor packet side data instead - *) - {attribute_deprecated} - coded_frame: PAVFrame; -{$ENDIF} - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - -{$IFDEF FF_API_THREAD_OPAQUE} - (** - * @deprecated this field should not be used from outside of lavc - *) - thread_opaque: pointer; -{$ENDIF} - - (** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_CODEC_PKT} - (** - * @deprecated this field is not supposed to be accessed from outside lavc - *) - pkt: PAVPacket; -{$ENDIF} - - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - *) - vbv_delay: cuint64; - - (** - * Encoding only. Allow encoders to output packets that do not contain any - * encoded data, only side data. - * - * Some encoders need to output such packets, e.g. to update some stream - * parameters at the end of encoding. - * - * All callers are strongly recommended to set this option to 1 and update - * their code to deal with such packets, since this behaviour may become - * always enabled in the future (then this option will be deprecated and - * later removed). To avoid ABI issues when this happens, the callers should - * use AVOptions to set this field. - *) - side_data_only_packets: cint; - - (** - * Audio only. The number of "priming" samples (padding) inserted by the - * encoder at the beginning of the audio. I.e. this number of leading - * decoded samples must be discarded by the caller to get the original audio - * without leading padding. - * - * - decoding: unused - * - encoding: Set by libavcodec. The timestamps on the output packets are - * adjusted by the encoder so that they always refer to the - * first sample of the data actually contained in the packet, - * including any added padding. E.g. if the timebase is - * 1/samplerate and the timestamp of the first input sample is - * 0, the timestamp of the first output packet will be - * -initial_padding. - *) - initial_padding: cint; - - (** - * - decoding: For codecs that store a framerate value in the compressed - * bitstream, the decoder may export it here. { 0, 1} when - * unknown. - * - encoding: unused - *) - framerate: TAVRational; - - (** - * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - * - encoding: unused. - * - decoding: Set by libavcodec before calling get_format() - *) - sw_pix_fmt: TAVPixelFormat; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * Code outside libavcodec should access this field using AVOptions - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavcodec should access this field using AVOptions - * (NO direct access). - * - encoding: Set by user. - * - decoding: Set by user. - *) - dump_separator: Pcuint8; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (* - * Properties of the stream that gets decoded - * To be accessed through av_codec_get_properties() (NO direct access) - * - encoding: unused - * - decoding: set by libavcodec - *) - properties: cuint; - end; {TAVCodecContext} - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they are rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see AV_CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< maximum value for lowres supported by the decoder, no direct access, use av_codec_get_max_lowres() - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - (** - * Internal codec capabilities. - * See FF_CODEC_CAP_* in internal.h - *) - caps_internal: cint; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * @defgroup lavc_hwaccel AVHWAccel - * @{ - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVHWAccel; - - (** - * Allocate a custom buffer - *) - alloc_frame: function (avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - frame_priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the ff_mpv_decode_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - decode_mb: procedure(s: PMpegEncContext); cdecl; - - (** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - *) - init: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - *) - uninit: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - *) - priv_data_size: cint; - end; {TAVHWAccel} - -const - (** - * Hardware acceleration should be used for decoding even if the codec level - * used is unknown or higher than the maximum supported level reported by the - * hardware driver. - * - * It's generally a good idea to pass this flag unless you have a specific - * reason not to, as hardware tends to under-report supported levels. - *) - AV_HWACCEL_FLAG_IGNORE_LEVEL = (1 << 0); - - (** - * Hardware acceleration can output YUV pixel formats with a different chroma - * sampling than 4:2:0 and/or other than 8 bits per component. - *) - AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = (1 << 1); - - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - FF_CODEC_PROPERTY_LOSSLESS = $00000001; - FF_CODEC_PROPERTY_CLOSED_CAPTIONS = $00000002; - - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_codec_properties(avctx: {const} PAVCodecContext): cuint; - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct should be freed with avcodec_free_context(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Free the codec context and everything associated with it and write NULL to - * the provided pointer. - *) -procedure avcodec_free_context(var avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVFRAME_LAVC} -(** - * @deprecated use av_frame_alloc() - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; -{$ENDIF} - -(** - * Set the fields of the given AVFrame to default values. - * - * @param frame The AVFrame of which the fields should be set to default values. - * - * @deprecated use av_frame_unref() - *) -procedure avcodec_get_frame_defaults(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. - * - * @param frame frame to be freed. The pointer will be set to NULL. - * - * @warning this function does NOT free the data buffers themselves - * (it does not know how, since they might have been allocated with - * a custom get_buffer()). - * - * @deprecated use av_frame_free() - *) -procedure avcodec_free_frame(frame: PPAVFrame); - cdecl; external av__codec; - - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_decode_video2()). - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -{$IFDEF FF_API_DESTRUCT_PACKET} -(* - * Default packet destructor. - * @deprecated use the AVBuffer API instead - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_side_data_name(type_: TAVPacketSideDataType): PAnsiChar; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Convert valid timing fields (timestamps / durations) in a packet from one - * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be - * ignored. - * - * @param pkt packet on which the conversion will be performed - * @param tb_src source timebase, in which the timing fields in pkt are - * expressed - * @param tb_dst destination timebase, to which the timing fields will be - * converted - *) -procedure av_packet_rescale_ts(pkt: PAVPacket; tb_src, tb_dst: TAVRational); - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_GET_BUFFER} -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; deprecated; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * AV_CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_DECODE_AUDIO} -(** - * Wrapper function which calls avcodec_decode_audio4. - * - * @deprecated Use avcodec_decode_audio4 instead. - * - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @warning You must not provide a custom get_buffer() when using - * avcodec_decode_audio3(). Doing so will override it with - * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, - * which does allow the application to provide a custom get_buffer(). - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * If the sample format is planar, each channel plane will - * be the same size, with no padding between channels. - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame and the return value would be - * less than the packet size. In this case, avcodec_decode_audio4 has to be - * called again with an AVPacket containing the remaining data in order to - * decode the second frame, etc... Even if no frames are returned, the packet - * needs to be fed to the decoder with remaining data until it is completely - * consumed or an error occurs. - * - * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning samples. It is safe to flush even those decoders that are not - * marked with AV_CODEC_CAP_DELAY, then no samples will be returned. - * - * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. Note that this field being set to zero - * does not mean that an error has occurred. For - * decoders with AV_CODEC_CAP_DELAY set, no given decode - * call is guaranteed to produce a frame. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be AV_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note Codecs which have the AV_CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning subtitles. It is safe to flush even those decoders that are not - * marked with CODEC_CAP_DELAY, then no subtitles will be returned. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, - * must be freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - (** - * Picture number incremented in presentation or output order. - * This field may be reinitialized at the first picture of a new sequence. - * - * For example, this corresponds to H.264 PicOrderCnt. - *) - output_picture_number: cint; - - (** - * Dimensions of the decoded video intended for presentation. - *) - width: cint; - height: cint; - - (** - * Dimensions of the coded video. - *) - coded_width: cint; - coded_height: cint; - - (** - * The format of the coded data, corresponds to enum AVPixelFormat for video - * and for enum AVSampleFormat for audio. - * - * Note that a decoder can have considerable freedom in how exactly it - * decodes the data, so the format reported here might be different from the - * one returned by a decoder. - *) - format: cint; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - (* This callback never returns an error, a negative value means that - * the frame start was in a previous packet. *) - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: {const} PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * Encode an audio frame from samples into buf. - * - * @deprecated Use avcodec_encode_audio2 instead. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user - * will know how much space is needed because it depends on the value passed - * in buf_size as described below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of - * samples read from samples is equal to: - * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id)) - * This also implies that av_get_bits_per_sample() must not return 0 for these - * codecs. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_OLD_ENCODE_AUDIO} -(** - * @deprecated use avcodec_encode_video2() instead. - * - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: {const} PAVFrame): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_free_packet() (i.e. avpkt->destruct will be - * called to free the user supplied buffer). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @see avpicture_fill() - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields, always assume a linesize alignment of - * 1. - * - * @see av_image_fill_arrays() - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Copy pixel data from an AVPicture into a buffer, always assume a - * linesize alignment of 1. - * - * @see av_image_copy_to_buffer() - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Always assume a linesize alignment of 1. - * - * @see av_image_get_buffer_size(). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_DEINTERLACE} -(** - * deinterlace - if not supported return -1 - * - * @deprecated - use yadif (in libavfilter) instead - *) -function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy image src to dst. Wraps av_image_copy(). - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * @deprecated see av_get_pix_fmt_loss() - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @deprecated see av_find_best_pix_fmt_of_2() - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is available in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output output buffer is not allocated - * and the output buffer should be considered identical to the input - * buffer, or in case *poutbuf was set it points to the input buffer - * (not necessarily to its starting address). - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: {const} PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: {const} PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. The "mutex" argument to the function points - * to a (void * ) where the lockmgr should store/get a pointer to a user - * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the - * value left by the last call for all other ops. If the lock manager is - * unable to perform the op then it should leave the mutex in the same - * state as when it was called and return a non-zero value. However, - * when called with AV_LOCK_DESTROY the mutex will always be assumed to - * have been successfully destroyed. If av_lockmgr_register succeeds - * it will return a non-negative value, if it fails it will return a - * negative value and destroy all mutex and unregister all callbacks. - * av_lockmgr_register is not thread-safe, it must be called from a - * single thread before any calls which make use of locking are used. - * - * @param cb User defined callback. av_lockmgr_register invokes calls - * to this callback and the previously registered callback. - * The callback will be used to create more than one mutex - * each of which must be backed by its own underlying locking - * mechanism (i.e. do not use a single static object to - * implement your lock manager). If cb is set to NULL the - * lockmgr will be unregistered. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-2.8/avformat.pas b/src/lib/ffmpeg-2.8/avformat.pas deleted file mode 100644 index 8ede1626..00000000 --- a/src/lib/ffmpeg-2.8/avformat.pas +++ /dev/null @@ -1,2987 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 56.4.101 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 2.4.* - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 56; - LIBAVFORMAT_MAX_VERSION_MINOR = 99; - LIBAVFORMAT_MAX_VERSION_RELEASE = 101; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 56; - LIBAVFORMAT_MIN_VERSION_MINOR = 40; - LIBAVFORMAT_MIN_VERSION_RELEASE = 101; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * It is possible to configure lavf muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @defgroup lavf_decoding Demuxing - * @ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL or filename, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_free_packet() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @ - * - * @defgroup lavf_encoding Muxing - * @ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codec "stream codec context" information, such as the - * codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVStream.time_base "stream timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - It is advised to manually initialize only the relevant fields in - * AVCodecContext, rather than using @ref avcodec_copy_context() during - * remuxing: there is no guarantee that the codec context values remain valid - * for both input and output format contexts. - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase - * requested by the caller. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @section lavf_io_dirlist Directory listing - * The directory listing API makes it possible to list files on remote servers. - * - * Some of possible use cases: - * - an "open file" dialog to choose files from a remote location, - * - a recursive media finder providing a player with an ability to play all - * files from a given directory. - * - * @subsection lavf_io_dirlist_open Opening a directory - * At first, a directory needs to be opened by calling avio_open_dir() - * supplied with a URL and, optionally, ::AVDictionary containing - * protocol-specific parameters. The function returns zero or positive - * integer and allocates AVIODirContext on success. - * - * @code - * AVIODirContext *ctx = NULL; - * if (avio_open_dir(&ctx, "smb://example.com/some_dir", NULL) < 0) { - * fprintf(stderr, "Cannot open directory.\n"); - * abort(); - * } - * @endcode - * - * This code tries to open a sample directory using smb protocol without - * any additional parameters. - * - * @subsection lavf_io_dirlist_read Reading entries - * Each directory's entry (i.e. file, another directory, anything else - * within ::AVIODirEntryType) is represented by AVIODirEntry. - * Reading consecutive entries from an opened AVIODirContext is done by - * repeatedly calling avio_read_dir() on it. Each call returns zero or - * positive integer if successful. Reading can be stopped right after the - * NULL entry has been read -- it means there are no entries left to be - * read. The following code reads all entries from a directory associated - * with ctx and prints their names to standard output. - * @code - * AVIODirEntry *entry = NULL; - * for (;;) { - * if (avio_read_dir(ctx, &entry) < 0) { - * fprintf(stderr, "Cannot list directory.\n"); - * abort(); - * } - * if (!entry) - * break; - * printf("%s\n", entry->name); - * avio_free_directory_entry(&entry); - * } - * @endcode - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -//type - -(* - * @defgroup metadata_api Public Metadata API - * @ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @ - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_LAVF_FRAC} -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; -{$ENDIF} - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - {const} mime_type: PAnsiChar; (**< mime_type, when known. *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MIME = 75; ///< score for file mime type - AVPROBE_SCORE_MAX = 100; ///< maximum score - - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) -{$IF LIBAVFORMAT_VERSION_MAJOR <= 54} - AVFMT_TS_NONSTRICT = $8020000; //we try to be compatible to the ABIs of ffmpeg and major forks -{$ELSE} - AVFMT_TS_NONSTRICT = $20000; -{$ENDIF} - (**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_FLUSH_PACKETS = $0200; ///< Flush the AVIOContext every packet. -(** - * When muxing, try to avoid writing any random/volatile data to the output. - * This includes any random IDs, real-time timestamps/dates, muxer version, etc. - * - * This flag is mainly intended for testing. - *) - AVFMT_FLAG_BITEXACT = $0400; - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - AVFMT_FLAG_FAST_SEEK = $80000; ///< Enable fast, but inaccurate seeks for some formats - - // used by AVStream - AVSTREAM_EVENT_FLAG_METADATA_UPDATED = $0001; ///< The call resulted in updated metadata. - MAX_STD_TIMEBASES = (60*12+6); - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - AVFMT_EVENT_FLAG_METADATA_UPDATED = 0001; ///< The call resulted in updated metadata. - - RAW_PACKET_BUFFER_SIZE = 2500000; - - AVFMT_AVOID_NEG_TS_AUTO = -1; ///< Enabled when required by target format - AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 1; ///< Shift timestamps so they are non negative - AVFMT_AVOID_NEG_TS_MAKE_ZERO = 2; ///< Shift timestamps so that they start at 0 - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - - PAVDeviceCapabilitiesQuery = ^TAVDeviceCapabilitiesQuery; - TAVDeviceCapabilitiesQuery = record - end; - - PFFFrac = ^TFFFrac; - TFFFrac = record - val: cint64; - num: cint64; - den: cint64; - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - data_codec: TAVCodecID; (**< default data codec *) - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (** - * Comma-separated list of mime types. - * It is used check for matching mime types while probing. - * @see av_probe_input_format2 - *) - mime_type: {const} PAnsiChar; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - priv_data: pointer; - -{$IFDEF FF_API_LAVF_FRAC} - (** - * @deprecated this field is unused - *) - pts: TAVFrac; {attribute_deprecated} -{$ENDIF} - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the desired timebase. In - * avformat_write_header(), the muxer will overwrite this field - * with the timebase that will actually be used for the timestamps - * written into the file (which may or may not be related to the - * user-provided one, depending on the format). - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - * - * - demuxing: May be set by libavformat when creating the stream or in - * avformat_find_stream_info(). - * - muxing: May be set by the caller before avformat_write_header(). - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (** - * An array of side data that applies to the whole stream (i.e. the - * container does not allow it to change between packets). - * - * There may be no overlap between the side data in this array and side data - * in the packets. I.e. a given side data is either exported by the muxer - * (demuxing) / set by the caller (muxing) in this array, then it never - * appears in the packets, or the side data is exported / sent through - * the packets (always in the first packet where the value becomes known or - * changes), then it does not appear in this array. - * - * - demuxing: Set by libavformat when the stream is created. - * - muxing: May be set by the caller before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - * - * @see av_format_inject_global_side_data() - *) - side_data: PAVPacketSideData; - - (** - * The number of elements in the AVStream.side_data array. - *) - nb_side_data: cint; - - (** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. - *) - event_flags: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * If not 0, the number of samples that should be skipped from the start of - * the stream (the samples are removed from packets with pts==0, which also - * assumes negative timestamps do not happen). - * Intended for use with formats such as mp3 with ad-hoc gapless audio - * support. - *) - start_skip_samples: cint64; - - (** - * If not 0, the first audio sample that should be discarded from the stream. - * This is broken by design (needs global sample count), but can't be - * avoided for broken by design formats such as mp3 with ad-hoc gapless - * audio support. - *) - first_discard_sample: cint64; - - (** - * The sample after last sample that is intended to be discarded after - * first_discard_sample. Works on frame boundaries only. Used to prevent - * early EOF if the gapless info is broken (considered concatenated mp3s). - *) - last_discard_sample: cint64; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - (** - * Internal data to inject global side data - *) - inject_global_side_data: cint; - - (** - * String containing paris of key and values describing recommended encoder configuration. - * Paris are separated by ','. - * Keys are separated from values by '='. - *) - recommended_encoder_configuration: PAnsiChar; - - (** - * display aspect ratio (0 if unknown) - * - encoding: unused - * - decoding: Set by libavformat to calculate sample_aspect_ratio internally - *) - display_aspect_ratio: TAVRational; - - priv_pts: PFFFrac; - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - TAVOpenCallback = function (s: PAVFormatContext; pb: PPAVIOContext; url: {const} PAnsiChar; flags: cint; - int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - (** - * Flags signalling stream properties. A combination of AVFMTCTX_*. - * Set by libavformat. - *) - ctx_flags: cint; - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - packet_size: cuint; - max_delay: cint; - - (** - * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. - * Set by the user before avformat_open_input() / avformat_write_header(). - *) - flags: cint; - -{$IFDEF FF_API_PROBESIZE_32} - (** - * @deprecated deprecated in favor of probesize2 - *) - probesize: cuint; - - (** - * @deprecated deprecated in favor of max_analyze_duration2 - *) - max_analyze_duration: cint; {attribute_deprecated} -{$ENDIF} - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * - muxing: Set by the caller before avformat_write_header(). If set to - * either 0 or AV_NOPTS_VALUE, then the current wall-time will - * be used. - * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that - * the value may become known after some number of frames - * have been received. - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Allow non-standard and experimental extension - * @see AVCodecContext.strict_std_compliance - *) - strict_std_compliance: cint; - - (** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. - *) - event_flags: cint; - - (** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - *) - max_ts_probe: cint; - - (** - * Avoid negative timestamps during muxing. - * Any value of the AVFMT_AVOID_NEG_TS_* constants. - * Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) - * - muxing: Set by user - * - demuxing: unused - *) - avoid_negative_ts: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cint64; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (** - * format probing score. - * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes - * the format. - * - encoding: unused - * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) - *) - probe_score: cint; - - (** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - format_probesize: cint; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (** - * ',' separated list of allowed demuxers. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - format_whitelist: PAnsiChar; - - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_video_codec (NO direct access). - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). - *) - subtitle_codec: PAVCodec; - - (** - * Forced data codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_data_codec (NO direct access). - *) - data_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - * Mostly usable with control_message_cb or any future callbacks in device's context. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user via AVOptions (NO direct access) - *) - output_ts_offset: cint64; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info() - * via AVOptions (NO direct access). - * Can be set to 0 to let avformat choose using a heuristic. - *) -{$IFDEF FF_API_PROBESIZE_32} - max_analyze_duration2: cint64; -{$ELSE} - max_analyze_duration: cint64; -{$ENDIF} - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input() - * via AVOptions (NO direct access). - *) -{$IFDEF FF_API_PROBESIZE_32} - probesize2: cint64; -{$ELSE} - probesize: cint64; -{$ENDIF} - - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavformat should access this field using AVOptions - * (NO direct access). - * - muxing: Set by user. - * - demuxing: Set by user. - *) - dump_separator: Pcuint8; - - (** - * Forced Data codec_id. - * Demuxing: Set by user. - *) - data_codec_id: TAVCodecID; - - (** - * Called to open further IO contexts when needed for demuxing. - * - * This can be set by the user application to perform security checks on - * the URLs before opening them. - * The function should behave like avio_open2(), AVFormatContext is provided - * as contextual information and to reach AVFormatContext.opaque. - * - * If NULL then some simple checks are used together with avio_open2(). - * - * Must not be accessed directly from outside avformat. - * @See av_format_set_open_cb() - * - * Demuxing: Set by user. - *) - open_cb: function(s: PAVFormatContext; p: PPAVIOContext; url: {const} PAnsiChar; flags: cint; int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; - end; (** TAVFormatContext **) - -function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_data_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_data_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; -procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; -procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; -function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; -procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; -function av_format_get_open_cb(s: {const} PAVFormatContext): TAVOpenCallback; - cdecl; external av__format; -procedure av_format_set_open_cb(s: PAVFormatContext; callback: TAVOpenCallback); - cdecl; external av__format; - -(** - * This function will cause global side data to be injected in the next packet - * of each stream as well as after any subsequent seek. - *) -procedure av_format_inject_global_side_data(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; -function av_stream_get_parser(s: {const} PAVStream): PAVCodecParserContext; - cdecl; external av__format; -function av_stream_get_recommended_encoder_configuration({const} s: PAVStream): PAnsiChar; - cdecl; external av__format; -procedure av_stream_set_recommended_encoder_configuration(s: PAVStream; configuration: PAnsiChar); - cdecl; external av__format; - -(** - * Returns the pts of the last muxed packet + its duration - * - * the retuned value is undefined when used with a demuxer. - *) -function av_stream_get_end_pts(st: {const} PAVStream): cint64; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: {const} PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: {const} PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -(** - * Get side information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_stream_get_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param filename the filename of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param filename Name of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; filename: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until av_close_input_file(). Otherwise the packet is valid - * indefinitely. In both cases the packet must be freed with - * av_free_packet when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Discard all internally buffered data. This can be useful when dealing with - * discontinuities in the byte stream. Generally works only with formats that - * can resync. This includes headerless formats like MPEG-TS/TS but should also - * work with NUT, Ogg and in a limited way AVI for example. - * - * The set of streams, the detected duration, stream parameters and codecs do - * not change when calling this function. If you want a complete reset, it's - * better to open a new AVFormatContext. - * - * This does not flush the AVIOContext (s->pb). If necessary, call - * avio_flush(s->pb) before calling this function. - * - * @param s media file handle - * @return >=0 on success, error code otherwise - *) -function avformat_flush(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". It is very strongly - * recommended that timing information (@ref AVPacket.pts "pts", @ref - * AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to - * correct values. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * If the muxer supports it, this function makes it possible to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: {const} PAVPacket; dump_payload: cint; st: {const} PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: {const} PAVPacket; dump_payload: cint; - st: {const} PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - url: {const} PAnsiChar); - cdecl; external av__format; - -(** - * Print detailed information about the input or output format, such as - * duration, bitrate, streams, container, programs, metadata, side data, - * codec and time base. - * - * @param ic the context to analyze - * @param index index of the stream to dump information about - * @param url the URL to print, such as source or destination file - * @param is_output Select whether the specified context is an input(0) or output(1) - *) -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: {const} PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: {const} PAVOutputFormat; codec_id: TAVCodecID; - std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-2.8/avio.pas b/src/lib/ffmpeg-2.8/avio.pas deleted file mode 100644 index aa8fae6e..00000000 --- a/src/lib/ffmpeg-2.8/avio.pas +++ /dev/null @@ -1,803 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 56.4.101 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - - (** - * Directory entry types. - *) - TAVIODirEntryType = ( - AVIO_ENTRY_UNKNOWN, - AVIO_ENTRY_BLOCK_DEVICE, - AVIO_ENTRY_CHARACTER_DEVICE, - AVIO_ENTRY_DIRECTORY, - AVIO_ENTRY_NAMED_PIPE, - AVIO_ENTRY_SYMBOLIC_LINK, - AVIO_ENTRY_SOCKET, - AVIO_ENTRY_FILE, - AVIO_ENTRY_SERVER, - AVIO_ENTRY_SHARE, - AVIO_ENTRY_WORKGROUP - ); - - - (** - * Describes single entry of the directory. - * - * Only name and type fields are guaranteed be set. - * Rest of fields are protocol or/and platform dependent and might be unknown. - *) - PPAVIODirEntry = ^PAVIODirEntry; - PAVIODirEntry = ^TAVIODirEntry; - TAVIODirEntry = record - name: PAnsiChar; (**< Filename *) - type_: cint; (**< Type of the entry *) - utf8: cint; (**< Set to 1 when name is encoded with UTF-8, 0 otherwise. - Name can be encoded with UTF-8 even though 0 is set. *) - size: cint64; (**< File size in bytes, -1 if unknown. *) - modification_timestamp: cint64; (**< Time of last modification in microseconds since unix - epoch, -1 if unknown. *) - access_timestamp: cint64; (**< Time of last access in microseconds since unix epoch, - -1 if unknown. *) - status_change_timestamp: cint64; (**< Time of last status change in microseconds since unix - epoch, -1 if unknown. *) - user_id: cint64; (**< User ID of owner, -1 if unknown. *) - group_id: cint64; (**< Group ID of owner, -1 if unknown. *) - filemode: cint64; (**< Unix file mode, -1 if unknown. *) - end; - - PPAVIODirContext = ^PAVIODirContext; - PAVIODirContext = ^TAVIODirContext; - TAVIODirContext = record - url_context: pointer; - (** struct URLContext *url_context; *) - end; - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - - (** - * Original buffer size - * used internally after probing and ensure seekback to reset the buffer size - * This field is internal to libavformat and access from outside is not allowed. - *) - orig_buffer_size: cint; - - (** - * Threshold to favor readahead over seek. - * This is current internal only, do not use from outside. - *) - short_seek_threshold: cint; - end; - -(* unbuffered I/O *) - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Move or rename a resource. - * - * @note url_src and url_dst should share the same protocol and authority. - * - * @param url_src url to resource to be moved - * @param url_dst new url to resource if the operation succeeded - * @return >=0 on success or negative on error. - *) -function avpriv_io_move(url_src: {const} PAnsiChar; url_dst: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Delete a resource. - * - * @param url resource to be deleted. - * @return >=0 on success or negative on error. - *) -function avpriv_io_delete(url: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Open directory for reading. - * - * @param s directory read context. Pointer to a NULL pointer must be passed. - * @param url directory to be listed. - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dictionary - * containing options that were not found. May be NULL. - * @return >=0 on success or negative on error. - *) -function avio_open_dir(s: PPAVIODirContext; url: {const} PAnsiChar; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Get next directory entry. - * - * Returned entry must be freed with avio_free_directory_entry(). In particular - * it may outlive AVIODirContext. - * - * @param s directory read context. - * @param[out] next next entry or NULL when no more entries. - * @return >=0 on success or negative on error. End of list is not considered an - * error. - *) -function avio_read_dir(s: PAVIODirContext; next: PPAVIODirEntry): cint; - cdecl; external av__format; - -(** - * Close directory. - * - * @note Entries created using avio_read_dir() are not deleted and must be - * freeded with avio_free_directory_entry(). - * - * @param s directory read context. - * @return >=0 on success or negative on error. - *) -function avio_close_dir(s: PPAVIODirContext): cint; - cdecl; external av__format; - -(** - * Free entry allocated by avio_read_dir(). - * - * @param entry entry to be freed. - *) -procedure avio_free_directory_entry(entry: PPAVIODirEntry); - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * It may be freed and replaced with a new buffer by libavformat. - * AVIOContext.buffer holds the buffer currently in use, - * which must be later freed with av_free(). - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16BE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16be(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const -(** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function avio_feof(s: PAVIOContext): cint; - cdecl; external av__format; -{$IFDEF FF_API_URL_FEOF} -(** - * @deprecated use avio_feof() - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; {attribute_deprecated} -{$ENDIF} - -(** @warning currently size is limited *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data. - * - * For write streams, force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - * - * For read streams, discard all currently buffered data, and advance the - * reported file position to that of the underlying stream. This does not - * read new data, and does not perform any seeks. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -(* Avoid a warning. The header can not be included because it breaks c++. *) -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; - -(** - * Read contents of h into print buffer, up to max_size bytes, or up to EOF. - * - * @return 0 for success (max_size bytes read or EOF reached), negative error - * code otherwise - *) -function avio_read_to_bprint(h: PAVIOContext; pb: PAVBPrint; max_size: size_t): cint; - cdecl; external av__format; - -(** - * Accept and allocate a client context on a server context. - * @param s the server context - * @param c the client context, must be unallocated - * @return >= 0 on success or a negative value corresponding - * to an AVERROR on failure - *) -function avio_accept(s: PAVIOContext; c: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Perform one step of the protocol handshake to accept a new client. - * This function must be called on a client returned by avio_accept() before - * using it as a read/write context. - * It is separate from avio_accept() because it may block. - * A step of the handshake is defined by places where the application may - * decide to change the proceedings. - * For example, on a protocol with a request header and a reply header, each - * one can constitute a step because the application may use the parameters - * from the request to change parameters in the reply; or each individual - * chunk of the request can constitute a step. - * If the handshake is already finished, avio_handshake() does nothing and - * returns 0 immediately. - * - * @param c the client context to perform the handshake on - * @return 0 on a complete and successful handshake - * > 0 if the handshake progressed, but is not complete - * < 0 for an AVERROR code - *) -function avio_handshake(c: PAVIOContext): cint; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-2.8/avutil.pas b/src/lib/ffmpeg-2.8/avutil.pas deleted file mode 100644 index fabc5271..00000000 --- a/src/lib/ffmpeg-2.8/avutil.pas +++ /dev/null @@ -1,361 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 54.7.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 54; - LIBAVUTIL_MAX_VERSION_MINOR = 99; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 54; - LIBAVUTIL_MIN_VERSION_MINOR = 30; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return an informative version string. This usually is the actual release - * version number or a git commit description. This string has no fixed format - * and can change any time. It should never be parsed by code. - *) -function av_version_info(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -(** - * Return the fractional representation of the internal time base. - *) -function av_get_time_base_q: TAVRational; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-2.8/ff_api-defines.inc b/src/lib/ffmpeg-2.8/ff_api-defines.inc deleted file mode 100644 index 02c62910..00000000 --- a/src/lib/ffmpeg-2.8/ff_api-defines.inc +++ /dev/null @@ -1,275 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_VIMA_DECODER} -{$define FF_API_VIMA_DECODER := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_REQUEST_CHANNELS} -{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_DECODE_AUDIO} -{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_AUDIO} -{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_ENCODE_VIDEO} -{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_ID} -{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEINTERLACE} -{$define FF_API_DEINTERLACE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DESTRUCT_PACKET} -{$define FF_API_DESTRUCT_PACKET := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GET_BUFFER} -{$define FF_API_GET_BUFFER := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_THREAD_OPAQUE} -{$define FF_API_THREAD_OPAQUE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_PKT} -{$define FF_API_CODEC_PKT := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_SH4} -{$define FF_API_ARCH_SH4 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_ARCH_SPARC} -{$define FF_API_ARCH_SPARC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_UNUSED_MEMBERS} -{$define FF_API_UNUSED_MEMBERS := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_IDCT_XVIDMMX} -{$define FF_API_IDCT_XVIDMMX := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_INPUT_PRESERVED} -{$define FF_API_INPUT_PRESERVED := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_NORMALIZE_AQP} -{$define FF_API_NORMALIZE_AQP := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_GMC} -{$define FF_API_GMC := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_MV0} -{$define FF_API_MV0 := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_CODEC_NAME} -{$define FF_API_CODEC_NAME := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AFD} -{$define FF_API_AFD := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_VISMV} -(* XXX: don't forget to drop the -vismv documentation *) -{$define FF_API_VISMV := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_DV_FRAME_PROFILE} -{$define FF_API_DV_FRAME_PROFILE := (LIBAVCODEC_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_AUDIOENC_DELAY} -{$define FF_API_AUDIOENC_DELAY := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VAAPI_CONTEXT} -{$define FF_API_VAAPI_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCTX_TIMEBASE} -{$define FF_API_AVCTX_TIMEBASE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MPV_OPT} -{$define FF_API_MPV_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STREAM_CODEC_TAG} -{$define FF_API_STREAM_CODEC_TAG := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_QUANT_BIAS} -{$define FF_API_QUANT_BIAS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_RC_STRATEGY} -{$define FF_API_RC_STRATEGY := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CODED_FRAME} -{$define FF_API_CODED_FRAME := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MOTION_EST} -{$define FF_API_MOTION_EST := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_WITHOUT_PREFIX} -{$define FF_API_WITHOUT_PREFIX := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_GET_BITS_PER_SAMPLE_FMT} -{$define FF_API_GET_BITS_PER_SAMPLE_FMT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_FIND_OPT} -{$define FF_API_FIND_OPT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OLD_AVOPTIONS} -{$define FF_API_OLD_AVOPTIONS := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT} -{$define FF_API_PIX_FMT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CONTEXT_SIZE} -{$define FF_API_CONTEXT_SIZE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_PIX_FMT_DESC} -{$define FF_API_PIX_FMT_DESC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AV_REVERSE} -{$define FF_API_AV_REVERSE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_AUDIOCONVERT} -{$define FF_API_AUDIOCONVERT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_CPU_FLAG_MMX2} -{$define FF_API_CPU_FLAG_MMX2 := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO} -{$define FF_API_SAMPLES_UTILS_RETURN_ZERO := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_LLS_PRIVATE} -{$define FF_API_LLS_PRIVATE := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_LLS1} -{$define FF_API_LLS1 :=(LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_AVFRAME_LAVC} -{$define FF_API_AVFRAME_LAVC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT} -{$define FF_API_GET_CHANNEL_LAYOUT_COMPAT := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_OLD_OPENCL} -{$define FF_API_OLD_OPENCL := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_INTFLOAT -{$define FF_API_INTFLOAT := (LIBAVUTIL_VERSION_MAJOR < 54)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_DLOG} -{$define FF_API_DLOG := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_HMAC} -{$define FF_API_HMAC := (LIBAVUTIL_VERSION_MAJOR < 55)} -{$endif} -{$ifndef FF_API_VAAPI} -{$define FF_API_VAAPI := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_CONST_AVUTIL55} -{$IFDEF LIBAVUTIL_VERSION_MAJOR >= 55} - {$define FF_CONST_AVUTIL55 := const} -{$ELSE} - {$define FF_CONST_AVUTIL55} -{$ENDIF} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_LAVF_BITEXACT} -{$define FF_API_LAVF_BITEXACT := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_FRAC} -{$define FF_API_LAVF_FRAC := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_LAVF_CODEC_TB} -{$define FF_API_LAVF_CODEC_TB := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_URL_FEOF} -{$define FF_API_URL_FEOF := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} -{$ifndef FF_API_PROBESIZE_32} -{$define FF_API_PROBESIZE_32 := (LIBAVFORMAT_VERSION_MAJOR < 57)} -{$endif} - -(** swscale FF_API defines *) -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_ARCH_BFIN} -{$define FF_API_ARCH_BFIN := (LIBSWSCALE_VERSION_MAJOR < 4)} -{$endif} - -{$ENDIF PASDOC} diff --git a/src/lib/ffmpeg-2.8/libavcodec/audioconvert.pas b/src/lib/ffmpeg-2.8/libavcodec/audioconvert.pas deleted file mode 100644 index 38bef39c..00000000 --- a/src/lib/ffmpeg-2.8/libavcodec/audioconvert.pas +++ /dev/null @@ -1,294 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_HEXADECAGONAL = (AV_CH_LAYOUT_OCTAGONAL or AV_CH_WIDE_LEFT or AV_CH_WIDE_RIGHT or AV_CH_TOP_BACK_LEFT or - AV_CH_TOP_BACK_RIGHT or AV_CH_TOP_BACK_CENTER or AV_CH_TOP_FRONT_CENTER or - AV_CH_TOP_FRONT_LEFT or AV_CH_TOP_FRONT_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} \ No newline at end of file diff --git a/src/lib/ffmpeg-2.8/libavutil/buffer.pas b/src/lib/ffmpeg-2.8/libavutil/buffer.pas deleted file mode 100644 index c1502f51..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/buffer.pas +++ /dev/null @@ -1,290 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 54.7.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Same as av_buffer_alloc(), except the returned buffer will be initialized - * to zero. - *) -function av_buffer_allocz(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferRef; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - * @see av_buffer_pool_can_uninit() - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.8/libavutil/cpu.pas b/src/lib/ffmpeg-2.8/libavutil/cpu.pas deleted file mode 100644 index a05ee5bf..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/cpu.pas +++ /dev/null @@ -1,122 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 54.7.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_AVXSLOW = $8000000; ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer) - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1001000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - AV_CPU_FLAG_VSX = $0002; ///< ISA 2.06 - AV_CPU_FLAG_POWER8 = $0004; ///< ISA 2.07 - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - AV_CPU_FLAG_ARMV8 = (1 << 6); - AV_CPU_FLAG_SETEND = (1 <<16); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.8/libavutil/dict.pas b/src/lib/ffmpeg-2.8/libavutil/dict.pas deleted file mode 100644 index a8cf4e32..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/dict.pas +++ /dev/null @@ -1,162 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 54.7.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get({const} m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, - * these arguments will be freed on error. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Convenience wrapper for av_dict_set that converts the value to a string - * and stores it. - * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. - *) -function av_dict_set_int(var pm: PAVDictionary; {const} key: PAnsiChar; - value: cint64; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - *) -procedure av_dict_copy(var dst: PAVDictionary; {const} src: PAVDictionary; flags: cint); - cdecl; external av__util; - -(** - * Get dictionary entries as a string. - * - * Create a string containing dictionary's entries. - * Such string may be passed back to av_dict_parse_string(). - * @note String is escaped with backslashes ('\'). - * - * @param[in] m dictionary - * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. - * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other - * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. - *) -function av_dict_get_string({const} m: PAVDictionary; buffer: PPAnsiChar; - {const} key_val_sep: AnsiChar; {const} pairs_sep: AnsiChar): cint; - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.8/libavutil/error.pas b/src/lib/ffmpeg-2.8/libavutil/error.pas deleted file mode 100644 index 59580fab..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/error.pas +++ /dev/null @@ -1,166 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) - AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) -(* HTTP & RTSP errors *) - AVERROR_HTTP_BAD_REQUEST = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('0') shl 24)); - AVERROR_HTTP_UNAUTHORIZED = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('1') shl 24)); - AVERROR_HTTP_FORBIDDEN = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('3') shl 24)); - AVERROR_HTTP_NOT_FOUND = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('4') shl 24)); - AVERROR_HTTP_OTHER_4XX = -(ord($F8) or (ord('4') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - AVERROR_HTTP_SERVER_ERROR = -(ord($F8) or (ord('5') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-2.8/libavutil/frame.pas b/src/lib/ffmpeg-2.8/libavutil/frame.pas deleted file mode 100644 index 66d727bb..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/frame.pas +++ /dev/null @@ -1,849 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 54.7.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - (** from the definitions of TAVFrame *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - AV_FRAME_FLAG_CORRUPT = (1 << 0); - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type -(* is already in pixfmt.pas - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); -*) - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO, - (** - * ReplayGain information in the form of the AVReplayGain struct. - *) - AV_FRAME_DATA_REPLAYGAIN, - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the frame for correct - * presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_FRAME_DATA_DISPLAYMATRIX, - (** - * Active Format Description data consisting of a single byte as specified - * in ETSI TS 101 154 using AVActiveFormatDescription enum. - *) - AV_FRAME_DATA_AFD, - (** - * Motion vectors exported by some codecs (on demand through the export_mvs - * flag set in the libavcodec AVCodecContext flags2 option). - * The data is the AVMotionVector struct defined in - * libavutil/motion_vector.h. - *) - AV_FRAME_DATA_MOTION_VECTORS, - (** - * Recommmends skipping the specified number of samples. This is exported - * only if the "skip_manual" AVOption is set in libavcodec. - * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_FRAME_DATA_SKIP_SAMPLES, - - (** - * This side data must be associated with an audio frame and corresponds to - * enum AVAudioServiceType defined in avcodec.h. - *) - AV_FRAME_DATA_AUDIO_SERVICE_TYPE - ); - - TAVActiveFormatDescription = ( - AV_AFD_SAME = 8, - AV_AFD_4_3 = 9, - AV_AFD_16_9 = 10, - AV_AFD_14_9 = 11, - AV_AFD_4_3_SP_14_9 = 13, - AV_AFD_16_9_SP_14_9 = 14, - AV_AFD_SP_4_3 = 15 - ); {TAVActiveFormatDescription} - - PAVFrameSideData = ^TAVFrameSideData; -(** - * Structure to hold side data for an AVFrame. - * - * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - *) - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - buf: PAVBufferRef; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. -*) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used in order to access all channels. - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - *) - key_frame: cint; - - (** - * Picture type of the frame - *) - pict_type: TAVPictureType; - -{$IFDEF FF_API_AVFRAME_LAVC} - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; {deprecated} -{$ENDIF} - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - *) - pkt_pts: cint64; - - (** - * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) - * This is also the Presentation time of this AVFrame calculated from - * only AVPacket.dts values without pts values. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - *) - coded_picture_number: cint; - - (** - * picture number in display order - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - *) - quality: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - reference: cint; {deprecated} - - (** - * QP table - *) - qscale_table: pbyte; {deprecated} - - (** - * QP store stride - *) - qstride: cint; {deprecated} - qscale_type: cint; {deprecated} - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - *) - mbskip_table: pbyte; {deprecated} - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - *) - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - *) - mb_type: PCuint; {deprecated} - - (** - * DCT coefficients - *) - dct_coeff: PsmallInt; {deprecated} - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - *) - ref_index: array [0..1] of pbyte; {deprecated} -{$ENDIF} - - (** - * for some private data of the user - *) - opaque: pointer; - - (** - * error - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - type_: cint; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - *) - palette_has_changed: cint; - -{$IFDEF FF_API_AVFRAME_LAVC} - buffer_hints: cint; {deprecated} - (** - * Pan scan. - *) - pan_scan: PAVPanScan; {deprecated} -{$ENDIF} - - (** - * reordered opaque 64bit (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - *) - reordered_opaque: cint64; - -{$IFDEF FF_API_AVFRAME_LAVC} - (** - * @deprecated this field is unused - *) - hwaccel_picture_private: pointer; {deprecated} - owner: pointer; {deprecated} (** Note: Should be a PAVCodecContext, but a type pointer is used to avoid a reference problem. *) - thread_opaque: pointer; {deprecated} - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - *) - motion_subsample_log2: cuint8; {deprecated} -{$ENDIF} - - (** - * Sample rate of the audio data. - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. This array - * must be filled contiguously -- if buf[i] is non-NULL then buf[j] must - * also be non-NULL for all j < i. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * Flags describing additional frame properties. - * - * @ - *) - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - color_primaries: TAVColorPrimaries; - - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - chroma_location: TAVChromaLocation; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavutil should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavutil should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavutil should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavutil should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavutil should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavutil should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavutil. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__codec; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__codec; - -(** - * Move everything contained in src to dst and reset src. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - -(** - * If side data of the supplied type exists in the frame, free it and remove it - * from the frame. - *) -procedure av_frame_remove_side_data(frame: PAVFrame; type_: TAVFrameSideDataType); - cdecl; external av__codec; - -(** - * @return a string identifying the side data type - *) -function av_frame_side_data_name(type_: TAVFrameSideDataType): PAnsiChar; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-2.8/libavutil/log.pas b/src/lib/ffmpeg-2.8/libavutil/log.pas deleted file mode 100644 index 7c330bc8..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/log.pas +++ /dev/null @@ -1,538 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * log - *) - -type - (* from opt.h *) - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_DICT, - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is inteded for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, - AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, - AV_CLASS_CATEGORY_DEVICE_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_INPUT, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(* -#define AV_IS_INPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) - -#define AV_IS_OUTPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -*) - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - (** - * Value range. - * For string ranges this represents the min/max length. - * For dimensions this represents the min/max pixel count or width/height in multi-component case. - *) - value_min, value_max: cdouble; - (** - * Value's component range. - * For string this represents the unicode range for chars, 0-127 limits to ASCII. - *) - component_min, component_max: cdouble; - (** - * Range flag. - * If set to 1 the struct encodes a range, if set to 0 a single value. - *) - is_range: cint; - end; - - (** - * List of AVOptionRange structs. - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - (** - * Array of option ranges. - * - * Most of option types use just one component. - * Following describes multi-component option types: - * - * AV_OPT_TYPE_IMAGE_SIZE: - * component index 0: range of pixel count (width * height). - * component index 1: range of width. - * component index 2: range of height. - * - * @note To obtain multi-component version of this structure, user must - * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or - * av_opt_query_ranges_default function. - * - * Multi-component range can be read as in following example: - * - * @code - * int range_index, component_index; - * AVOptionRanges *ranges; - * AVOptionRange *range[3]; //may require more than 3 in the future. - * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); - * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { - * for (component_index = 0; component_index < ranges->nb_components; component_index++) - * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; - * //do something with range here. - * } - * av_opt_freep_ranges(&ranges); - * @endcode - *) - range: PPAVOptionRange; - (** - * Number of ranges per component. - *) - nb_ranges: cint; - (** - * Number of componentes. - *) - nb_components: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - -(** - * Extremely verbose debugging, useful for libav* development. - *) - AV_LOG_TRACE = 56; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Sets additional colors for extended debugging sessions. - * @code - av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); - @endcode - * Requires 256color terminal support. Uses outside debugging is not - * recommended. - *) -{** to be translated if needed - AV_LOG_C(x) (x << 8) -**} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct or NULL if general log. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formatted line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -{$IFDEF FF_API_DLOG} -(** - * av_dlog macros - * @deprecated unused - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) -{$ENDIF} //FF_API_DLOG - -const -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) - AV_LOG_SKIP_REPEATED = 1; - -(** - * Include the log severity in messages originating from codecs. - * - * Results in messages such as: - * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts - *) - AV_LOG_PRINT_LEVEL = 2; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; - -function av_log_get_flags: cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.8/libavutil/mathematics.pas b/src/lib/ffmpeg-2.8/libavutil/mathematics.pas deleted file mode 100644 index 1025bbf3..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/mathematics.pas +++ /dev/null @@ -1,144 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 54.7.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a, b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a, b, modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timebase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timebase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function guarantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.8/libavutil/mem.pas b/src/lib/ffmpeg-2.8/libavutil/mem.pas deleted file mode 100644 index 43a38e4d..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/mem.pas +++ /dev/null @@ -1,353 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of size * nmemb bytes with av_malloc(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param size Size in bytes of the memory block to be allocated or - * reallocated. - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate a block of memory. - * If *ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param size Size in bytes for the memory block to be allocated or - * reallocated - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_reallocp(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array through a pointer to a pointer. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate a block of size * nmemb bytes with av_mallocz(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a substring of the string s. - * @param s string to be duplicated - * @param len the maximum length of the resulting string (not counting the - * terminating byte). - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strndup({const} s: PAnsiChar; len: size_t): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @note passing a pointer to a NULL pointer is safe and leads to no action. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray_add_nofree(), av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * Function has the same functionality as av_dynarray_add(), - * but it doesn't free memory on fails. It returns error code - * instead and leave current buffer untouched. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @return >=0 on success, negative otherwise. - * @see av_dynarray_add(), av_dynarray2_add() - *) -function av_dynarray_add_nofree(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer): cint; - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add(), av_dynarray_add_nofree() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.8/libavutil/opt.pas b/src/lib/ffmpeg-2.8/libavutil/opt.pas deleted file mode 100644 index 524d1384..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/opt.pas +++ /dev/null @@ -1,549 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 54.7.100 - * - *) - -{$IFDEF FF_API_OLD_AVOPTIONS} -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - * @deprecated use av_opt_set() - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__util; deprecated; - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__util; deprecated; -function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__util; deprecated; -function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__util; deprecated; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble; - cdecl; external av__util; deprecated; -function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational; - cdecl; external av__util; deprecated; -function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64; - cdecl; external av__util; deprecated; -function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__util; deprecated; -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__util; deprecated; -{$ENDIF} - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. Only these - * AVOption fields for which (opt->flags & mask) == flags will have their - * default applied to s. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - * @param mask combination of AV_OPT_FLAG_* - * @param flags combination of AV_OPT_FLAG_* - *) -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all allocated objects in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict2(obj: pointer; var options: PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = 0002; - -(** - * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than - * one component for certain option types. - * @see AVOptionRanges for details. - *) - AV_OPT_MULTI_COMPONENT_RANGE = 1000; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * @note Any old dictionary present is discarded and replaced with a copy of the new one. The - * caller still owns val is and responsible for freeing it. - *) -function av_opt_set_dict_val(obj: pointer; name: {const} PAnsiChar; val: {const} PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @param[out] out_val The returned dictionary is a copy of the actual value and must - * be freed with av_dict_free() by the caller - *) -function av_opt_get_dict_val (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: PAVDictionary): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -function av_opt_copy(dest: pointer;src: pointer): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-2.8/libavutil/pixfmt.pas b/src/lib/ffmpeg-2.8/libavutil/pixfmt.pas deleted file mode 100644 index 93b64f5f..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/pixfmt.pas +++ /dev/null @@ -1,622 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB32 palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with AV_PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - {$define AV_PIX_FMT_XVMC := (AV_PIX_FMT_XVMC_MPEG2_IDCT)} -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, most significant bit to 1 -{$IFDEF FF_API_VAAPI} - (** Deprecated pixel formats *) - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_VAAPI = AV_PIX_FMT_VAAPI_VLD, -{$ELSE} - AV_PIX_FMT_VAAPI, -{$ENDIF} - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_YA8, ///< 8bit gray, 8bit alpha -(* see const declaration way down - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -*) - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - -{$IFDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) - * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - *) - AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since Sat Sep 24 06:01:45 2011 +0200 (commits 9569a3c9f41387a8c7d1ce97d8693520477a66c3) - * also see Fri Nov 25 01:38:21 2011 +0100 92afb431621c79155fcb7171d26f137eb1bee028 - * Libav added them Sun Mar 16 23:05:47 2014 +0100 with incompatible values (commit 1481d24c3a0abf81e1d7a514547bd5305232be30) - *) - AV_PIX_FMT_RGBA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - - AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb - - AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef - - AV_PIX_FMT_YA16BE, ///< 16bit gray, 16bit alpha (big-endian) - AV_PIX_FMT_YA16LE, ///< 16bit gray, 16bit alpha (little-endian) - - (** - * duplicated pixel formats for compatibility with libav. - * FFmpeg supports these formats since May 3 2013 (commit e6d4e687558d08187e7a415a7725e4b1a416f782) - * Libav added them Jan 14 2015 with incompatible values (commit 0e6c7dfa650e8b0497bfa7a06394b7a462ddc33a) - *) - AV_PIX_FMT_GBRAP_LIBAV, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE_LIBAV, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE_LIBAV, ///< planar GBRA 4:4:4:4 64bpp, little-endian - (** - * HW acceleration through QSV, data[3] contains a pointer to the - * mfxFrameSurface1 structure. - *) - AV_PIX_FMT_QSV, - (** - * HW acceleration though MMAL, data[3] contains a pointer to the - * MMAL_BUFFER_HEADER_T structure. - *) - AV_PIX_FMT_MMAL, - - AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer - -{$IFNDEF AV_PIX_FMT_ABI_GIT_MASTER} - AV_PIX_FMT_RGBA64BE = $123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian -{$ENDIF} - AV_PIX_FMT_0RGB = $123 + 4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_AYUV64LE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_AYUV64BE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - - AV_PIX_FMT_VIDEOTOOLBOX, ///< hardware decoding through Videotoolbox - - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -const - AV_PIX_FMT_YUVA422P = AV_PIX_FMT_YUVA422P_LIBAV; - AV_PIX_FMT_YUVA444P = AV_PIX_FMT_YUVA444P_LIBAV; - AV_PIX_FMT_RGBA64BE = AV_PIX_FMT_RGBA64BE_LIBAV; - AV_PIX_FMT_RGBA64LE = AV_PIX_FMT_RGBA64LE_LIBAV; - AV_PIX_FMT_BGRA64BE = AV_PIX_FMT_BGRA64BE_LIBAV; - AV_PIX_FMT_BGRA64LE = AV_PIX_FMT_BGRA64LE_LIBAV; - AV_PIX_FMT_GBRAP = AV_PIX_FMT_GBRAP_LIBAV; - AV_PIX_FMT_GBRAP16BE = AV_PIX_FMT_GBRAP16BE_LIBAV; - AV_PIX_FMT_GBRAP16LE = AV_PIX_FMT_GBRAP16LE_LIBAV; -{$ENDIF} - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64LE; -{$ENDIF} - -{$IFDEF FF_API_PIX_FMT} -type - TPixelFormat = TAVPixelFormat; - -const - PIX_FMT_Y400A = AV_PIX_FMT_Y400A; - PIX_FMT_GBR24P = AV_PIX_FMT_GBR24P; - - PIX_FMT_RGB32 = AV_PIX_FMT_RGB32; - PIX_FMT_RGB32_1 = AV_PIX_FMT_RGB32_1; - PIX_FMT_BGR32 = AV_PIX_FMT_BGR32; - PIX_FMT_BGR32_1 = AV_PIX_FMT_BGR32_1; - PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB32; - PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR32; - - PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16; - PIX_FMT_RGB48 = AV_PIX_FMT_RGB48; - PIX_FMT_RGB565 = AV_PIX_FMT_RGB565; - PIX_FMT_RGB555 = AV_PIX_FMT_RGB555; - PIX_FMT_RGB444 = AV_PIX_FMT_RGB444; - PIX_FMT_BGR48 = AV_PIX_FMT_BGR48; - PIX_FMT_BGR565 = AV_PIX_FMT_BGR565; - PIX_FMT_BGR555 = AV_PIX_FMT_BGR555; - PIX_FMT_BGR444 = AV_PIX_FMT_BGR444; - - PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9; - PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9; - PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9; - PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10; - PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10; - PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10; - PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12; - PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12; - PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12; - PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14; - PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14; - PIX_FMT_YUV444P14 = AV_PIX_FMT_YUV444P14; - PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16; - PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16; - PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16; - - PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64; - PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64; - PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9; - PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10; - PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12; - PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14; - PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16; -{$ENDIF} - -type -(** - * Chromaticity coordinates of the source primaries. - *) - TAVColorPrimaries = ( - AVCOL_PRI_RESERVED0 = 0, - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_RESERVED = 3, - AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - -(** - * Color Transfer Characteristic. - *) - TAVColorTransferCharacteristic = ( - AVCOL_TRC_RESERVED0 = 0, - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_RESERVED = 3, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * YUV colorspace type. - *) - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_RESERVED = 3, - AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - -const - AVCOL_SPC_YCGCO = AVCOL_SPC_YCOCG; - -type -(** - * MPEG vs JPEG YUV range. - *) - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * Location of chroma samples. - * - * Illustration showing the location of the first (top left) chroma sample of the - * image, the left shows only luma, the right - * shows the location of the chroma sample, the 2 could be imagined to overlay - * each other but are drawn separately due to limitations of ASCII - * - * 1st 2nd 1st 2nd horizontal luma sample positions - * v v v v - * ______ ______ - *1st luma line > |X X ... |3 4 X ... X are luma samples, - * | |1 2 1-6 are possible chroma positions - *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4 4:2:0, h264 default for 4:2:0 - AVCHROMA_LOC_CENTER = 2, ///< mpeg1 4:2:0, jpeg 4:2:0, h263 4:2:0 - AVCHROMA_LOC_TOPLEFT = 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); diff --git a/src/lib/ffmpeg-2.8/libavutil/samplefmt.pas b/src/lib/ffmpeg-2.8/libavutil/samplefmt.pas deleted file mode 100644 index b5d5bb03..00000000 --- a/src/lib/ffmpeg-2.8/libavutil/samplefmt.pas +++ /dev/null @@ -1,286 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 54.7.100 - * - *) - -type -(** - * @addtogroup lavu_audio - * @ - * - * @defgroup lavu_sampfmts Audio sample formats - * - * Audio sample format enumeration and related convenience functions. - * @ - * - *) - -(** - * Audio sample formats - * - * - The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * - The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * @par - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - * - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * @ - * - * @defgroup lavu_sampmanip Samples manipulation - * - * Functions that manipulate audio samples - * @ - *) - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-2.8/rational.pas b/src/lib/ffmpeg-2.8/rational.pas deleted file mode 100644 index 0c795c54..00000000 --- a/src/lib/ffmpeg-2.8/rational.pas +++ /dev/null @@ -1,241 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 54.7.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-2.8/swresample.pas b/src/lib/ffmpeg-2.8/swresample.pas deleted file mode 100644 index de805724..00000000 --- a/src/lib/ffmpeg-2.8/swresample.pas +++ /dev/null @@ -1,434 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 0.18.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 2; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 101; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 1; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 2; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type -(** Dithering algorithms *) - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - -(** Resampling Engines *) - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - -(** Resampling Filter Types *) - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall Windowed Sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser Windowed Sinc *) - ); - -(** - * The libswresample context. Unlike libavcodec and libavformat, this structure - * is opaque. This means that if you would like to set options, you must use - * the @ref avoptions API and cannot directly set values to members of the - * structure. - *) - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * - * @param[in,out] s Swr context to initialize - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @param[in] s Swr context to check - * @see swr_init() - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - * - * @param[in] s a pointer to a pointer to Swr context - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Closes the context so that swr_is_initialized() returns 0. - * - * The context can be brought back to life by running swr_init(), - * swr_init() can also be used without swr_close(). - * This function is mainly provided for simplifying the usecase - * where one tries to support libavresample and libswresample. - * - * @param[in,out] s Swr context to be closed - *) -procedure swr_close(s: PSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space, then the input will be buffered. - * You can avoid this buffering by using swr_get_out_samples() to retrieve an - * upper bound on the required number of output samples for the given number of - * input samples. Conversion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - var in_: {const} PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation ("soft" compensation). This function is - * internally called when needed in swr_next_pts(). - * - * @param[in,out] s allocated Swr context. If it is not initialized, - * or SWR_FLAG_RESAMPLE is not set, swr_init() is - * called with the flag set. - * @param[in] sample_delta delta in PTS per sample - * @param[in] compensation_distance number of samples to compensate for - * @return >= 0 on success, AVERROR error codes if: - * @li @c s is NULL, - * @li @c compensation_distance is less than 0, - * @li @c compensation_distance is 0 but sample_delta is not, - * @li compensation unsupported by resampler, or - * @li swr_init() fails when called. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param[in,out] s allocated Swr context, not yet initialized - * @param[in] channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - * - * This function, along with swr_inject_silence(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - * - * This function, along with swr_drop_output(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be: - * @li if it's set to 1 the returned delay is in seconds - * @li if it's set to 1000 the returned delay is in milliseconds - * @li if it's set to the input sample rate then the returned - * delay is in input samples - * @li if it's set to the output sample rate then the returned - * delay is in output samples - * @li if it's the least common multiple of in_sample_rate and - * out_sample_rate then an exact rounding-free delay will be - * returned - * @returns the delay in 1 / @c base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Find an upper bound on the number of samples that the next swr_convert - * call will output, if called with in_samples of input samples. This - * depends on the internal state, and anything changing the internal state - * (like further swr_convert() calls) will may change the number of samples - * swr_get_out_samples() returns for the same number of input samples. - * - * @param in_samples number of input samples. - * @note any call to swr_inject_silence(), swr_convert(), swr_next_pts() - * or swr_set_compensation() invalidates this limit - * @note it is recommended to pass the correct available buffer size - * to all functions like swr_convert() even if swr_get_out_samples() - * indicates that less would be used. - * @returns an upper bound on the number of samples that the next swr_convert - * will output or a negative value to indicate an error - *) -function swr_get_out_samples(s: PSwrContext; in_samples: cint): cint; - cdecl; external sw__resample; - -(** - * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. - * - * This is useful to check if the build-time libswresample has the same version - * as the run-time one. - * - * @returns the unsigned int-typed version - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - * - * @returns the build-time @c ./configure flags - *) -function swresample_configuration(): PAnsiChar; - cdecl; external sw__resample; - -(** - * Return the swr license. - * - * @returns the license of libswresample, determined at build-time - *) -function swresample_license(): PAnsiChar; - cdecl; external sw__resample; - -implementation - -end. - diff --git a/src/lib/ffmpeg-2.8/swscale.pas b/src/lib/ffmpeg-2.8/swscale.pas deleted file mode 100644 index 19cdfe7d..00000000 --- a/src/lib/ffmpeg-2.8/swscale.pas +++ /dev/null @@ -1,496 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 3.0.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 3; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 101; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(* libswscale/version.h start *) - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) -{$ifndef FF_API_SWS_GETCONTEXT} -{$define FF_API_SWS_GETCONTEXT := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_CPU_CAPS} -{$define FF_API_SWS_CPU_CAPS := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} -{$ifndef FF_API_SWS_FORMAT_NAME} -{$define FF_API_SWS_FORMAT_NAME := (LIBSWSCALE_VERSION_MAJOR < 3)} -{$endif} - -(* libswscale/version.h end *) - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - -{$IFDEF FF_API_SWS_CPU_CAPS} -(** - * CPU caps are autodetected now, those flags - * are only provided for API compatibility. - *) - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMXEXT = $20000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; -{$IFDEF FF_API_ARCH_BFIN} - SWS_CPU_CAPS_BFIN = $01000000; -{$IFEND} - SWS_CPU_CAPS_SSE2 = $02000000; -{$IFEND} - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @param param extra parameters to tune the used scaler - * For SWS_BICUBIC param[0] and [1] tune the shape of the basis - * function, param[0] tunes f(1) and param[1] f´(1) - * For SWS_GAUSS param[0] tunes the exponent and thus cutoff - * frequency - * For SWS_LANCZOS param[0] tunes the width of the window function - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: {const} PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-3.0/How to update the ffmpeg files.txt b/src/lib/ffmpeg-3.0/How to update the ffmpeg files.txt deleted file mode 100644 index ae65d477..00000000 --- a/src/lib/ffmpeg-3.0/How to update the ffmpeg files.txt +++ /dev/null @@ -1,20 +0,0 @@ -how to update the ffmpeg files: - -1) buffer.pas - cpu.pas - dict.pas - error.pas - frame.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas - swresample.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-3.0/ToDo.txt b/src/lib/ffmpeg-3.0/ToDo.txt deleted file mode 100644 index b0bd305e..00000000 --- a/src/lib/ffmpeg-3.0/ToDo.txt +++ /dev/null @@ -1,112 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog - - -FFmpeg 3.0 changes: -2016-02-10 - bc9a596 / 9f61abc - lavf 57.25.100 / 57.3.0 - avformat.h - Add AVFormatContext.opaque, io_open and io_close, allowing custom IO - -2016-02-01 - 1dba837 - lavf 57.24.100 - avformat.h, avio.h - Add protocol_whitelist to AVFormatContext, AVIOContext - -2016-01-31 - 66e9d2f - lavu 55.17.100 - frame.h - Add AV_FRAME_DATA_GOP_TIMECODE for exporting MPEG1/2 GOP timecodes. - -2016-01-01 - 5e8b053 / 2c68113 - lavc 57.21.100 / 57.12.0 - avcodec.h - Add AVCodecDescriptor.profiles and avcodec_profile_name(). - -2015-12-28 - 1f9139b - lavf 57.21.100 - avformat.h - Add automatic bitstream filtering; add av_apply_bitstream_filters() - -2015-12-22 - 39a09e9 - lavfi 6.21.101 - avfilter.h - Deprecate avfilter_link_set_closed(). - Applications are not supposed to mess with links, - they should close the sinks. - -2015-12-17 - lavc 57.18.100 / 57.11.0 - avcodec.h dirac.h - xxxxxxx - Add av_packet_add_side_data(). - xxxxxxx - Add AVCodecContext.coded_side_data. - xxxxxxx - Add AVCPBProperties API. - xxxxxxx - Add a new public header dirac.h containing - av_dirac_parse_sequence_header() - -2015-12-11 - 676a93f - lavf 57.20.100 - avformat.h - Add av_program_add_stream_index() - -2015-11-29 - 93fb4a4 - lavc 57.16.101 - avcodec.h - Deprecate rtp_callback without replacement, i.e. it won't be possible to - get image slices before the full frame is encoded any more. The libavformat - rtpenc muxer can still be used for RFC-2190 packetization. - -2015-11-22 - fe20e34 - lavc 57.16.100 - avcodec.h - Add AV_PKT_DATA_FALLBACK_TRACK for making fallback associations between - streams. - -2015-11-22 - ad317c9 - lavf 57.19.100 - avformat.h - Add av_stream_new_side_data(). - -2015-11-22 - e12f403 - lavu 55.8.100 - xtea.h - Add av_xtea_le_init and av_xtea_le_crypt - -2015-11-18 - lavu 55.7.100 - mem.h - Add av_fast_mallocz() - -2015-10-29 - lavc 57.12.100 / 57.8.0 - avcodec.h - xxxxxx - Deprecate av_free_packet(). Use av_packet_unref() as replacement, - it resets the packet in a more consistent way. - xxxxxx - Deprecate av_dup_packet(), it is a no-op for most cases. - Use av_packet_ref() to make a non-refcounted AVPacket refcounted. - xxxxxx - Add av_packet_alloc(), av_packet_clone(), av_packet_free(). - They match the AVFrame functions with the same name. - -2015-10-27 - 1e477a9 - lavu 55.5.100 - cpu.h - Add AV_CPU_FLAG_AESNI. - -2015-10-22 - ee573b4 / a17a766 - lavc 57.9.100 / 57.5.0 - avcodec.h - Add data and linesize array to AVSubtitleRect, to be used instead of - the ones from the embedded AVPicture. - -2015-10-22 - 866a417 / dc923bc - lavc 57.8.100 / 57.0.0 - qsv.h - Add an API for allocating opaque surfaces. - -2015-10-15 - 2c2d162 - lavf 57.4.100 - Remove the latm demuxer that was a duplicate of the loas demuxer. - -2015-10-14 - b994788 / 11c5f43 - lavu 55.4.100 / 55.2.0 - dict.h - Change return type of av_dict_copy() from void to int, so that a proper - error code can be reported. - -2015-09-29 - b01891a / 948f3c1 - lavc 57.3.100 / 57.2.0 - avcodec.h - Change type of AVPacket.duration from int to int64_t. - -2015-09-17 - 7c46f24 / e3d4784 - lavc 57.3.100 / 57.2.0 - d3d11va.h - Add av_d3d11va_alloc_context(). This function must from now on be used for - allocating AVD3D11VAContext. - -2015-09-15 - lavf 57.2.100 - avformat.h - probesize and max_analyze_duration switched to 64bit, both - are only accessible through AVOptions - -2015-09-15 - lavf 57.1.100 - avformat.h - bit_rate was changed to 64bit, make sure you update any - printf() or other type sensitive code - -2015-09-15 - lavc 57.2.100 - avcodec.h - bit_rate/rc_max_rate/rc_min_rate were changed to 64bit, make sure you update - any printf() or other type sensitive code - -2015-09-07 - lavu 55.0.100 / 55.0.0 - c734b34 / b8b5d82 - Change type of AVPixFmtDescriptor.flags from uint8_t to uint64_t. - f53569a / 6b3ef7f - Change type of AVComponentDescriptor fields from uint16_t to int - and drop bit packing. - 151aa2e / 2268db2 - Add step, offset, and depth to AVComponentDescriptor to replace - the deprecated step_minus1, offset_plus1, and depth_minus1. \ No newline at end of file diff --git a/src/lib/ffmpeg-3.0/avcodec.pas b/src/lib/ffmpeg-3.0/avcodec.pas deleted file mode 100644 index d047f870..00000000 --- a/src/lib/ffmpeg-3.0/avcodec.pas +++ /dev/null @@ -1,6086 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 56.1.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 57; - LIBAVCODEC_MAX_VERSION_MINOR = 24; - LIBAVCODEC_MAX_VERSION_RELEASE = 102; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 57; - LIBAVCODEC_MIN_VERSION_MINOR = 24; - LIBAVCODEC_MIN_VERSION_RELEASE = 102; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. it is as close as possible to similar codecs - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1 = AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130, - AV_CODEC_ID_G2M, - AV_CODEC_ID_WEBP, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX, - AV_CODEC_ID_PAF_VIDEO, - AV_CODEC_ID_EXR, - AV_CODEC_ID_VP7, - AV_CODEC_ID_SANM, - AV_CODEC_ID_SGIRLE, - AV_CODEC_ID_MVC1, - AV_CODEC_ID_MVC2, - AV_CODEC_ID_HQX, - AV_CODEC_ID_TDSC, - AV_CODEC_ID_HQ_HQA, - AV_CODEC_ID_HAP, - AV_CODEC_ID_DDS, - AV_CODEC_ID_DXV, - AV_CODEC_ID_SCREENPRESSO, - AV_CODEC_ID_RSCC, - - AV_CODEC_ID_Y41P = $8000, - AV_CODEC_ID_AVRP, - AV_CODEC_ID_012V, - AV_CODEC_ID_AVUI, - AV_CODEC_ID_AYUV, - AV_CODEC_ID_TARGA_Y216, - AV_CODEC_ID_V308, - AV_CODEC_ID_V408, - AV_CODEC_ID_YUV4, - AV_CODEC_ID_AVRN, - AV_CODEC_ID_CPIA, - AV_CODEC_ID_XFACE, - AV_CODEC_ID_SNOW, - AV_CODEC_ID_SMVJPEG, - AV_CODEC_ID_APNG, - AV_CODEC_ID_DAALA, - AV_CODEC_ID_CFHD, - //* various PCM "codecs" */ - AV_CODEC_ID_FIRST_AUDIO = $10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, - AV_CODEC_ID_PCM_S24LE_PLANAR, - AV_CODEC_ID_PCM_S32LE_PLANAR, - AV_CODEC_ID_PCM_S16BE_PLANAR, - (* new PCM "codecs" should be added right below this line starting with - * an explicit value of for example 0x10800 - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA, -{$IFDEF FF_API_VIMA_DECODER} - AV_CODEC_ID_VIMA = AV_CODEC_ID_ADPCM_VIMA, -{$IFEND} - AV_CODEC_ID_ADPCM_AFC = $11800, - AV_CODEC_ID_ADPCM_IMA_OKI, - AV_CODEC_ID_ADPCM_DTK, - AV_CODEC_ID_ADPCM_IMA_RAD, - AV_CODEC_ID_ADPCM_G726LE, - AV_CODEC_ID_ADPCM_THP_LE, - AV_CODEC_ID_ADPCM_PSX, - AV_CODEC_ID_ADPCM_AICA, - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - AV_CODEC_ID_SDX2_DPCM = $14800, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK, - AV_CODEC_ID_PAF_AUDIO, - AV_CODEC_ID_ON2AVC, - AV_CODEC_ID_DSS_SP, - - AV_CODEC_ID_FFWAVESYNTH = $15800, - AV_CODEC_ID_SONIC, - AV_CODEC_ID_SONIC_LS, - AV_CODEC_ID_EVRC, - AV_CODEC_ID_SMV, - AV_CODEC_ID_DSD_LSBF, - AV_CODEC_ID_DSD_MSBF, - AV_CODEC_ID_DSD_LSBF_PLANAR, - AV_CODEC_ID_DSD_MSBF_PLANAR, - AV_CODEC_ID_4GV, - AV_CODEC_ID_INTERPLAY_ACM, - AV_CODEC_ID_XMA1, - AV_CODEC_ID_XMA2, - - //* subtitle codecs */ - AV_CODEC_ID_FIRST_SUBTITLE = $17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, - AV_CODEC_ID_MICRODVD = $17800, - AV_CODEC_ID_EIA_608, - AV_CODEC_ID_JACOSUB, - AV_CODEC_ID_SAMI, - AV_CODEC_ID_REALTEXT, - AV_CODEC_ID_STL, - AV_CODEC_ID_SUBVIEWER1, - AV_CODEC_ID_SUBVIEWER, - AV_CODEC_ID_SUBRIP, - AV_CODEC_ID_WEBVTT, - AV_CODEC_ID_MPL2, - AV_CODEC_ID_VPLAYER, - AV_CODEC_ID_PJS, - AV_CODEC_ID_ASS, - AV_CODEC_ID_HDMV_TEXT_SUBTITLE, - - //* other specific kind of codecs (generally used for attachments) */ - AV_CODEC_ID_FIRST_UNKNOWN = $18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, - - AV_CODEC_ID_BINTEXT = $18800, - AV_CODEC_ID_XBIN, - AV_CODEC_ID_IDF, - AV_CODEC_ID_OTF, - AV_CODEC_ID_SMPTE_KLV, - AV_CODEC_ID_DVD_NAV, - AV_CODEC_ID_TIMED_ID3, - AV_CODEC_ID_BIN_DATA, - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - AV_CODEC_ID_WRAPPED_AVFRAME = $21001 ///< Passthrough codec, AVFrames wrapped in AVPacket - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_descriptor_get() - *) -type - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - - (** - * MIME type(s) associated with the codec. - * May be NULL; if not, a NULL-terminated array of MIME types. - * The first item is always non-NULL and is the preferred MIME type. - *) - mime_types: PAnsiChar; - - (** - * If non-NULL, an array of profiles recognized for this codec. - * Terminated with FF_PROFILE_UNKNOWN. - *) - profiles: PAVProfile; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Codec supports frame reordering. That is, the coded order (the order in which - * the encoded packets are output by the encoders / stored / input to the - * decoders) may be different from the presentation order of the corresponding - * frames. - * - * For codecs that do not have this property set, PTS and DTS should always be - * equal. - *) - AV_CODEC_PROP_REORDER = 1 << 3; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - AV_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - AV_INPUT_BUFFER_MIN_SIZE = 16384; - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead - *) - FF_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead - *) - FF_MIN_BUFFER_SIZE = 16384; -{$ENDIF} - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - * @deprecated use codec private option instead - *) -{$IFDEF FF_API_MOTION_EST} - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); -{$ENDIF} - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONINTRA= 24, ///< discard all non intra frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{ removed, kept for the moment - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -} - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - AV_CODEC_FLAG_UNALIGNED = $0001; // (1 << 0) -(** - * Use fixed qscale. - *) - AV_CODEC_FLAG_QSCALE = $0002; // (1 << 1) -(** - * 4 MV per MB allowed / advanced prediction for H.263. - *) - AV_CODEC_FLAG_4MV = $0004; // (1 << 2) -(** - * Output even those frames that might be corrupted. - *) - AV_CODEC_FLAG_OUTPUT_CORRUPT = $0008; // (1 << 3) -(** - * Use qpel MC. - *) - AV_CODEC_FLAG_QPEL = $0010; // (1 << 4) -(** - * Use internal 2pass ratecontrol in first pass mode. - *) - AV_CODEC_FLAG_PASS1 = $0200; // (1 << 9) -(** - * Use internal 2pass ratecontrol in second pass mode. - *) - AV_CODEC_FLAG_PASS2 = $0400; // (1 << 10) -(** - * loop filter. - *) - AV_CODEC_FLAG_LOOP_FILTER = $0800; // (1 << 11) -(** - * Only decode/encode grayscale. - *) - AV_CODEC_FLAG_GRAY = $2000; // (1 << 13) -(** - * error[?] variables will be set during encoding. - *) - AV_CODEC_FLAG_PSNR = $8000; // (1 << 15) -(** - * Input bitstream might be truncated at a random location - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG_TRUNCATED = $10000; // (1 << 16) -(** - * Use interlaced DCT. - *) - AV_CODEC_FLAG_INTERLACED_DCT = $40000; // (1 << 18) -(** - * Force low delay. - *) - AV_CODEC_FLAG_LOW_DELAY = $80000; // (1 << 19) -(** - * Place global headers in extradata instead of every keyframe. - *) - AV_CODEC_FLAG_GLOBAL_HEADER = $400000; // (1 << 22) -(** - * Use only bitexact stuff (except (I)DCT). - *) - AV_CODEC_FLAG_BITEXACT = $800000; // (1 << 23) -(* Fx : Flag for h263+ extra options *) -(** - * H.263 advanced intra coding / MPEG-4 AC prediction - *) - AV_CODEC_FLAG_AC_PRED = $1000000; // (1 << 24) -(** - * interlaced motion estimation - *) - AV_CODEC_FLAG_INTERLACED_ME = $20000000; // (1 << 29) - AV_CODEC_FLAG_CLOSED_GOP = $80000000; // (1U << 31) - -(** - * Allow non spec compliant speedup tricks. - *) - AV_CODEC_FLAG2_FAST = $0001; // (1 << 0) -(** - * Skip bitstream encoding. - *) - AV_CODEC_FLAG2_NO_OUTPUT = $0004; // (1 << 2) -(** - * Place global headers at every keyframe instead of in extradata. - *) - AV_CODEC_FLAG2_LOCAL_HEADER = $0008; // (1 << 3) - -(** - * timecode is in drop frame format. DEPRECATED!!!! - *) - AV_CODEC_FLAG2_DROP_FRAME_TIMECODE = $2000; // (1 << 13) - -(** - * Input bitstream might be truncated at a packet boundaries - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG2_CHUNKS = $8000; // (1 << 15) -(** - * Discard cropping information from SPS. - *) - AV_CODEC_FLAG2_IGNORE_CROP = $10000; // (1 << 16) - -(** - * Show all frames before the first keyframe - *) - AV_CODEC_FLAG2_SHOW_ALL = $400000; // (1 << 22) -(** - * Export motion vectors through frame side data - *) - AV_CODEC_FLAG2_EXPORT_MVS = $10000000; // (1 << 28) -(** - * Do not skip samples and export skip information as frame side data - *) - AV_CODEC_FLAG2_SKIP_MANUAL = $20000000; // (1 << 29) - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independent Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - -(** - * Decoder can use draw_horiz_band callback. - *) - AV_CODEC_CAP_DRAW_HORIZ_BAND = $0001; // (1 << 0) -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - AV_CODEC_CAP_DR1 = $0002; // (1 << 1) - AV_CODEC_CAP_TRUNCATED = $0008; // (1 << 3) -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - AV_CODEC_CAP_DELAY = $0020; // (1 << 5) -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - AV_CODEC_CAP_SMALL_LAST_FRAME = $0040; // (1 << 6) - -{$IFDEF FF_API_CAP_VDPAU} -(** - * Codec can export data for HW decoding (VDPAU). - *) - AV_CODEC_CAP_HWACCEL_VDPAU = $0080; // (1 << 7) -{$ENDIF} - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - AV_CODEC_CAP_SUBFRAMES = $0100; // (1 << 8) -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - AV_CODEC_CAP_EXPERIMENTAL = $0200; // (1 << 9) -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - AV_CODEC_CAP_CHANNEL_CONF = $0400; // (1 << 10) -(** - * Codec supports frame-level multithreading. - *) - AV_CODEC_CAP_FRAME_THREADS = $1000; // (1 << 12) -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - AV_CODEC_CAP_SLICE_THREADS = $2000; // (1 << 13) -(** - * Codec supports changed parameters at any point. - *) - AV_CODEC_CAP_PARAM_CHANGE = $4000; // (1 << 14) -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - AV_CODEC_CAP_AUTO_THREADS = $8000; // (1 << 15) -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - AV_CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; // (1 << 16) -(** - * Codec is intra only. - *) - AV_CODEC_CAP_INTRA_ONLY = $40000000; -(** - * Codec is lossless. - *) - AV_CODEC_CAP_LOSSLESS = $80000000; - - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = AV_CODEC_FLAG_UNALIGNED; - CODEC_FLAG_QSCALE = AV_CODEC_FLAG_QSCALE; - CODEC_FLAG_4MV = AV_CODEC_FLAG_4MV; - CODEC_FLAG_OUTPUT_CORRUPT = AV_CODEC_FLAG_OUTPUT_CORRUPT; - CODEC_FLAG_QPEL = AV_CODEC_FLAG_QPEL; -{$IFDEF FF_API_GMC} -(** - * @deprecated use the "gmc" private option of the libxvid encoder - *) - CODEC_FLAG_GMC = $0020; ///< use GMC. -{$IFEND} -{$IFDEF FF_API_MV0} -(** - * @deprecated use the flag "mv0" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. -{$IFEND} -{$IFDEF FF_API_INPUT_PRESERVED} -(** - * @deprecated passing reference-counted frames to the encoders replaces this - * flag - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; -{$IFEND} - CODEC_FLAG_PASS1 = AV_CODEC_FLAG_PASS1; - CODEC_FLAG_PASS2 = AV_CODEC_FLAG_PASS2; - CODEC_FLAG_GRAY = AV_CODEC_FLAG_GRAY; -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = AV_CODEC_FLAG_PSNR; - CODEC_FLAG_TRUNCATED = AV_CODEC_FLAG_TRUNCATED; - -{$IFDEF FF_API_NORMALIZE_AQP} -(** - * @deprecated use the flag "naq" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization -{$IFEND} - CODEC_FLAG_INTERLACED_DCT = AV_CODEC_FLAG_INTERLACED_DCT; - CODEC_FLAG_LOW_DELAY = AV_CODEC_FLAG_LOW_DELAY; - CODEC_FLAG_GLOBAL_HEADER = AV_CODEC_FLAG_GLOBAL_HEADER; - CODEC_FLAG_BITEXACT = AV_CODEC_FLAG_BITEXACT; - CODEC_FLAG_AC_PRED = AV_CODEC_FLAG_AC_PRED; - CODEC_FLAG_LOOP_FILTER = AV_CODEC_FLAG_LOOP_FILTER; - CODEC_FLAG_INTERLACED_ME = AV_CODEC_FLAG_INTERLACED_ME; - CODEC_FLAG_CLOSED_GOP = AV_CODEC_FLAG_CLOSED_GOP; - CODEC_FLAG2_FAST = AV_CODEC_FLAG2_FAST; - CODEC_FLAG2_NO_OUTPUT = AV_CODEC_FLAG2_NO_OUTPUT; - CODEC_FLAG2_LOCAL_HEADER = AV_CODEC_FLAG2_LOCAL_HEADER; - CODEC_FLAG2_DROP_FRAME_TIMECODE = AV_CODEC_FLAG2_DROP_FRAME_TIMECODE; - CODEC_FLAG2_IGNORE_CROP = AV_CODEC_FLAG2_IGNORE_CROP; - - CODEC_FLAG2_CHUNKS = AV_CODEC_FLAG2_CHUNKS; - CODEC_FLAG2_SHOW_ALL = AV_CODEC_FLAG2_SHOW_ALL; - CODEC_FLAG2_EXPORT_MVS = AV_CODEC_FLAG2_EXPORT_MVS; - CODEC_FLAG2_SKIP_MANUAL = AV_CODEC_FLAG2_SKIP_MANUAL; - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = AV_CODEC_CAP_DRAW_HORIZ_BAND; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = AV_CODEC_CAP_DR1; - CODEC_CAP_TRUNCATED = AV_CODEC_CAP_TRUNCATED; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = AV_CODEC_CAP_DELAY; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = AV_CODEC_CAP_SMALL_LAST_FRAME; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = AV_CODEC_CAP_HWACCEL_VDPAU; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = AV_CODEC_CAP_SUBFRAMES; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = AV_CODEC_CAP_EXPERIMENTAL; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = AV_CODEC_CAP_CHANNEL_CONF; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = AV_CODEC_CAP_FRAME_THREADS; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = AV_CODEC_CAP_SLICE_THREADS; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = AV_CODEC_CAP_PARAM_CHANGE; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = AV_CODEC_CAP_AUTO_THREADS; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = AV_CODEC_CAP_VARIABLE_FRAME_SIZE; - -(** - * Codec is intra only. - *) - CODEC_CAP_INTRA_ONLY = AV_CODEC_CAP_INTRA_ONLY; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = AV_CODEC_CAP_LOSSLESS; -{$ENDIF} (* FF_API_WITHOUT_PREFIX *) - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note: AVPanScan is now (28/09/2014) defined in libavutil/frame.pas to workaround a reference problem *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - -{$IFDEF FF_API_RC_STRATEGY} - FF_RC_STRATEGY_XVID = 1; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; -{$ENDIF} - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - -{$IFDEF FF_API_AFD} - {attribute_deprecated} - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; -{$IFEND} - -{$IFDEF FF_API_QUANT_BIAS} - FF_DEFAULT_QUANT_BIAS = 999999; -{$ENDIF} - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - -{$IFDEF FF_API_CODER_TYPE} - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_CODER_TYPE_DEFLATE = 4; -{$ENDIF} {FF_API_UNUSED_MEMBERS} -{$ENDIF} {FF_API_CODER_TYPE} - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - FF_EC_FAVOR_INTER = 256; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DEBUG_PTS = $00000200; -{$ENDIF} - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; ///< only access through AVOptions from outside libavcodec - FF_DEBUG_VIS_MB_TYPE = $00004000; ///< only access through AVOptions from outside libavcodec -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - FF_DEBUG_GREEN_MD = $00800000; - FF_DEBUG_NOMC = $01000000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; ///< detect bitstream specification deviations - AV_EF_BUFFER = 4; ///< detect improper bitstream length - AV_EF_EXPLODE = 8; ///< abort decoding on minor error detection - - AV_EF_IGNORE_ERR = 32768; ///< ignore errors and continue - AV_EF_CAREFUL = 65536; ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors - AV_EF_COMPLIANT = 131072; ///< consider all spec non compliances as errors - AV_EF_AGGRESSIVE = 262144; ///< consider things that a sane encoder should not do as an error - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; -{$IFDEF FF_API_ARCH_SH4} - FF_IDCT_SH4 = 9; -{$ENDIF} - FF_IDCT_SIMPLEARM = 10; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_IDCT_IPP = 13; -{$ENDIF} - FF_IDCT_XVID = 14; -{$IFDEF FF_API_IDCT_XVIDMMX} - FF_IDCT_XVIDMMX = 14; -{$ENDIF} - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; -{$IFDEF FF_API_ARCH_SPARC} - FF_IDCT_SIMPLEVIS = 18; -{$ENDIF} - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - FF_IDCT_SIMPLEAUTO = 128; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_DTS_EXPRESS = 70; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 1; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 2; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_VP9_0 = 0; - FF_PROFILE_VP9_1 = 1; - FF_PROFILE_VP9_2 = 2; - FF_PROFILE_VP9_3 = 3; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - FF_PROFILE_HEVC_REXT = 4; - - - FF_LEVEL_UNKNOWN = -99; - -type - - (** - * This structure describes the bitrate properties of an encoded bitstream. It - * roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD - * parameters for H.264/HEVC. - *) - PAVCPBProperties = ^TAVCPBProperties; - TAVCPBProperties = record - (** - * Maximum bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - max_bitrate: cint; - (** - * Minimum bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - min_bitrate: cint; - (** - * Average bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - avg_bitrate: cint; - - (** - * The size of the buffer to which the ratecontrol is applied, in bits. - * Zero if unknown or unspecified. - *) - buffer_size: cint; - - (** - * The delay between the time the packet this structure is associated with - * is received and the time when it should be decoded, in periods of a 27MHz - * clock. - * - * UINT64_MAX when unknown or unspecified. - *) - vbv_delay: cuint64; - end; {TAVCPBProperties} - - TAVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * This side data should be associated with an audio stream and contains - * ReplayGain information in form of the AVReplayGain struct. - *) - AV_PKT_DATA_REPLAYGAIN, - - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the decoded video frames for - * correct presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_PKT_DATA_DISPLAYMATRIX, - - (** - * This side data should be associated with a video stream and contains - * Stereoscopic 3D information in form of the AVStereo3D struct. - *) - AV_PKT_DATA_STEREO3D, - - (** - * This side data should be associated with an audio stream and corresponds - * to enum AVAudioServiceType. - *) - AV_PKT_DATA_AUDIO_SERVICE_TYPE, - - (** - * This side data contains quality related information from the encoder. - * @code - * u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad). - * u8 picture type - * u8 error count - * u16 reserved - * u64le[error count] sum of squared differences between encoder in and output - * @endcode - *) - AV_PKT_DATA_QUALITY_STATS, - - (** - * This side data contains an integer value representing the stream index - * of a "fallback" track. A fallback track indicates an alternate - * track to use when the current track can not be decoded for some reason. - * e.g. no decoder available for codec. - *) - AV_PKT_DATA_FALLBACK_TRACK, - - (** - * This side data corresponds to the AVCPBProperties struct. - *) - AV_PKT_DATA_CPB_PROPERTIES, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE - ); - - PAVPacketSideData = ^TAVPacketSideData; - TAVPacketSideData = record - data: PByte; - size: cint; - type_: TAVPacketSideDataType; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. Encoders are allowed to output empty - * packets, with no compressed data, containing only side data - * (e.g. to update some stream parameters at the end of encoding). - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf field. - * If it is set, the packet data is dynamically allocated and is - * valid indefinitely until a call to av_packet_unref() reduces the - * reference count to 0. - * - * If the buf field is not set av_packet_ref() would make a copy instead - * of increasing the reference count. - * - * The side data is always allocated with av_malloc(), copied by - * av_packet_ref() and freed by av_packet_unref(). - * - * @see av_packet_ref - * @see av_packet_unref - *) - PPAVPacket= ^PAVPacket; - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideData; - side_data_elems: cint; - - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint64; - - pos: cint64; // byte position in stream, -1 if unknown - -{$IFDEF FF_API_CONVERGENCE_DURATION} - (* - * @deprecated Same as the duration field, but as int64_t. This was required - * for Matroska subtitles, whose duration values could overflow when the - * duration field was still an int. - *) - convergence_duration: cint64; {deprecated} -{$ENDIF} - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - - AV_PKT_DATA_QUALITY_FACTOR = AV_PKT_DATA_QUALITY_STATS; //DEPRECATED - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; -{$IFDEF FF_API_CODEC_NAME} - (** - * @deprecated this field is not used for anything in libavcodec - *) - {attribute_deprecated} - codec_name: array [0..31] of AnsiChar; -{$IFEND} - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - -{$IFDEF FF_API_STREAM_CODEC_TAG} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - stream_codec_tag: cuint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by user, may be overwritten by libavcodec - * if this info is available in the stream - *) - bit_rate: cint64; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * AV_CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * AV_CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be AV_FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * This often, but not always is the inverse of the frame rate or field rate - * for video. - * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this field is unused (see initial_padding). - * - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - * @note Those fields may not match the values of the last - * AVFrame outputted by avcodec_decode_video2 due frame - * reordering. - * - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - * @note Those field may not match the value of the last - * AVFrame outputted by avcodec_decode_video2 due frame - * reordering. - * - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - * @note This field may not match the value of the last - * AVFrame outputted by avcodec_decode_video2 due frame - * reordering. - * - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec while - * parsing the data. - *) - pix_fmt: TAVPixelFormat; - -{$IFDEF FF_API_MOTION_EST} - (** - * This option does nothing - *@deprecated use codec private options instead - *) - {attribute_deprecated} - me_method: cint; -{$ENDIF} - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @note The callback may be called again immediately if initialization for - * the selected (hardware-accelerated) pixel format failed. - * @warning Behavior is undefined if the callback returns a value not - * in the fmt list of formats. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - -{$IFDEF FF_API_RC_STRATEGY} - (** @deprecated use codec private option instead *) - {attribute_deprecated} - rc_strategy: cint; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - b_frame_strategy: cint; {deprecated} -{$ENDIF} - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - mpeg_quant: cint; {deprecated} -{$ENDIF} - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - prediction_method: cint; {deprecated} -{$ENDIF} - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - pre_me: cint; {deprecated} -{$ENDIF} - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - -{$IFDEF FF_API_AFD} - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - * @deprecated Deprecated in favor of AVSideData - *) - {attribute_deprecated} - dtg_active_format: cint; -{$IFEND} - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - -{$IFDEF FF_API_QUANT_BIAS} - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - intra_quant_bias: cint; - - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - inter_quant_bias: cint; -{$ENDIF} - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - scenechange_threshold: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - noise_reduction: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - me_threshold: cint; - - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - mb_threshold: cint; -{$ENDIF} - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: Set by libavcodec - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - border_masking: cfloat; -{$ENDIF} - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** - * @deprecated use encoder private options instead - *) - me_penalty_compensation: cint; {deprecated} -{$ENDIF} - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - brd_scale: cint; {deprecated} -{$ENDIF} - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - chromaoffset: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_UNUSED_MEMBERS} - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; {attribute_deprecated} -{$IFEND} - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - b_sensitivity: cint; {deprecated} -{$ENDIF} - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise exended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_qsquish: cfloat; - - {attribute_deprecated} - rc_qmod_amp: cfloat; - {attribute_deprecated} - rc_qmod_freq: cint; -{$ENDIF} - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_eq: {const} PAnsiChar; -{$ENDIF} - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: Set by user, may be overwritten by libavcodec. - *) - rc_max_rate: cint64; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint64; - -{$IFDEF FF_API_MPV_OPT} - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_buffer_aggressivity: cfloat; - - {attribute_deprecated} - rc_initial_cplx: cfloat; -{$ENDIF} - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - -{$IFDEF FF_API_CODER_TYPE} - (** - * @deprecated use encoder private options instead - *) - coder_type: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - context_model: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmin: cint; - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmax: cint; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - frame_skip_threshold: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_factor: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_exp: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_cmp: cint; {deprecated} -{$ENDIF} - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - min_prediction_order: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - max_prediction_order: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - timecode_frame_start: cint64; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_RTP_CALLBACK} - (** - * @deprecated unused - *) - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - rtp_payload_size: cint; {deprecated} (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) -{$ENDIF} - -{$IFDEF FF_API_STAT_BITS} - (* statistics, used for 2-pass encoding *) - mv_bits: cint; {deprecated} - header_bits: cint; {deprecated} - i_tex_bits: cint; {deprecated} - p_tex_bits: cint; {deprecated} - i_count: cint; {deprecated} - p_count: cint; {deprecated} - skip_count: cint; {deprecated} - misc_bits: cint; {deprecated} - - (** @deprecated this field is unused *) - frame_bits: cint; {deprecated} -{$ENDIF} - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - -{$IFDEF FF_API_CODED_FRAME} - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - * - * @deprecated use the quality factor packet side data instead - *) - {attribute_deprecated} - coded_frame: PAVFrame; -{$ENDIF} - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_VBV_DELAY} - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - * @deprecated this value is now exported as a part of - * AV_PKT_DATA_CPB_PROPERTIES packet side data - *) - vbv_delay: cuint64; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_SIDEDATA_ONLY_PKT} - (** - * Encoding only and set by default. Allow encoders to output packets - * that do not contain any encoded data, only side data. - * - * Some encoders need to output such packets, e.g. to update some stream - * parameters at the end of encoding. - * - * @deprecated this field disables the default behaviour and - * it is kept only for compatibility. - *) - side_data_only_packets: cint; {deprecated} -{$ENDIF} - - (** - * Audio only. The number of "priming" samples (padding) inserted by the - * encoder at the beginning of the audio. I.e. this number of leading - * decoded samples must be discarded by the caller to get the original audio - * without leading padding. - * - * - decoding: unused - * - encoding: Set by libavcodec. The timestamps on the output packets are - * adjusted by the encoder so that they always refer to the - * first sample of the data actually contained in the packet, - * including any added padding. E.g. if the timebase is - * 1/samplerate and the timestamp of the first input sample is - * 0, the timestamp of the first output packet will be - * -initial_padding. - *) - initial_padding: cint; - - (** - * - decoding: For codecs that store a framerate value in the compressed - * bitstream, the decoder may export it here. { 0, 1} when - * unknown. - * - encoding: unused - *) - framerate: TAVRational; - - (** - * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - * - encoding: unused. - * - decoding: Set by libavcodec before calling get_format() - *) - sw_pix_fmt: TAVPixelFormat; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * Code outside libavcodec should access this field using AVOptions - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavcodec should access this field using AVOptions - * (NO direct access). - * - encoding: Set by user. - * - decoding: Set by user. - *) - dump_separator: Pcuint8; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (* - * Properties of the stream that gets decoded - * To be accessed through av_codec_get_properties() (NO direct access) - * - encoding: unused - * - decoding: set by libavcodec - *) - properties: cuint; - - (** - * Additional data associated with the entire coded stream. - * - * - decoding: unused - * - encoding: may be set by libavcodec after avcodec_open2(). - *) - coded_side_data: PAVPacketSideData; - nb_coded_side_data: cint; - end; {TAVCodecContext} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - -{$IFDEF FF_API_AVPICTURE} - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * Picture data structure. - * - * Up to four components can be stored into it, the last component is - * alpha. - * @deprecated use AVFrame or imgutils functions instead - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; {deprecated} - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; {deprecated} ///< number of bytes per line - end; {TAVPicture} -{$ENDIF} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - -{$IFDEF FF_API_AVPICTURE} - (** - * @deprecated unused - *) - pict: TAVPicture; {deprecated} -{$ENDIF} - (** - * data+linesize for the bitmap of this subtitle. - * Can be set for text/ass as well once they are rendered. - *) - data: Array [0..4] of PByte; - linesize: Array [0..4] of cint; - - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see AV_CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< maximum value for lowres supported by the decoder, no direct access, use av_codec_get_max_lowres() - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - (** - * Internal codec capabilities. - * See FF_CODEC_CAP_* in internal.h - *) - caps_internal: cint; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * @defgroup lavc_hwaccel AVHWAccel - * @{ - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVHWAccel; - - (** - * Allocate a custom buffer - *) - alloc_frame: function (avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - frame_priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the ff_mpv_decode_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - decode_mb: procedure(s: PMpegEncContext); cdecl; - - (** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - *) - init: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - *) - uninit: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - *) - priv_data_size: cint; - end; {TAVHWAccel} - -const - (** - * Hardware acceleration should be used for decoding even if the codec level - * used is unknown or higher than the maximum supported level reported by the - * hardware driver. - * - * It's generally a good idea to pass this flag unless you have a specific - * reason not to, as hardware tends to under-report supported levels. - *) - AV_HWACCEL_FLAG_IGNORE_LEVEL = (1 << 0); - - (** - * Hardware acceleration can output YUV pixel formats with a different chroma - * sampling than 4:2:0 and/or other than 8 bits per component. - *) - AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = (1 << 1); - - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - FF_CODEC_PROPERTY_LOSSLESS = $00000001; - FF_CODEC_PROPERTY_CLOSED_CAPTIONS = $00000002; - - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_codec_properties(avctx: {const} PAVCodecContext): cuint; - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct should be freed with avcodec_free_context(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Free the codec context and everything associated with it and write NULL to - * the provided pointer. - *) -procedure avcodec_free_context(var avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values corresponding - * to the given codec (defaults may be codec-dependent). - * - * Do not call this function if a non-NULL codec has been passed - * to avcodec_alloc_context3() that allocated this AVCodecContext. - * If codec is non-NULL, it is illegal to call avcodec_open2() with a - * different codec on this AVCodecContext. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_decode_video2()). - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * avcodec_get_context_defaults3() for this context, then this - * parameter MUST be either NULL or equal to the previously passed - * codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() / - * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will - * do nothing. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -(** - * Allocate an AVPacket and set its fields to default values. The resulting - * struct must be freed using av_packet_free(). - * - * @return An AVPacket filled with default values or NULL on failure. - * - * @note this only allocates the AVPacket itself, not the data buffers. Those - * must be allocated through other means such as av_new_packet. - * - * @see av_new_packet - *) -function av_packet_alloc(): PAVPacket; - cdecl; external av__codec; - -(** - * Create a new packet that references the same data as src. - * - * This is a shortcut for av_packet_alloc()+av_packet_ref(). - * - * @return newly created AVPacket on success, NULL on error. - * - * @see av_packet_alloc - * @see av_packet_ref - *) -function av_packet_clone(src: PAVPacket): PAVPacket; - cdecl; external av__codec; - -(** - * Free the packet, if the packet is reference counted, it will be - * unreferenced first. - * - * @param packet packet to be freed. The pointer will be set to NULL. - * @note passing NULL is a no-op. - *) -procedure av_packet_free(pkt: PPAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVPACKET_OLD_API} -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - * - * @deprecated Use av_packet_ref - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @deprecated Use av_packet_unref - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Wrap an existing array as a packet side data. - * - * @param pkt packet - * @param type side information type - * @param data the side data array. It must be allocated with the av_malloc() - * family of functions. The ownership of the data is transferred to - * pkt. - * @param size side information size - * @return a non-negative number on success, a negative AVERROR code on - * failure. On failure, the packet is unchanged and the data remains - * owned by the caller. - *) -function av_packet_add_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - data: Pcuint8; size: size_t): cint; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_side_data_name(type_: TAVPacketSideDataType): PAnsiChar; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Convert valid timing fields (timestamps / durations) in a packet from one - * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be - * ignored. - * - * @param pkt packet on which the conversion will be performed - * @param tb_src source timebase, in which the timing fields in pkt are - * expressed - * @param tb_dst destination timebase, to which the timing fields will be - * converted - *) -procedure av_packet_rescale_ts(pkt: PAVPacket; tb_src, tb_dst: TAVRational); - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * AV_CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame and the return value would be - * less than the packet size. In this case, avcodec_decode_audio4 has to be - * called again with an AVPacket containing the remaining data in order to - * decode the second frame, etc... Even if no frames are returned, the packet - * needs to be fed to the decoder with remaining data until it is completely - * consumed or an error occurs. - * - * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning samples. It is safe to flush even those decoders that are not - * marked with AV_CODEC_CAP_DELAY, then no samples will be returned. - * - * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. Note that this field being set to zero - * does not mean that an error has occurred. For - * decoders with AV_CODEC_CAP_DELAY set, no given decode - * call is guaranteed to produce a frame. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be AV_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note Codecs which have the AV_CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning subtitles. It is safe to flush even those decoders that are not - * marked with CODEC_CAP_DELAY, then no subtitles will be returned. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, - * must be freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - -{$IFDEF FF_API_CONVERGENCE_DURATION} - (** - * @deprecated unused - *) - convergence_duration: cint64; {deprecated} -{$ENDIF} - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - (** - * Picture number incremented in presentation or output order. - * This field may be reinitialized at the first picture of a new sequence. - * - * For example, this corresponds to H.264 PicOrderCnt. - *) - output_picture_number: cint; - - (** - * Dimensions of the decoded video intended for presentation. - *) - width: cint; - height: cint; - - (** - * Dimensions of the coded video. - *) - coded_width: cint; - coded_height: cint; - - (** - * The format of the coded data, corresponds to enum AVPixelFormat for video - * and for enum AVSampleFormat for audio. - * - * Note that a decoder can have considerable freedom in how exactly it - * decodes the data, so the format reported here might be different from the - * one returned by a decoder. - *) - format: cint; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - (* This callback never returns an error, a negative value means that - * the frame start was in a previous packet. *) - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: {const} PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_packet_unref(). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_packet_unref(). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -{$IFDEF FF_API_AVPICTURE} -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * @deprecated unused - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_fill_arrays() instead. - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_copy_to_buffer() instead. - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_get_buffer_size() instead. - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated av_image_copy() instead. - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * @deprecated see av_get_pix_fmt_loss() - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @deprecated see av_find_best_pix_fmt_of_2() - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec_id the ID of the codec to which the requested profile belongs - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - * - * @note unlike av_get_profile_name(), which searches a list of profiles - * supported by a specific decoder or encoder implementation, this - * function searches the list of profiles from the AVCodecDescriptor - *) -function avcodec_profile_name(codec_id: TAVCodecID; profile: cint): {const} PChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - (** - * Internal default arguments, used if NULL is passed to av_bitstream_filter_filter(). - * Not for access by library users. - *) - args: PChar; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; cdecl; - close: procedure(bsfc: PAVBitStreamFilterContext); - next: PAVBitStreamFilter; - end; - -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is available in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output output buffer is not allocated - * and the output buffer should be considered identical to the input - * buffer, or in case *poutbuf was set it points to the input buffer - * (not necessarily to its starting address). - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: {const} PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: {const} PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. The "mutex" argument to the function points - * to a (void * ) where the lockmgr should store/get a pointer to a user - * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the - * value left by the last call for all other ops. If the lock manager is - * unable to perform the op then it should leave the mutex in the same - * state as when it was called and return a non-zero value. However, - * when called with AV_LOCK_DESTROY the mutex will always be assumed to - * have been successfully destroyed. If av_lockmgr_register succeeds - * it will return a non-negative value, if it fails it will return a - * negative value and destroy all mutex and unregister all callbacks. - * av_lockmgr_register is not thread-safe, it must be called from a - * single thread before any calls which make use of locking are used. - * - * @param cb User defined callback. av_lockmgr_register invokes calls - * to this callback and the previously registered callback. - * The callback will be used to create more than one mutex - * each of which must be backed by its own underlying locking - * mechanism (i.e. do not use a single static object to - * implement your lock manager). If cb is set to NULL the - * lockmgr will be unregistered. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Allocate a CPB properties structure and initialize its fields to default - * values. - * - * @param size if non-NULL, the size of the allocated struct will be written - * here. This is useful for embedding it in side data. - * - * @return the newly allocated struct or NULL on failure - *) -function av_cpb_properties_alloc(size: Psize_t): PAVCPBProperties; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-3.0/avformat.pas b/src/lib/ffmpeg-3.0/avformat.pas deleted file mode 100644 index 2851d0f8..00000000 --- a/src/lib/ffmpeg-3.0/avformat.pas +++ /dev/null @@ -1,3093 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 56.4.101 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 2.4.* - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 57; - LIBAVFORMAT_MAX_VERSION_MINOR = 25; - LIBAVFORMAT_MAX_VERSION_RELEASE = 100; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 57; - LIBAVFORMAT_MIN_VERSION_MINOR = 25; - LIBAVFORMAT_MIN_VERSION_RELEASE = 100; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * It is possible to configure lavf muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @section urls - * URL strings in libavformat are made of a scheme/protocol, a ':', and a - * scheme specific string. URLs without a scheme and ':' used for local files - * are supported but deprecated. "file:" should be used for local files. - * - * It is important that the scheme string is not taken from untrusted - * sources without checks. - * - * Note that some schemes/protocols are quite powerful, allowing access to - * both local and remote files, parts of them, concatenations of them, local - * audio and video devices and so on. - * - * @defgroup lavf_decoding Demuxing - * @ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "file:in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or - * avcodec_decode_subtitle2() if the caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_packet_unref() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @ - * - * @defgroup lavf_encoding Muxing - * @ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codec "stream codec context" information, such as the - * codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVStream.time_base "stream timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - It is advised to manually initialize only the relevant fields in - * AVCodecContext, rather than using @ref avcodec_copy_context() during - * remuxing: there is no guarantee that the codec context values remain valid - * for both input and output format contexts. - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase - * requested by the caller. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @section lavf_io_dirlist Directory listing - * The directory listing API makes it possible to list files on remote servers. - * - * Some of possible use cases: - * - an "open file" dialog to choose files from a remote location, - * - a recursive media finder providing a player with an ability to play all - * files from a given directory. - * - * @subsection lavf_io_dirlist_open Opening a directory - * At first, a directory needs to be opened by calling avio_open_dir() - * supplied with a URL and, optionally, ::AVDictionary containing - * protocol-specific parameters. The function returns zero or positive - * integer and allocates AVIODirContext on success. - * - * @code - * AVIODirContext *ctx = NULL; - * if (avio_open_dir(&ctx, "smb://example.com/some_dir", NULL) < 0) { - * fprintf(stderr, "Cannot open directory.\n"); - * abort(); - * } - * @endcode - * - * This code tries to open a sample directory using smb protocol without - * any additional parameters. - * - * @subsection lavf_io_dirlist_read Reading entries - * Each directory's entry (i.e. file, another directory, anything else - * within ::AVIODirEntryType) is represented by AVIODirEntry. - * Reading consecutive entries from an opened AVIODirContext is done by - * repeatedly calling avio_read_dir() on it. Each call returns zero or - * positive integer if successful. Reading can be stopped right after the - * NULL entry has been read -- it means there are no entries left to be - * read. The following code reads all entries from a directory associated - * with ctx and prints their names to standard output. - * @code - * AVIODirEntry *entry = NULL; - * for (;;) { - * if (avio_read_dir(ctx, &entry) < 0) { - * fprintf(stderr, "Cannot list directory.\n"); - * abort(); - * } - * if (!entry) - * break; - * printf("%s\n", entry->name); - * avio_free_directory_entry(&entry); - * } - * @endcode - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - * - *) - -//type - -(* - * @defgroup metadata_api Public Metadata API - * @ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @ - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_LAVF_FRAC} -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; -{$ENDIF} - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - {const} mime_type: PAnsiChar; (**< mime_type, when known. *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MIME = 75; ///< score for file mime type - AVPROBE_SCORE_MAX = 100; ///< maximum score - - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) -{$IFDEF FF_API_LAVF_FMT_RAWPICTURE} - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. @deprecated Not used anymore *) -{$ENDIF} - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) - AVFMT_TS_NONSTRICT = $20000;(**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_FLUSH_PACKETS = $0200; ///< Flush the AVIOContext every packet. -(** - * When muxing, try to avoid writing any random/volatile data to the output. - * This includes any random IDs, real-time timestamps/dates, muxer version, etc. - * - * This flag is mainly intended for testing. - *) - AVFMT_FLAG_BITEXACT = $0400; - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - AVFMT_FLAG_FAST_SEEK = $80000; ///< Enable fast, but inaccurate seeks for some formats - - // used by AVStream - AVSTREAM_EVENT_FLAG_METADATA_UPDATED = $0001; ///< The call resulted in updated metadata. - MAX_STD_TIMEBASES = (30*12+30+3+6); - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - AVFMT_EVENT_FLAG_METADATA_UPDATED = 0001; ///< The call resulted in updated metadata. - - RAW_PACKET_BUFFER_SIZE = 2500000; - - AVFMT_AVOID_NEG_TS_AUTO = -1; ///< Enabled when required by target format - AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 1; ///< Shift timestamps so they are non negative - AVFMT_AVOID_NEG_TS_MAKE_ZERO = 2; ///< Shift timestamps so that they start at 0 - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - - PAVDeviceCapabilitiesQuery = ^TAVDeviceCapabilitiesQuery; - TAVDeviceCapabilitiesQuery = record - end; - - PFFFrac = ^TFFFrac; - TFFFrac = record - val: cint64; - num: cint64; - den: cint64; - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - data_codec: TAVCodecID; (**< default data codec *) - - (** - * Initialize format. May allocate data here, and set any AVFormatContext or - * AVStream parameters that need to be set before packets are sent. - * This method must not write output. - * - * Any allocations made here must be freed in deinit(). - *) - init: function(s: PAVFormatContext): cint; cdecl; - - (** - * Deinitialize format. If present, this is called whenever the muxer is being - * destroyed, regardless of whether or not the header has been written. - * - * If a trailer is being written, this is called after write_trailer(). - * - * This is called if init() fails as well. - *) - deinit: procedure(s: PAVFormatContext); - - (** - * Set up any necessary bitstream filtering and extract any extra data needed - * for the global header. - * Return 0 if more packets from this stream must be checked; 1 if not. - *) - check_bitstream: function(s: PAVFormatContext; pkt: {const} PAVPacket): cint; cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (** - * Comma-separated list of mime types. - * It is used check for matching mime types while probing. - * @see av_probe_input_format2 - *) - mime_type: {const} PAnsiChar; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) - (** - * Codec context associated with this stream. Allocated and freed by - * libavformat. - * - * - decoding: The demuxer exports codec information stored in the headers - * here. - * - encoding: The user sets codec information, the muxer writes it to the - * output. Mandatory fields as specified in AVCodecContext - * documentation must be set even if this AVCodecContext is - * not actually used for encoding. - *) - codec: PAVCodecContext; (**< codec context *) - priv_data: pointer; - -{$IFDEF FF_API_LAVF_FRAC} - (** - * @deprecated this field is unused - *) - pts: TAVFrac; {attribute_deprecated} -{$ENDIF} - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the desired timebase. In - * avformat_write_header(), the muxer will overwrite this field - * with the timebase that will actually be used for the timestamps - * written into the file (which may or may not be related to the - * user-provided one, depending on the format). - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - * - * - demuxing: May be set by libavformat when creating the stream or in - * avformat_find_stream_info(). - * - muxing: May be set by the caller before avformat_write_header(). - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (** - * An array of side data that applies to the whole stream (i.e. the - * container does not allow it to change between packets). - * - * There may be no overlap between the side data in this array and side data - * in the packets. I.e. a given side data is either exported by the muxer - * (demuxing) / set by the caller (muxing) in this array, then it never - * appears in the packets, or the side data is exported / sent through - * the packets (always in the first packet where the value becomes known or - * changes), then it does not appear in this array. - * - * - demuxing: Set by libavformat when the stream is created. - * - muxing: May be set by the caller before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - * - * @see av_format_inject_global_side_data() - *) - side_data: PAVPacketSideData; - - (** - * The number of elements in the AVStream.side_data array. - *) - nb_side_data: cint; - - (** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. - *) - event_flags: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * If not 0, the number of samples that should be skipped from the start of - * the stream (the samples are removed from packets with pts==0, which also - * assumes negative timestamps do not happen). - * Intended for use with formats such as mp3 with ad-hoc gapless audio - * support. - *) - start_skip_samples: cint64; - - (** - * If not 0, the first audio sample that should be discarded from the stream. - * This is broken by design (needs global sample count), but can't be - * avoided for broken by design formats such as mp3 with ad-hoc gapless - * audio support. - *) - first_discard_sample: cint64; - - (** - * The sample after last sample that is intended to be discarded after - * first_discard_sample. Works on frame boundaries only. Used to prevent - * early EOF if the gapless info is broken (considered concatenated mp3s). - *) - last_discard_sample: cint64; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - (** - * Internal data to inject global side data - *) - inject_global_side_data: cint; - - (** - * String containing paris of key and values describing recommended encoder configuration. - * Paris are separated by ','. - * Keys are separated from values by '='. - *) - recommended_encoder_configuration: PAnsiChar; - - (** - * display aspect ratio (0 if unknown) - * - encoding: unused - * - decoding: Set by libavformat to calculate sample_aspect_ratio internally - *) - display_aspect_ratio: TAVRational; - - priv_pts: PFFFrac; - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: pointer; - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - TAVOpenCallback = function (s: PAVFormatContext; pb: PPAVIOContext; url: {const} PAnsiChar; flags: cint; - int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - (** - * Flags signalling stream properties. A combination of AVFMTCTX_*. - * Set by libavformat. - *) - ctx_flags: cint; - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint64; - - packet_size: cuint; - max_delay: cint; - - (** - * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. - * Set by the user before avformat_open_input() / avformat_write_header(). - *) - flags: cint; - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input(). - *) - probesize: cint64; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - * Can be set to 0 to let avformat choose using a heuristic. - *) - max_analyze_duration: cint64; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * - muxing: Set by the caller before avformat_write_header(). If set to - * either 0 or AV_NOPTS_VALUE, then the current wall-time will - * be used. - * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that - * the value may become known after some number of frames - * have been received. - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Allow non-standard and experimental extension - * @see AVCodecContext.strict_std_compliance - *) - strict_std_compliance: cint; - - (** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. - *) - event_flags: cint; - - (** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - *) - max_ts_probe: cint; - - (** - * Avoid negative timestamps during muxing. - * Any value of the AVFMT_AVOID_NEG_TS_* constants. - * Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) - * - muxing: Set by user - * - demuxing: unused - *) - avoid_negative_ts: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cint64; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (** - * format probing score. - * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes - * the format. - * - encoding: unused - * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) - *) - probe_score: cint; - - (** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - format_probesize: cint; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (** - * ',' separated list of allowed demuxers. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - format_whitelist: PAnsiChar; - - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_video_codec (NO direct access). - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). - *) - subtitle_codec: PAVCodec; - - (** - * Forced data codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_data_codec (NO direct access). - *) - data_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user via AVOptions (NO direct access) - *) - output_ts_offset: cint64; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavformat should access this field using AVOptions - * (NO direct access). - * - muxing: Set by user. - * - demuxing: Set by user. - *) - dump_separator: Pcuint8; - - (** - * Forced Data codec_id. - * Demuxing: Set by user. - *) - data_codec_id: TAVCodecID; -{$IFDEF FF_API_OLD_OPEN_CALLBACKS} - (** - * Called to open further IO contexts when needed for demuxing. - * - * This can be set by the user application to perform security checks on - * the URLs before opening them. - * The function should behave like avio_open2(), AVFormatContext is provided - * as contextual information and to reach AVFormatContext.opaque. - * - * If NULL then some simple checks are used together with avio_open2(). - * - * Must not be accessed directly from outside avformat. - * @See av_format_set_open_cb() - * - * Demuxing: Set by user. - * - * @deprecated Use io_open and io_close. - *) - open_cb: function(s: PAVFormatContext; p: PPAVIOContext; url: {const} PAnsiChar; flags: cint; int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; {deprecated} -{$ENDIF} - - (** - * ',' separated list of allowed protocols. - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - protocol_whitelist: pchar; - - (* - * A callback for opening new IO streams. - * - * Certain muxers or demuxers (e.g. for various playlist-based formats) need - * to open additional files during muxing or demuxing. This callback allows - * the caller to provide custom IO in such cases. - * - * @param s the format context - * @param pb on success, the newly opened IO context should be returned here - * @param url the url to open - * @param flags a combination of AVIO_FLAG_* - * @param options a dictionary of additional options, with the same - * semantics as in avio_open2() - * @return 0 on success, a negative AVERROR code on failure - * - * @note Certain muxers and demuxers do nesting, i.e. they open one or more - * additional internal format contexts. Thus the AVFormatContext pointer - * passed to this callback may be different from the one facing the caller. - * It will, however, have the same 'opaque' field. - *) - io_open: function(s: PAVFormatContext; pb: PPAVIOContext; url: {const} pchar; - flags: cint; options: PPAVDictionary): cint; cdecl; - - (** - * A callback for closing the streams opened with AVFormatContext.io_open(). - *) - io_close: procedure(s: PAVFormatContext; pb: PAVIOContext); cdecl; - end; (** TAVFormatContext **) - -function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_data_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_data_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; -procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; -procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; -function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; -procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; -{$IFDEF FF_API_OLD_OPEN_CALLBACKS} -function av_format_get_open_cb(s: {const} PAVFormatContext): TAVOpenCallback; {deprecated} - cdecl; external av__format; -procedure av_format_set_open_cb(s: PAVFormatContext; callback: TAVOpenCallback); {deprecated} - cdecl; external av__format; -{$ENDIF} - -(** - * This function will cause global side data to be injected in the next packet - * of each stream as well as after any subsequent seek. - *) -procedure av_format_inject_global_side_data(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; -function av_stream_get_parser(s: {const} PAVStream): PAVCodecParserContext; - cdecl; external av__format; -function av_stream_get_recommended_encoder_configuration({const} s: PAVStream): PAnsiChar; - cdecl; external av__format; -procedure av_stream_set_recommended_encoder_configuration(s: PAVStream; configuration: PAnsiChar); - cdecl; external av__format; - -(** - * Returns the pts of the last muxed packet + its duration - * - * the retuned value is undefined when used with a demuxer. - *) -function av_stream_get_end_pts(st: {const} PAVStream): cint64; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: {const} PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: {const} PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -(** - * Allocate new information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_stream_new_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: cint): Pcuint8; - cdecl; external av__format; - -(** - * Get side information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_stream_get_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param url the url of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer2(pb: PAVIOContext; var fmt: PAVInputFormat; - url: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Like av_probe_input_buffer2() but returns 0 on success - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - url: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param url URL of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; url: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -procedure av_program_add_stream_index(ac: PAVFormatContext; progid: cint; idx: cuint); - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until avformat_close_input(). Otherwise the packet - * is valid indefinitely. In both cases the packet must be freed with - * av_packet_unref when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Discard all internally buffered data. This can be useful when dealing with - * discontinuities in the byte stream. Generally works only with formats that - * can resync. This includes headerless formats like MPEG-TS/TS but should also - * work with NUT, Ogg and in a limited way AVI for example. - * - * The set of streams, the detected duration, stream parameters and codecs do - * not change when calling this function. If you want a complete reset, it's - * better to open a new AVFormatContext. - * - * This does not flush the AVIOContext (s->pb). If necessary, call - * avio_flush(s->pb) before calling this function. - * - * @param s media file handle - * @return >=0 on success, error code otherwise - *) -function avformat_flush(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". - *
- * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") - * must be set to correct values in the stream's timebase (unless the - * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then - * they can be set to AV_NOPTS_VALUE). - * The dts for subsequent packets passed to this function must be strictly - * increasing when compared in their respective timebases (unless the - * output format is flagged with the AVFMT_TS_NONSTRICT, then they - * merely have to be nondecreasing). @ref AVPacket.duration - * "duration") should also be set if known. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". - *
- * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") - * must be set to correct values in the stream's timebase (unless the - * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then - * they can be set to AV_NOPTS_VALUE). - * The dts for subsequent packets in one stream must be strictly - * increasing (unless the output format is flagged with the - * AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). - * @ref AVPacket.duration "duration") should also be set if known. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write a uncoded frame to an output media file. - * - * If the muxer supports it, this function makes it possible to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: {const} PAVPacket; dump_payload: cint; st: {const} PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: {const} PAVPacket; dump_payload: cint; - st: {const} PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - url: {const} PAnsiChar); - cdecl; external av__format; - -(** - * Print detailed information about the input or output format, such as - * duration, bitrate, streams, container, programs, metadata, side data, - * codec and time base. - * - * @param ic the context to analyze - * @param index index of the stream to dump information about - * @param url the URL to print, such as source or destination file - * @param is_output Select whether the specified context is an input(0) or output(1) - *) -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: {const} PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: {const} PAVOutputFormat; codec_id: TAVCodecID; - std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Apply a list of bitstream filters to a packet. - * - * @param codec AVCodecContext, usually from an AVStream - * @param pkt the packet to apply filters to - * @param bsfc a NULL-terminated list of filters to apply - * @return >=0 on success; - * AVERROR code on failure - *) -function av_apply_bitstream_filters(codec: PAVCodecContext; pkt: PAVPacket; - bsfc: PAVBitStreamFilterContext): cint; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-3.0/avio.pas b/src/lib/ffmpeg-3.0/avio.pas deleted file mode 100644 index b04d118c..00000000 --- a/src/lib/ffmpeg-3.0/avio.pas +++ /dev/null @@ -1,866 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 56.4.101 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - - (** - * Directory entry types. - *) - TAVIODirEntryType = ( - AVIO_ENTRY_UNKNOWN, - AVIO_ENTRY_BLOCK_DEVICE, - AVIO_ENTRY_CHARACTER_DEVICE, - AVIO_ENTRY_DIRECTORY, - AVIO_ENTRY_NAMED_PIPE, - AVIO_ENTRY_SYMBOLIC_LINK, - AVIO_ENTRY_SOCKET, - AVIO_ENTRY_FILE, - AVIO_ENTRY_SERVER, - AVIO_ENTRY_SHARE, - AVIO_ENTRY_WORKGROUP - ); - - - (** - * Describes single entry of the directory. - * - * Only name and type fields are guaranteed be set. - * Rest of fields are protocol or/and platform dependent and might be unknown. - *) - PPAVIODirEntry = ^PAVIODirEntry; - PAVIODirEntry = ^TAVIODirEntry; - TAVIODirEntry = record - name: PAnsiChar; (**< Filename *) - type_: cint; (**< Type of the entry *) - utf8: cint; (**< Set to 1 when name is encoded with UTF-8, 0 otherwise. - Name can be encoded with UTF-8 even though 0 is set. *) - size: cint64; (**< File size in bytes, -1 if unknown. *) - modification_timestamp: cint64; (**< Time of last modification in microseconds since unix - epoch, -1 if unknown. *) - access_timestamp: cint64; (**< Time of last access in microseconds since unix epoch, - -1 if unknown. *) - status_change_timestamp: cint64; (**< Time of last status change in microseconds since unix - epoch, -1 if unknown. *) - user_id: cint64; (**< User ID of owner, -1 if unknown. *) - group_id: cint64; (**< Group ID of owner, -1 if unknown. *) - filemode: cint64; (**< Unix file mode, -1 if unknown. *) - end; - - PPAVIODirContext = ^PAVIODirContext; - PAVIODirContext = ^TAVIODirContext; - TAVIODirContext = record - url_context: pointer; - (** struct URLContext *url_context; *) - end; - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - - (* - * The following shows the relationship between buffer, buf_ptr, buf_end, buf_size, - * and pos, when reading and when writing (since AVIOContext is used for both): - * - ********************************************************************************** - * READING - ********************************************************************************** - * - * | buffer_size | - * |---------------------------------------| - * | | - * - * buffer buf_ptr buf_end - * +---------------+-----------------------+ - * |/ / / / / / / /|/ / / / / / /| | - * read buffer: |/ / consumed / | to be read /| | - * |/ / / / / / / /|/ / / / / / /| | - * +---------------+-----------------------+ - * - * pos - * +-------------------------------------------+-----------------+ - * input file: | | | - * +-------------------------------------------+-----------------+ - * - * - ********************************************************************************** - * WRITING - ********************************************************************************** - * - * | buffer_size | - * |-------------------------------| - * | | - * - * buffer buf_ptr buf_end - * +-------------------+-----------+ - * |/ / / / / / / / / /| | - * write buffer: | / to be flushed / | | - * |/ / / / / / / / / /| | - * +-------------------+-----------+ - * - * pos - * +--------------------------+-----------------------------------+ - * output file: | | | - * +--------------------------+-----------------------------------+ - * - *) - - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - - (** - * Original buffer size - * used internally after probing and ensure seekback to reset the buffer size - * This field is internal to libavformat and access from outside is not allowed. - *) - orig_buffer_size: cint; - - (** - * Threshold to favor readahead over seek. - * This is current internal only, do not use from outside. - *) - short_seek_threshold: cint; - - (** - * ',' separated list of allowed protocols. - *) - protocol_whitelist: {const} PAnsiChar; - end; - -(* unbuffered I/O *) - -(** - * Return the name of the protocol that will handle the passed URL. - * - * NULL is returned if no protocol could be found for the given URL. - * - * @return Name of the protocol or NULL. - *) -function avio_find_protocol_name(url: {const} PAnsiChar): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Move or rename a resource. - * - * @note url_src and url_dst should share the same protocol and authority. - * - * @param url_src url to resource to be moved - * @param url_dst new url to resource if the operation succeeded - * @return >=0 on success or negative on error. - *) -function avpriv_io_move(url_src: {const} PAnsiChar; url_dst: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Delete a resource. - * - * @param url resource to be deleted. - * @return >=0 on success or negative on error. - *) -function avpriv_io_delete(url: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Open directory for reading. - * - * @param s directory read context. Pointer to a NULL pointer must be passed. - * @param url directory to be listed. - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dictionary - * containing options that were not found. May be NULL. - * @return >=0 on success or negative on error. - *) -function avio_open_dir(s: PPAVIODirContext; url: {const} PAnsiChar; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Get next directory entry. - * - * Returned entry must be freed with avio_free_directory_entry(). In particular - * it may outlive AVIODirContext. - * - * @param s directory read context. - * @param[out] next next entry or NULL when no more entries. - * @return >=0 on success or negative on error. End of list is not considered an - * error. - *) -function avio_read_dir(s: PAVIODirContext; next: PPAVIODirEntry): cint; - cdecl; external av__format; - -(** - * Close directory. - * - * @note Entries created using avio_read_dir() are not deleted and must be - * freeded with avio_free_directory_entry(). - * - * @param s directory read context. - * @return >=0 on success or negative on error. - *) -function avio_close_dir(s: PPAVIODirContext): cint; - cdecl; external av__format; - -(** - * Free entry allocated by avio_read_dir(). - * - * @param entry entry to be freed. - *) -procedure avio_free_directory_entry(entry: PPAVIODirEntry); - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * It may be freed and replaced with a new buffer by libavformat. - * AVIOContext.buffer holds the buffer currently in use, - * which must be later freed with av_free(). - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16BE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16be(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -const -(** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function avio_feof(s: PAVIOContext): cint; - cdecl; external av__format; -{$IFDEF FF_API_URL_FEOF} -(** - * @deprecated use avio_feof() - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; {attribute_deprecated} -{$ENDIF} - -(** @warning Writes up to 4 KiB per call *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data. - * - * For write streams, force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - * - * For read streams, discard all currently buffered data, and advance the - * reported file position to that of the underlying stream. This does not - * read new data, and does not perform any seeks. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -(* Avoid a warning. The header can not be included because it breaks c++. *) -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; - -(** - * Read contents of h into print buffer, up to max_size bytes, or up to EOF. - * - * @return 0 for success (max_size bytes read or EOF reached), negative error - * code otherwise - *) -function avio_read_to_bprint(h: PAVIOContext; pb: PAVBPrint; max_size: size_t): cint; - cdecl; external av__format; - -(** - * Accept and allocate a client context on a server context. - * @param s the server context - * @param c the client context, must be unallocated - * @return >= 0 on success or a negative value corresponding - * to an AVERROR on failure - *) -function avio_accept(s: PAVIOContext; c: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Perform one step of the protocol handshake to accept a new client. - * This function must be called on a client returned by avio_accept() before - * using it as a read/write context. - * It is separate from avio_accept() because it may block. - * A step of the handshake is defined by places where the application may - * decide to change the proceedings. - * For example, on a protocol with a request header and a reply header, each - * one can constitute a step because the application may use the parameters - * from the request to change parameters in the reply; or each individual - * chunk of the request can constitute a step. - * If the handshake is already finished, avio_handshake() does nothing and - * returns 0 immediately. - * - * @param c the client context to perform the handshake on - * @return 0 on a complete and successful handshake - * > 0 if the handshake progressed, but is not complete - * < 0 for an AVERROR code - *) -function avio_handshake(c: PAVIOContext): cint; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-3.0/avutil.pas b/src/lib/ffmpeg-3.0/avutil.pas deleted file mode 100644 index 9cd5a319..00000000 --- a/src/lib/ffmpeg-3.0/avutil.pas +++ /dev/null @@ -1,361 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 54.7.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 55; - LIBAVUTIL_MAX_VERSION_MINOR = 17; - LIBAVUTIL_MAX_VERSION_RELEASE = 103; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 55; - LIBAVUTIL_MIN_VERSION_MINOR = 17; - LIBAVUTIL_MIN_VERSION_RELEASE = 103; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return an informative version string. This usually is the actual release - * version number or a git commit description. This string has no fixed format - * and can change any time. It should never be parsed by code. - *) -function av_version_info(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -(** - * Return the fractional representation of the internal time base. - *) -function av_get_time_base_q: TAVRational; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -end. diff --git a/src/lib/ffmpeg-3.0/ff_api-defines.inc b/src/lib/ffmpeg-3.0/ff_api-defines.inc deleted file mode 100644 index 5feb89c1..00000000 --- a/src/lib/ffmpeg-3.0/ff_api-defines.inc +++ /dev/null @@ -1,226 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_VIMA_DECODER} -{$define FF_API_VIMA_DECODER := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := FF_API_AUDIO_CONVERT} -{$endif} -{$ifndef FF_API_GETCHROMA} -{$define FF_API_GETCHROMA := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_SH4} -{$define FF_API_ARCH_SH4 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_SPARC} -{$define FF_API_ARCH_SPARC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_UNUSED_MEMBERS} -{$define FF_API_UNUSED_MEMBERS := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_IDCT_XVIDMMX} -{$define FF_API_IDCT_XVIDMMX := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_INPUT_PRESERVED} -{$define FF_API_INPUT_PRESERVED := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NORMALIZE_AQP} -{$define FF_API_NORMALIZE_AQP := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_GMC} -{$define FF_API_GMC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MV0} -{$define FF_API_MV0 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_CODEC_NAME} -{$define FF_API_CODEC_NAME := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AFD} -{$define FF_API_AFD := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VISMV} -(* XXX: don't forget to drop the -vismv documentation *) -{$define FF_API_VISMV := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AUDIOENC_DELAY} -{$define FF_API_AUDIOENC_DELAY := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VAAPI_CONTEXT} -{$define FF_API_VAAPI_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCTX_TIMEBASE} -{$define FF_API_AVCTX_TIMEBASE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MPV_OPT} -{$define FF_API_MPV_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STREAM_CODEC_TAG} -{$define FF_API_STREAM_CODEC_TAG := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_QUANT_BIAS} -{$define FF_API_QUANT_BIAS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_RC_STRATEGY} -{$define FF_API_RC_STRATEGY := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CODED_FRAME} -{$define FF_API_CODED_FRAME := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MOTION_EST} -{$define FF_API_MOTION_EST := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_WITHOUT_PREFIX} -{$define FF_API_WITHOUT_PREFIX := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_SIDEDATA_ONLY_PKT} -{$define FF_API_SIDEDATA_ONLY_PKT:= (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_VDPAU_PROFILE} -{$define FF_API_VDPAU_PROFILE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CONVERGENCE_DURATION} -{$define FF_API_CONVERGENCE_DURATION := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_AVPICTURE} -{$define FF_API_AVPICTURE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_AVPACKET_OLD_API} -{$define FF_API_AVPACKET_OLD_API := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_RTP_CALLBACK} -{$define FF_API_RTP_CALLBACK := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_VBV_DELAY} -{$define FF_API_VBV_DELAY := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CODER_TYPE} -{$define FF_API_CODER_TYPE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STAT_BITS} -{$define FF_API_STAT_BITS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_PRIVATE_OPT} -{$define FF_API_PRIVATE_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DLOG} -{$define FF_API_DLOG := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_VAAPI} -{$define FF_API_VAAPI := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FRAME_QP} -{$define FF_API_FRAME_QP := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_PLUS1_MINUS1} -{$define FF_API_PLUS1_MINUS1 := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ERROR_FRAME} -{$define FF_API_ERROR_FRAME := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CRC_BIG_TABLE} -{$define FF_API_CRC_BIG_TABLE := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_LAVF_BITEXACT} -{$define FF_API_LAVF_BITEXACT := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_FRAC} -{$define FF_API_LAVF_FRAC := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_CODEC_TB} -{$define FF_API_LAVF_CODEC_TB := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_URL_FEOF} -{$define FF_API_URL_FEOF := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_FMT_RAWPICTURE} -{$define FF_API_LAVF_FMT_RAWPICTURE := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_COMPUTE_PKT_FIELDS2} -{$define FF_API_COMPUTE_PKT_FIELDS2 := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_OLD_OPEN_CALLBACKS} -{$define FF_API_OLD_OPEN_CALLBACKS := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} - -(** swscale FF_API defines *) - -{$ENDIF PASDOC} diff --git a/src/lib/ffmpeg-3.0/libavcodec/audioconvert.pas b/src/lib/ffmpeg-3.0/libavcodec/audioconvert.pas deleted file mode 100644 index 38bef39c..00000000 --- a/src/lib/ffmpeg-3.0/libavcodec/audioconvert.pas +++ /dev/null @@ -1,294 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_HEXADECAGONAL = (AV_CH_LAYOUT_OCTAGONAL or AV_CH_WIDE_LEFT or AV_CH_WIDE_RIGHT or AV_CH_TOP_BACK_LEFT or - AV_CH_TOP_BACK_RIGHT or AV_CH_TOP_BACK_CENTER or AV_CH_TOP_FRONT_CENTER or - AV_CH_TOP_FRONT_LEFT or AV_CH_TOP_FRONT_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} \ No newline at end of file diff --git a/src/lib/ffmpeg-3.0/libavutil/buffer.pas b/src/lib/ffmpeg-3.0/libavutil/buffer.pas deleted file mode 100644 index c1502f51..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/buffer.pas +++ /dev/null @@ -1,290 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 54.7.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Same as av_buffer_alloc(), except the returned buffer will be initialized - * to zero. - *) -function av_buffer_allocz(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferRef; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - * @see av_buffer_pool_can_uninit() - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.0/libavutil/cpu.pas b/src/lib/ffmpeg-3.0/libavutil/cpu.pas deleted file mode 100644 index 76d4169e..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/cpu.pas +++ /dev/null @@ -1,124 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 54.7.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AESNI = $80000; ///< Advanced Encryption Standard functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_AVXSLOW = $8000000; ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer) - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - AV_CPU_FLAG_VSX = $0002; ///< ISA 2.06 - AV_CPU_FLAG_POWER8 = $0004; ///< ISA 2.07 - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - AV_CPU_FLAG_ARMV8 = (1 << 6); - AV_CPU_FLAG_VFP_VM = (1 << 7); ///< VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations - AV_CPU_FLAG_SETEND = (1 <<16); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in a application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.0/libavutil/dict.pas b/src/lib/ffmpeg-3.0/libavutil/dict.pas deleted file mode 100644 index 4c1bb2c4..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/dict.pas +++ /dev/null @@ -1,164 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 54.7.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get({const} m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, - * these arguments will be freed on error. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will be av_strduped depending on flags) - * @param value entry value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Convenience wrapper for av_dict_set that converts the value to a string - * and stores it. - * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. - *) -function av_dict_set_int(var pm: PAVDictionary; {const} key: PAnsiChar; - value: cint64; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - * @return 0 on success, negative AVERROR code on failure. If dst was allocated - * by this function, callers should free the associated memory. - *) -function av_dict_copy(var dst: PAVDictionary; {const} src: PAVDictionary; flags: cint): cint; - cdecl; external av__util; - -(** - * Get dictionary entries as a string. - * - * Create a string containing dictionary's entries. - * Such string may be passed back to av_dict_parse_string(). - * @note String is escaped with backslashes ('\'). - * - * @param[in] m dictionary - * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. - * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other - * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. - *) -function av_dict_get_string({const} m: PAVDictionary; buffer: PPAnsiChar; - {const} key_val_sep: AnsiChar; {const} pairs_sep: AnsiChar): cint; - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.0/libavutil/error.pas b/src/lib/ffmpeg-3.0/libavutil/error.pas deleted file mode 100644 index 59580fab..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/error.pas +++ /dev/null @@ -1,166 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) - AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) -(* HTTP & RTSP errors *) - AVERROR_HTTP_BAD_REQUEST = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('0') shl 24)); - AVERROR_HTTP_UNAUTHORIZED = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('1') shl 24)); - AVERROR_HTTP_FORBIDDEN = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('3') shl 24)); - AVERROR_HTTP_NOT_FOUND = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('4') shl 24)); - AVERROR_HTTP_OTHER_4XX = -(ord($F8) or (ord('4') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - AVERROR_HTTP_SERVER_ERROR = -(ord($F8) or (ord('5') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-3.0/libavutil/frame.pas b/src/lib/ffmpeg-3.0/libavutil/frame.pas deleted file mode 100644 index 4bd74b1e..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/frame.pas +++ /dev/null @@ -1,796 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 54.7.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - (** from the definitions of TAVFrame *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - AV_FRAME_FLAG_CORRUPT = (1 << 0); - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type -(* is already in pixfmt.pas - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); -*) - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO, - (** - * ReplayGain information in the form of the AVReplayGain struct. - *) - AV_FRAME_DATA_REPLAYGAIN, - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the frame for correct - * presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_FRAME_DATA_DISPLAYMATRIX, - (** - * Active Format Description data consisting of a single byte as specified - * in ETSI TS 101 154 using AVActiveFormatDescription enum. - *) - AV_FRAME_DATA_AFD, - (** - * Motion vectors exported by some codecs (on demand through the export_mvs - * flag set in the libavcodec AVCodecContext flags2 option). - * The data is the AVMotionVector struct defined in - * libavutil/motion_vector.h. - *) - AV_FRAME_DATA_MOTION_VECTORS, - (** - * Recommmends skipping the specified number of samples. This is exported - * only if the "skip_manual" AVOption is set in libavcodec. - * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_FRAME_DATA_SKIP_SAMPLES, - (** - * This side data must be associated with an audio frame and corresponds to - * enum AVAudioServiceType defined in avcodec.h. - *) - AV_FRAME_DATA_AUDIO_SERVICE_TYPE, - (** - * Mastering display metadata associated with a video frame. The payload is - * an AVMasteringDisplayMetadata type and contains information about the - * mastering display color volume. - *) - AV_FRAME_DATA_MASTERING_DISPLAY_METADATA, - (** - * The GOP timecode in 25 bit timecode format. Data format is 64-bit integer. - * This is set on the first frame of a GOP that has a temporal reference of 0. - *) - AV_FRAME_DATA_GOP_TIMECODE - ); - - TAVActiveFormatDescription = ( - AV_AFD_SAME = 8, - AV_AFD_4_3 = 9, - AV_AFD_16_9 = 10, - AV_AFD_14_9 = 11, - AV_AFD_4_3_SP_14_9 = 13, - AV_AFD_16_9_SP_14_9 = 14, - AV_AFD_SP_4_3 = 15 - ); {TAVActiveFormatDescription} - - PAVFrameSideData = ^TAVFrameSideData; -(** - * Structure to hold side data for an AVFrame. - * - * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - *) - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - buf: PAVBufferRef; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. -*) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used in order to access all channels. - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - *) - key_frame: cint; - - (** - * Picture type of the frame - *) - pict_type: TAVPictureType; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - *) - pkt_pts: cint64; - - (** - * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) - * This is also the Presentation time of this AVFrame calculated from - * only AVPacket.dts values without pts values. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - *) - coded_picture_number: cint; - - (** - * picture number in display order - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - *) - quality: cint; - - (** - * for some private data of the user - *) - opaque: pointer; - -{$IFDEF FF_API_ERROR_FRAME} - (** - * @deprecated unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - *) - palette_has_changed: cint; - - (** - * reordered opaque 64bit (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - *) - reordered_opaque: cint64; - - (** - * Sample rate of the audio data. - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. This array - * must be filled contiguously -- if buf[i] is non-NULL then buf[j] must - * also be non-NULL for all j < i. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * Flags describing additional frame properties. - * - * @ - *) - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - color_primaries: TAVColorPrimaries; - - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - chroma_location: TAVChromaLocation; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavutil should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavutil should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavutil should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavutil should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavutil should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavutil should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - -{$IFDEF FF_API_FRAME_QP} - (** - * QP table - * Not to be accessed directly from outside libavutil - *) - qscale_table: PByte; {deprecated} - (** - * QP store stride - * Not to be accessed directly from outside libavutil - *) - qstride: cint; {deprecated} - - qscale_type: cint; {deprecated} - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; {deprecated} -{$ENDIF} - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavutil. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -{$IFDEF FF_API_FRAME_QP} -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -{$ENDIF} -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__util; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__util; - -(** - * Move everything contained in src to dst and reset src. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - -(** - * If side data of the supplied type exists in the frame, free it and remove it - * from the frame. - *) -procedure av_frame_remove_side_data(frame: PAVFrame; type_: TAVFrameSideDataType); - cdecl; external av__codec; - -(** - * @return a string identifying the side data type - *) -function av_frame_side_data_name(type_: TAVFrameSideDataType): PAnsiChar; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-3.0/libavutil/log.pas b/src/lib/ffmpeg-3.0/libavutil/log.pas deleted file mode 100644 index cab0a9bf..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/log.pas +++ /dev/null @@ -1,527 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * log - *) - -type - (* from opt.h *) - TAVOptionType = ( - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_DICT, - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_BOOL = $424F4F4C, ///< MKBETAG('B','O','O','L'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_PIXEL_FMlT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is inteded for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, - AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, - AV_CLASS_CATEGORY_DEVICE_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_INPUT, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(* -#define AV_IS_INPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) - -#define AV_IS_OUTPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -*) - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - (** - * Value range. - * For string ranges this represents the min/max length. - * For dimensions this represents the min/max pixel count or width/height in multi-component case. - *) - value_min, value_max: cdouble; - (** - * Value's component range. - * For string this represents the unicode range for chars, 0-127 limits to ASCII. - *) - component_min, component_max: cdouble; - (** - * Range flag. - * If set to 1 the struct encodes a range, if set to 0 a single value. - *) - is_range: cint; - end; - - (** - * List of AVOptionRange structs. - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - (** - * Array of option ranges. - * - * Most of option types use just one component. - * Following describes multi-component option types: - * - * AV_OPT_TYPE_IMAGE_SIZE: - * component index 0: range of pixel count (width * height). - * component index 1: range of width. - * component index 2: range of height. - * - * @note To obtain multi-component version of this structure, user must - * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or - * av_opt_query_ranges_default function. - * - * Multi-component range can be read as in following example: - * - * @code - * int range_index, component_index; - * AVOptionRanges *ranges; - * AVOptionRange *range[3]; //may require more than 3 in the future. - * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); - * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { - * for (component_index = 0; component_index < ranges->nb_components; component_index++) - * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; - * //do something with range here. - * } - * av_opt_freep_ranges(&ranges); - * @endcode - *) - range: PPAVOptionRange; - (** - * Number of ranges per component. - *) - nb_ranges: cint; - (** - * Number of componentes. - *) - nb_components: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - -(** - * Extremely verbose debugging, useful for libav* development. - *) - AV_LOG_TRACE = 56; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Sets additional colors for extended debugging sessions. - * @code - av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); - @endcode - * Requires 256color terminal support. Uses outside debugging is not - * recommended. - *) -{** to be translated if needed - AV_LOG_C(x) (x << 8) -**} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct or NULL if general log. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formatted line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -{$IFDEF FF_API_DLOG} -(** - * av_dlog macros - * @deprecated unused - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) -{$ENDIF} //FF_API_DLOG - -const -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) - AV_LOG_SKIP_REPEATED = 1; - -(** - * Include the log severity in messages originating from codecs. - * - * Results in messages such as: - * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts - *) - AV_LOG_PRINT_LEVEL = 2; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; - -function av_log_get_flags: cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.0/libavutil/mathematics.pas b/src/lib/ffmpeg-3.0/libavutil/mathematics.pas deleted file mode 100644 index 3815ea1f..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/mathematics.pas +++ /dev/null @@ -1,145 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 54.7.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Compute the greatest common divisor of a and b. - * - * @return gcd of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; - * if a == 0 and b == 0, returns 0. - *) -function av_gcd(a, b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a, b, modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timebase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timebase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function guarantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.0/libavutil/mem.pas b/src/lib/ffmpeg-3.0/libavutil/mem.pas deleted file mode 100644 index 2d049ae8..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/mem.pas +++ /dev/null @@ -1,369 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of size * nmemb bytes with av_malloc(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param size Size in bytes of the memory block to be allocated or - * reallocated. - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate a block of memory. - * If *ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param size Size in bytes for the memory block to be allocated or - * reallocated - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_reallocp(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array through a pointer to a pointer. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate a block of size * nmemb bytes with av_mallocz(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a substring of the string s. - * @param s string to be duplicated - * @param len the maximum length of the resulting string (not counting the - * terminating byte). - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strndup({const} s: PAnsiChar; len: size_t): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @note passing a pointer to a NULL pointer is safe and leads to no action. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray_add_nofree(), av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * Function has the same functionality as av_dynarray_add(), - * but it doesn't free memory on fails. It returns error code - * instead and leave current buffer untouched. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @return >=0 on success, negative otherwise. - * @see av_dynarray_add(), av_dynarray2_add() - *) -function av_dynarray_add_nofree(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer): cint; - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add(), av_dynarray_add_nofree() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * All newly allocated space is initially cleared - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.0/libavutil/opt.pas b/src/lib/ffmpeg-3.0/libavutil/opt.pas deleted file mode 100644 index 87ec68aa..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/opt.pas +++ /dev/null @@ -1,507 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 54.7.100 - * - *) - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. Only these - * AVOption fields for which (opt->flags & mask) == flags will have their - * default applied to s. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - * @param mask combination of AV_OPT_FLAG_* - * @param flags combination of AV_OPT_FLAG_* - *) -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all allocated objects in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict2(obj: pointer; var options: PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = (1 << 0); (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = (1 << 1); - -(** - * In av_opt_get, return NULL if the option has a pointer type and is set to NULL, - * rather than returning an empty string. - *) - AV_OPT_ALLOW_NULL = (1 << 2); -(** - * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than - * one component for certain option types. - * @see AVOptionRanges for details. - *) - AV_OPT_MULTI_COMPONENT_RANGE = (1 << 12); - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: {const} pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * @note Any old dictionary present is discarded and replaced with a copy of the new one. The - * caller still owns val is and responsible for freeing it. - *) -function av_opt_set_dict_val(obj: pointer; name: {const} PAnsiChar; val: {const} PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - * - * @note if AV_OPT_ALLOW_NULL is set in search_flags in av_opt_get, and the option has - * AV_OPT_TYPE_STRING or AV_OPT_TYPE_BINARY and is set to NULL, *out_val will be set - * to NULL instead of an allocated empty string. - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @param[out] out_val The returned dictionary is a copy of the actual value and must - * be freed with av_dict_free() by the caller - *) -function av_opt_get_dict_val (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: PAVDictionary): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -function av_opt_copy(dest: pointer;src: {const }pointer): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-3.0/libavutil/pixfmt.pas b/src/lib/ffmpeg-3.0/libavutil/pixfmt.pas deleted file mode 100644 index 3fc61b20..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/pixfmt.pas +++ /dev/null @@ -1,530 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB32 palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bit with AV_PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - {$define AV_PIX_FMT_XVMC := (AV_PIX_FMT_XVMC_MPEG2_IDCT)} -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, most significant bit to 1 -{$IFDEF FF_API_VAAPI} - (** Deprecated pixel formats *) - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - - AV_PIX_FMT_VAAPI = AV_PIX_FMT_VAAPI_VLD, -{$ELSE} - AV_PIX_FMT_VAAPI, -{$ENDIF} - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_YA8, ///< 8bit gray, 8bit alpha -(* see const declaration way down - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -*) - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - - AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb - - AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef - - AV_PIX_FMT_YA16BE, ///< 16bit gray, 16bit alpha (big-endian) - AV_PIX_FMT_YA16LE, ///< 16bit gray, 16bit alpha (little-endian) - - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - (** - * HW acceleration through QSV, data[3] contains a pointer to the - * mfxFrameSurface1 structure. - *) - AV_PIX_FMT_QSV, - (** - * HW acceleration though MMAL, data[3] contains a pointer to the - * MMAL_BUFFER_HEADER_T structure. - *) - AV_PIX_FMT_MMAL, - - AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer - - AV_PIX_FMT_0RGB = $123 + 4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_AYUV64LE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_AYUV64BE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - - AV_PIX_FMT_VIDEOTOOLBOX, ///< hardware decoding through Videotoolbox - - AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian - AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian - - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64LE; -{$ENDIF} - -type -(** - * Chromaticity coordinates of the source primaries. - *) - TAVColorPrimaries = ( - AVCOL_PRI_RESERVED0 = 0, - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_RESERVED = 3, - AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_SMPTEST428_1= 10,///< SMPTE ST 428-1 (CIE 1931 XYZ) - AVCOL_PRI_NB ///< Not part of ABI - ); - -(** - * Color Transfer Characteristic. - *) - TAVColorTransferCharacteristic = ( - AVCOL_TRC_RESERVED0 = 0, - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_RESERVED = 3, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_SMPTEST2084 = 16, ///< SMPTE ST 2084 for 10, 12, 14 and 16 bit systems - AVCOL_TRC_SMPTEST428_1 = 17, ///< SMPTE ST 428-1 - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * YUV colorspace type. - *) - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_RESERVED = 3, - AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - -const - AVCOL_SPC_YCGCO = AVCOL_SPC_YCOCG; - -type -(** - * MPEG vs JPEG YUV range. - *) - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * Location of chroma samples. - * - * Illustration showing the location of the first (top left) chroma sample of the - * image, the left shows only luma, the right - * shows the location of the chroma sample, the 2 could be imagined to overlay - * each other but are drawn separately due to limitations of ASCII - * - * 1st 2nd 1st 2nd horizontal luma sample positions - * v v v v - * ______ ______ - *1st luma line > |X X ... |3 4 X ... X are luma samples, - * | |1 2 1-6 are possible chroma positions - *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4 4:2:0, h264 default for 4:2:0 - AVCHROMA_LOC_CENTER = 2, ///< mpeg1 4:2:0, jpeg 4:2:0, h263 4:2:0 - AVCHROMA_LOC_TOPLEFT = 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); diff --git a/src/lib/ffmpeg-3.0/libavutil/samplefmt.pas b/src/lib/ffmpeg-3.0/libavutil/samplefmt.pas deleted file mode 100644 index b5d5bb03..00000000 --- a/src/lib/ffmpeg-3.0/libavutil/samplefmt.pas +++ /dev/null @@ -1,286 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 54.7.100 - * - *) - -type -(** - * @addtogroup lavu_audio - * @ - * - * @defgroup lavu_sampfmts Audio sample formats - * - * Audio sample format enumeration and related convenience functions. - * @ - * - *) - -(** - * Audio sample formats - * - * - The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * - The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * @par - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - * - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * @ - * - * @defgroup lavu_sampmanip Samples manipulation - * - * Functions that manipulate audio samples - * @ - *) - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.0/rational.pas b/src/lib/ffmpeg-3.0/rational.pas deleted file mode 100644 index 0c795c54..00000000 --- a/src/lib/ffmpeg-3.0/rational.pas +++ /dev/null @@ -1,241 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 54.7.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-3.0/swresample.pas b/src/lib/ffmpeg-3.0/swresample.pas deleted file mode 100644 index a2f4ada9..00000000 --- a/src/lib/ffmpeg-3.0/swresample.pas +++ /dev/null @@ -1,434 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 0.18.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 2; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 0; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 101; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 2; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 0; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 101; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type -(** Dithering algorithms *) - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - -(** Resampling Engines *) - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - -(** Resampling Filter Types *) - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall windowed sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser windowed sinc *) - ); - -(** - * The libswresample context. Unlike libavcodec and libavformat, this structure - * is opaque. This means that if you would like to set options, you must use - * the @ref avoptions API and cannot directly set values to members of the - * structure. - *) - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * - * @param[in,out] s Swr context to initialize - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @param[in] s Swr context to check - * @see swr_init() - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - * - * @param[in] s a pointer to a pointer to Swr context - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Closes the context so that swr_is_initialized() returns 0. - * - * The context can be brought back to life by running swr_init(), - * swr_init() can also be used without swr_close(). - * This function is mainly provided for simplifying the usecase - * where one tries to support libavresample and libswresample. - * - * @param[in,out] s Swr context to be closed - *) -procedure swr_close(s: PSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space, then the input will be buffered. - * You can avoid this buffering by using swr_get_out_samples() to retrieve an - * upper bound on the required number of output samples for the given number of - * input samples. Conversion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - var in_: {const} PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation ("soft" compensation). This function is - * internally called when needed in swr_next_pts(). - * - * @param[in,out] s allocated Swr context. If it is not initialized, - * or SWR_FLAG_RESAMPLE is not set, swr_init() is - * called with the flag set. - * @param[in] sample_delta delta in PTS per sample - * @param[in] compensation_distance number of samples to compensate for - * @return >= 0 on success, AVERROR error codes if: - * @li @c s is NULL, - * @li @c compensation_distance is less than 0, - * @li @c compensation_distance is 0 but sample_delta is not, - * @li compensation unsupported by resampler, or - * @li swr_init() fails when called. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param[in,out] s allocated Swr context, not yet initialized - * @param[in] channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - * - * This function, along with swr_inject_silence(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - * - * This function, along with swr_drop_output(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be: - * @li if it's set to 1 the returned delay is in seconds - * @li if it's set to 1000 the returned delay is in milliseconds - * @li if it's set to the input sample rate then the returned - * delay is in input samples - * @li if it's set to the output sample rate then the returned - * delay is in output samples - * @li if it's the least common multiple of in_sample_rate and - * out_sample_rate then an exact rounding-free delay will be - * returned - * @returns the delay in 1 / @c base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Find an upper bound on the number of samples that the next swr_convert - * call will output, if called with in_samples of input samples. This - * depends on the internal state, and anything changing the internal state - * (like further swr_convert() calls) will may change the number of samples - * swr_get_out_samples() returns for the same number of input samples. - * - * @param in_samples number of input samples. - * @note any call to swr_inject_silence(), swr_convert(), swr_next_pts() - * or swr_set_compensation() invalidates this limit - * @note it is recommended to pass the correct available buffer size - * to all functions like swr_convert() even if swr_get_out_samples() - * indicates that less would be used. - * @returns an upper bound on the number of samples that the next swr_convert - * will output or a negative value to indicate an error - *) -function swr_get_out_samples(s: PSwrContext; in_samples: cint): cint; - cdecl; external sw__resample; - -(** - * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. - * - * This is useful to check if the build-time libswresample has the same version - * as the run-time one. - * - * @returns the unsigned int-typed version - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - * - * @returns the build-time @c ./configure flags - *) -function swresample_configuration(): PAnsiChar; - cdecl; external sw__resample; - -(** - * Return the swr license. - * - * @returns the license of libswresample, determined at build-time - *) -function swresample_license(): PAnsiChar; - cdecl; external sw__resample; - -implementation - -end. - diff --git a/src/lib/ffmpeg-3.0/swscale.pas b/src/lib/ffmpeg-3.0/swscale.pas deleted file mode 100644 index 9b768ff3..00000000 --- a/src/lib/ffmpeg-3.0/swscale.pas +++ /dev/null @@ -1,459 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 3.0.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 4; - LIBSWSCALE_MAX_VERSION_MINOR = 0; - LIBSWSCALE_MAX_VERSION_RELEASE = 100; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @param param extra parameters to tune the used scaler - * For SWS_BICUBIC param[0] and [1] tune the shape of the basis - * function, param[0] tunes f(1) and param[1] f??(1) - * For SWS_GAUSS param[0] tunes the exponent and thus cutoff - * frequency - * For SWS_LANCZOS param[0] tunes the width of the window function - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: {const} PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -(** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-3.1/How to update the ffmpeg files.txt b/src/lib/ffmpeg-3.1/How to update the ffmpeg files.txt deleted file mode 100644 index ae65d477..00000000 --- a/src/lib/ffmpeg-3.1/How to update the ffmpeg files.txt +++ /dev/null @@ -1,20 +0,0 @@ -how to update the ffmpeg files: - -1) buffer.pas - cpu.pas - dict.pas - error.pas - frame.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas - swresample.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-3.1/ToDo.txt b/src/lib/ffmpeg-3.1/ToDo.txt deleted file mode 100644 index b0bd305e..00000000 --- a/src/lib/ffmpeg-3.1/ToDo.txt +++ /dev/null @@ -1,112 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog - - -FFmpeg 3.0 changes: -2016-02-10 - bc9a596 / 9f61abc - lavf 57.25.100 / 57.3.0 - avformat.h - Add AVFormatContext.opaque, io_open and io_close, allowing custom IO - -2016-02-01 - 1dba837 - lavf 57.24.100 - avformat.h, avio.h - Add protocol_whitelist to AVFormatContext, AVIOContext - -2016-01-31 - 66e9d2f - lavu 55.17.100 - frame.h - Add AV_FRAME_DATA_GOP_TIMECODE for exporting MPEG1/2 GOP timecodes. - -2016-01-01 - 5e8b053 / 2c68113 - lavc 57.21.100 / 57.12.0 - avcodec.h - Add AVCodecDescriptor.profiles and avcodec_profile_name(). - -2015-12-28 - 1f9139b - lavf 57.21.100 - avformat.h - Add automatic bitstream filtering; add av_apply_bitstream_filters() - -2015-12-22 - 39a09e9 - lavfi 6.21.101 - avfilter.h - Deprecate avfilter_link_set_closed(). - Applications are not supposed to mess with links, - they should close the sinks. - -2015-12-17 - lavc 57.18.100 / 57.11.0 - avcodec.h dirac.h - xxxxxxx - Add av_packet_add_side_data(). - xxxxxxx - Add AVCodecContext.coded_side_data. - xxxxxxx - Add AVCPBProperties API. - xxxxxxx - Add a new public header dirac.h containing - av_dirac_parse_sequence_header() - -2015-12-11 - 676a93f - lavf 57.20.100 - avformat.h - Add av_program_add_stream_index() - -2015-11-29 - 93fb4a4 - lavc 57.16.101 - avcodec.h - Deprecate rtp_callback without replacement, i.e. it won't be possible to - get image slices before the full frame is encoded any more. The libavformat - rtpenc muxer can still be used for RFC-2190 packetization. - -2015-11-22 - fe20e34 - lavc 57.16.100 - avcodec.h - Add AV_PKT_DATA_FALLBACK_TRACK for making fallback associations between - streams. - -2015-11-22 - ad317c9 - lavf 57.19.100 - avformat.h - Add av_stream_new_side_data(). - -2015-11-22 - e12f403 - lavu 55.8.100 - xtea.h - Add av_xtea_le_init and av_xtea_le_crypt - -2015-11-18 - lavu 55.7.100 - mem.h - Add av_fast_mallocz() - -2015-10-29 - lavc 57.12.100 / 57.8.0 - avcodec.h - xxxxxx - Deprecate av_free_packet(). Use av_packet_unref() as replacement, - it resets the packet in a more consistent way. - xxxxxx - Deprecate av_dup_packet(), it is a no-op for most cases. - Use av_packet_ref() to make a non-refcounted AVPacket refcounted. - xxxxxx - Add av_packet_alloc(), av_packet_clone(), av_packet_free(). - They match the AVFrame functions with the same name. - -2015-10-27 - 1e477a9 - lavu 55.5.100 - cpu.h - Add AV_CPU_FLAG_AESNI. - -2015-10-22 - ee573b4 / a17a766 - lavc 57.9.100 / 57.5.0 - avcodec.h - Add data and linesize array to AVSubtitleRect, to be used instead of - the ones from the embedded AVPicture. - -2015-10-22 - 866a417 / dc923bc - lavc 57.8.100 / 57.0.0 - qsv.h - Add an API for allocating opaque surfaces. - -2015-10-15 - 2c2d162 - lavf 57.4.100 - Remove the latm demuxer that was a duplicate of the loas demuxer. - -2015-10-14 - b994788 / 11c5f43 - lavu 55.4.100 / 55.2.0 - dict.h - Change return type of av_dict_copy() from void to int, so that a proper - error code can be reported. - -2015-09-29 - b01891a / 948f3c1 - lavc 57.3.100 / 57.2.0 - avcodec.h - Change type of AVPacket.duration from int to int64_t. - -2015-09-17 - 7c46f24 / e3d4784 - lavc 57.3.100 / 57.2.0 - d3d11va.h - Add av_d3d11va_alloc_context(). This function must from now on be used for - allocating AVD3D11VAContext. - -2015-09-15 - lavf 57.2.100 - avformat.h - probesize and max_analyze_duration switched to 64bit, both - are only accessible through AVOptions - -2015-09-15 - lavf 57.1.100 - avformat.h - bit_rate was changed to 64bit, make sure you update any - printf() or other type sensitive code - -2015-09-15 - lavc 57.2.100 - avcodec.h - bit_rate/rc_max_rate/rc_min_rate were changed to 64bit, make sure you update - any printf() or other type sensitive code - -2015-09-07 - lavu 55.0.100 / 55.0.0 - c734b34 / b8b5d82 - Change type of AVPixFmtDescriptor.flags from uint8_t to uint64_t. - f53569a / 6b3ef7f - Change type of AVComponentDescriptor fields from uint16_t to int - and drop bit packing. - 151aa2e / 2268db2 - Add step, offset, and depth to AVComponentDescriptor to replace - the deprecated step_minus1, offset_plus1, and depth_minus1. \ No newline at end of file diff --git a/src/lib/ffmpeg-3.1/avcodec.pas b/src/lib/ffmpeg-3.1/avcodec.pas deleted file mode 100644 index dccb6123..00000000 --- a/src/lib/ffmpeg-3.1/avcodec.pas +++ /dev/null @@ -1,6802 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 56.1.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 57; - LIBAVCODEC_MAX_VERSION_MINOR = 48; - LIBAVCODEC_MAX_VERSION_RELEASE = 101; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 57; - LIBAVCODEC_MIN_VERSION_MINOR = 48; - LIBAVCODEC_MIN_VERSION_RELEASE = 101; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @ingroup libavc - * @defgroup lavc_encdec send/receive encoding and decoding API overview - * @{ - * - * The avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/ - * avcodec_receive_packet() functions provide an encode/decode API, which - * decouples input and output. - * - * The API is very similar for encoding/decoding and audio/video, and works as - * follows: - * - Set up and open the AVCodecContext as usual. - * - Send valid input: - * - For decoding, call avcodec_send_packet() to give the decoder raw - * compressed data in an AVPacket. - * - For encoding, call avcodec_send_frame() to give the decoder an AVFrame - * containing uncompressed audio or video. - * In both cases, it is recommended that AVPackets and AVFrames are - * refcounted, or libavcodec might have to copy the input data. (libavformat - * always returns refcounted AVPackets, and av_frame_get_buffer() allocates - * refcounted AVFrames.) - * - Receive output in a loop. Periodically call one of the avcodec_receive_*() - * functions and process their output: - * - For decoding, call avcodec_receive_frame(). On success, it will return - * an AVFrame containing uncompressed audio or video data. - * - For encoding, call avcodec_receive_packet(). On success, it will return - * an AVPacket with a compressed frame. - * Repeat this call until it returns AVERROR(EAGAIN) or an error. The - * AVERROR(EAGAIN) return value means that new input data is required to - * return new output. In this case, continue with sending input. For each - * input frame/packet, the codec will typically return 1 output frame/packet, - * but it can also be 0 or more than 1. - * - * At the beginning of decoding or encoding, the codec might accept multiple - * input frames/packets without returning a frame, until its internal buffers - * are filled. This situation is handled transparently if you follow the steps - * outlined above. - * - * End of stream situations. These require "flushing" (aka draining) the codec, - * as the codec might buffer multiple frames or packets internally for - * performance or out of necessity (consider B-frames). - * This is handled as follows: - * - Instead of valid input, send NULL to the avcodec_send_packet() (decoding) - * or avcodec_send_frame() (encoding) functions. This will enter draining - * mode. - * - Call avcodec_receive_frame() (decoding) or avcodec_receive_packet() - * (encoding) in a loop until AVERROR_EOF is returned. The functions will - * not return AVERROR(EAGAIN), unless you forgot to enter draining mode. - * - Before decoding can be resumed again, the codec has to be reset with - * avcodec_flush_buffers(). - * - * Using the API as outlined above is highly recommended. But it is also - * possible to call functions outside of this rigid schema. For example, you can - * call avcodec_send_packet() repeatedly without calling - * avcodec_receive_frame(). In this case, avcodec_send_packet() will succeed - * until the codec's internal buffer has been filled up (which is typically of - * size 1 per output frame, after initial input), and then reject input with - * AVERROR(EAGAIN). Once it starts rejecting input, you have no choice but to - * read at least some output. - * - * Not all codecs will follow a rigid and predictable dataflow; the only - * guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on - * one end implies that a receive/send call on the other end will succeed. In - * general, no codec will permit unlimited buffering of input or output. - * - * This API replaces the following legacy functions: - * - avcodec_decode_video2() and avcodec_decode_audio4(): - * Use avcodec_send_packet() to feed input to the decoder, then use - * avcodec_receive_frame() to receive decoded frames after each packet. - * Unlike with the old video decoding API, multiple frames might result from - * a packet. For audio, splitting the input packet into frames by partially - * decoding packets becomes transparent to the API user. You never need to - * feed an AVPacket to the API twice. - * Additionally, sending a flush/draining packet is required only once. - * - avcodec_encode_video2()/avcodec_encode_audio2(): - * Use avcodec_send_frame() to feed input to the encoder, then use - * avcodec_receive_packet() to receive encoded packets. - * Providing user-allocated buffers for avcodec_receive_packet() is not - * possible. - * - The new API does not handle subtitles yet. - * - * Mixing new and old function calls on the same AVCodecContext is not allowed, - * and will result in undefined behavior. - * - * Some codecs might require using the new API; using the old API will return - * an error when calling it. - * @} - *) - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of an existing codec ID changes (that would break ABI), - * 2. it is as close as possible to similar codecs - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - PAVCodecID = ^TAVCodecID; - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1 = AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130, - AV_CODEC_ID_G2M, - AV_CODEC_ID_WEBP, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX, - AV_CODEC_ID_PAF_VIDEO, - AV_CODEC_ID_EXR, - AV_CODEC_ID_VP7, - AV_CODEC_ID_SANM, - AV_CODEC_ID_SGIRLE, - AV_CODEC_ID_MVC1, - AV_CODEC_ID_MVC2, - AV_CODEC_ID_HQX, - AV_CODEC_ID_TDSC, - AV_CODEC_ID_HQ_HQA, - AV_CODEC_ID_HAP, - AV_CODEC_ID_DDS, - AV_CODEC_ID_DXV, - AV_CODEC_ID_SCREENPRESSO, - AV_CODEC_ID_RSCC, - - AV_CODEC_ID_Y41P = $8000, - AV_CODEC_ID_AVRP, - AV_CODEC_ID_012V, - AV_CODEC_ID_AVUI, - AV_CODEC_ID_AYUV, - AV_CODEC_ID_TARGA_Y216, - AV_CODEC_ID_V308, - AV_CODEC_ID_V408, - AV_CODEC_ID_YUV4, - AV_CODEC_ID_AVRN, - AV_CODEC_ID_CPIA, - AV_CODEC_ID_XFACE, - AV_CODEC_ID_SNOW, - AV_CODEC_ID_SMVJPEG, - AV_CODEC_ID_APNG, - AV_CODEC_ID_DAALA, - AV_CODEC_ID_CFHD, - AV_CODEC_ID_TRUEMOTION2RT, - AV_CODEC_ID_M101, - AV_CODEC_ID_MAGICYUV, - AV_CODEC_ID_SHEERVIDEO, - AV_CODEC_ID_YLC, - - //* various PCM "codecs" */ - AV_CODEC_ID_FIRST_AUDIO = $10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, - AV_CODEC_ID_PCM_S24LE_PLANAR, - AV_CODEC_ID_PCM_S32LE_PLANAR, - AV_CODEC_ID_PCM_S16BE_PLANAR, - (* new PCM "codecs" should be added right below this line starting with - * an explicit value of for example 0x10800 - *) - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA, -{$IFDEF FF_API_VIMA_DECODER} - AV_CODEC_ID_VIMA = AV_CODEC_ID_ADPCM_VIMA, -{$IFEND} - AV_CODEC_ID_ADPCM_AFC = $11800, - AV_CODEC_ID_ADPCM_IMA_OKI, - AV_CODEC_ID_ADPCM_DTK, - AV_CODEC_ID_ADPCM_IMA_RAD, - AV_CODEC_ID_ADPCM_G726LE, - AV_CODEC_ID_ADPCM_THP_LE, - AV_CODEC_ID_ADPCM_PSX, - AV_CODEC_ID_ADPCM_AICA, - AV_CODEC_ID_ADPCM_IMA_DAT4, - AV_CODEC_ID_ADPCM_MTAF, - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - AV_CODEC_ID_SDX2_DPCM = $14800, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK, - AV_CODEC_ID_PAF_AUDIO, - AV_CODEC_ID_ON2AVC, - AV_CODEC_ID_DSS_SP, - - AV_CODEC_ID_FFWAVESYNTH = $15800, - AV_CODEC_ID_SONIC, - AV_CODEC_ID_SONIC_LS, - AV_CODEC_ID_EVRC, - AV_CODEC_ID_SMV, - AV_CODEC_ID_DSD_LSBF, - AV_CODEC_ID_DSD_MSBF, - AV_CODEC_ID_DSD_LSBF_PLANAR, - AV_CODEC_ID_DSD_MSBF_PLANAR, - AV_CODEC_ID_4GV, - AV_CODEC_ID_INTERPLAY_ACM, - AV_CODEC_ID_XMA1, - AV_CODEC_ID_XMA2, - AV_CODEC_ID_DST, - - //* subtitle codecs */ - AV_CODEC_ID_FIRST_SUBTITLE = $17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, - AV_CODEC_ID_MICRODVD = $17800, - AV_CODEC_ID_EIA_608, - AV_CODEC_ID_JACOSUB, - AV_CODEC_ID_SAMI, - AV_CODEC_ID_REALTEXT, - AV_CODEC_ID_STL, - AV_CODEC_ID_SUBVIEWER1, - AV_CODEC_ID_SUBVIEWER, - AV_CODEC_ID_SUBRIP, - AV_CODEC_ID_WEBVTT, - AV_CODEC_ID_MPL2, - AV_CODEC_ID_VPLAYER, - AV_CODEC_ID_PJS, - AV_CODEC_ID_ASS, - AV_CODEC_ID_HDMV_TEXT_SUBTITLE, - - //* other specific kind of codecs (generally used for attachments) */ - AV_CODEC_ID_FIRST_UNKNOWN = $18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, - - AV_CODEC_ID_BINTEXT = $18800, - AV_CODEC_ID_XBIN, - AV_CODEC_ID_IDF, - AV_CODEC_ID_OTF, - AV_CODEC_ID_SMPTE_KLV, - AV_CODEC_ID_DVD_NAV, - AV_CODEC_ID_TIMED_ID3, - AV_CODEC_ID_BIN_DATA, - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - AV_CODEC_ID_WRAPPED_AVFRAME = $21001 ///< Passthrough codec, AVFrames wrapped in AVPacket - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_descriptor_get() - *) -type - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - - (** - * MIME type(s) associated with the codec. - * May be NULL; if not, a NULL-terminated array of MIME types. - * The first item is always non-NULL and is the preferred MIME type. - *) - mime_types: PAnsiChar; - - (** - * If non-NULL, an array of profiles recognized for this codec. - * Terminated with FF_PROFILE_UNKNOWN. - *) - profiles: PAVProfile; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Codec supports frame reordering. That is, the coded order (the order in which - * the encoded packets are output by the encoders / stored / input to the - * decoders) may be different from the presentation order of the corresponding - * frames. - * - * For codecs that do not have this property set, PTS and DTS should always be - * equal. - *) - AV_CODEC_PROP_REORDER = 1 << 3; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - AV_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - AV_INPUT_BUFFER_MIN_SIZE = 16384; - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead - *) - FF_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead - *) - FF_MIN_BUFFER_SIZE = 16384; -{$ENDIF} - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - * @deprecated use codec private option instead - *) -{$IFDEF FF_API_MOTION_EST} - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); -{$ENDIF} - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONINTRA= 24, ///< discard all non intra frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{ removed, kept for the moment - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -} - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - AV_CODEC_FLAG_UNALIGNED = $0001; // (1 << 0) -(** - * Use fixed qscale. - *) - AV_CODEC_FLAG_QSCALE = $0002; // (1 << 1) -(** - * 4 MV per MB allowed / advanced prediction for H.263. - *) - AV_CODEC_FLAG_4MV = $0004; // (1 << 2) -(** - * Output even those frames that might be corrupted. - *) - AV_CODEC_FLAG_OUTPUT_CORRUPT = $0008; // (1 << 3) -(** - * Use qpel MC. - *) - AV_CODEC_FLAG_QPEL = $0010; // (1 << 4) -(** - * Use internal 2pass ratecontrol in first pass mode. - *) - AV_CODEC_FLAG_PASS1 = $0200; // (1 << 9) -(** - * Use internal 2pass ratecontrol in second pass mode. - *) - AV_CODEC_FLAG_PASS2 = $0400; // (1 << 10) -(** - * loop filter. - *) - AV_CODEC_FLAG_LOOP_FILTER = $0800; // (1 << 11) -(** - * Only decode/encode grayscale. - *) - AV_CODEC_FLAG_GRAY = $2000; // (1 << 13) -(** - * error[?] variables will be set during encoding. - *) - AV_CODEC_FLAG_PSNR = $8000; // (1 << 15) -(** - * Input bitstream might be truncated at a random location - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG_TRUNCATED = $10000; // (1 << 16) -(** - * Use interlaced DCT. - *) - AV_CODEC_FLAG_INTERLACED_DCT = $40000; // (1 << 18) -(** - * Force low delay. - *) - AV_CODEC_FLAG_LOW_DELAY = $80000; // (1 << 19) -(** - * Place global headers in extradata instead of every keyframe. - *) - AV_CODEC_FLAG_GLOBAL_HEADER = $400000; // (1 << 22) -(** - * Use only bitexact stuff (except (I)DCT). - *) - AV_CODEC_FLAG_BITEXACT = $800000; // (1 << 23) -(* Fx : Flag for H.263+ extra options *) -(** - * H.263 advanced intra coding / MPEG-4 AC prediction - *) - AV_CODEC_FLAG_AC_PRED = $1000000; // (1 << 24) -(** - * interlaced motion estimation - *) - AV_CODEC_FLAG_INTERLACED_ME = $20000000; // (1 << 29) - AV_CODEC_FLAG_CLOSED_GOP = $80000000; // (1U << 31) - -(** - * Allow non spec compliant speedup tricks. - *) - AV_CODEC_FLAG2_FAST = $0001; // (1 << 0) -(** - * Skip bitstream encoding. - *) - AV_CODEC_FLAG2_NO_OUTPUT = $0004; // (1 << 2) -(** - * Place global headers at every keyframe instead of in extradata. - *) - AV_CODEC_FLAG2_LOCAL_HEADER = $0008; // (1 << 3) - -(** - * timecode is in drop frame format. DEPRECATED!!!! - *) - AV_CODEC_FLAG2_DROP_FRAME_TIMECODE = $2000; // (1 << 13) - -(** - * Input bitstream might be truncated at a packet boundaries - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG2_CHUNKS = $8000; // (1 << 15) -(** - * Discard cropping information from SPS. - *) - AV_CODEC_FLAG2_IGNORE_CROP = $10000; // (1 << 16) - -(** - * Show all frames before the first keyframe - *) - AV_CODEC_FLAG2_SHOW_ALL = $400000; // (1 << 22) -(** - * Export motion vectors through frame side data - *) - AV_CODEC_FLAG2_EXPORT_MVS = $10000000; // (1 << 28) -(** - * Do not skip samples and export skip information as frame side data - *) - AV_CODEC_FLAG2_SKIP_MANUAL = $20000000; // (1 << 29) -(** - * Do not reset ASS ReadOrder field on flush (subtitles decoding) - *) - AV_CODEC_FLAG2_RO_FLUSH_NOOP = $40000000; - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independent Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - -(** - * Decoder can use draw_horiz_band callback. - *) - AV_CODEC_CAP_DRAW_HORIZ_BAND = $0001; // (1 << 0) -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - AV_CODEC_CAP_DR1 = $0002; // (1 << 1) - AV_CODEC_CAP_TRUNCATED = $0008; // (1 << 3) -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - AV_CODEC_CAP_DELAY = $0020; // (1 << 5) -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - AV_CODEC_CAP_SMALL_LAST_FRAME = $0040; // (1 << 6) - -{$IFDEF FF_API_CAP_VDPAU} -(** - * Codec can export data for HW decoding (VDPAU). - *) - AV_CODEC_CAP_HWACCEL_VDPAU = $0080; // (1 << 7) -{$ENDIF} - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carrying such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - AV_CODEC_CAP_SUBFRAMES = $0100; // (1 << 8) -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - AV_CODEC_CAP_EXPERIMENTAL = $0200; // (1 << 9) -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - AV_CODEC_CAP_CHANNEL_CONF = $0400; // (1 << 10) -(** - * Codec supports frame-level multithreading. - *) - AV_CODEC_CAP_FRAME_THREADS = $1000; // (1 << 12) -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - AV_CODEC_CAP_SLICE_THREADS = $2000; // (1 << 13) -(** - * Codec supports changed parameters at any point. - *) - AV_CODEC_CAP_PARAM_CHANGE = $4000; // (1 << 14) -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - AV_CODEC_CAP_AUTO_THREADS = $8000; // (1 << 15) -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - AV_CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; // (1 << 16) -(** - * Codec is intra only. - *) - AV_CODEC_CAP_INTRA_ONLY = $40000000; -(** - * Codec is lossless. - *) - AV_CODEC_CAP_LOSSLESS = $80000000; - - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = AV_CODEC_FLAG_UNALIGNED; - CODEC_FLAG_QSCALE = AV_CODEC_FLAG_QSCALE; - CODEC_FLAG_4MV = AV_CODEC_FLAG_4MV; - CODEC_FLAG_OUTPUT_CORRUPT = AV_CODEC_FLAG_OUTPUT_CORRUPT; - CODEC_FLAG_QPEL = AV_CODEC_FLAG_QPEL; -{$IFDEF FF_API_GMC} -(** - * @deprecated use the "gmc" private option of the libxvid encoder - *) - CODEC_FLAG_GMC = $0020; ///< use GMC. -{$IFEND} -{$IFDEF FF_API_MV0} -(** - * @deprecated use the flag "mv0" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. -{$IFEND} -{$IFDEF FF_API_INPUT_PRESERVED} -(** - * @deprecated passing reference-counted frames to the encoders replaces this - * flag - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; -{$IFEND} - CODEC_FLAG_PASS1 = AV_CODEC_FLAG_PASS1; - CODEC_FLAG_PASS2 = AV_CODEC_FLAG_PASS2; - CODEC_FLAG_GRAY = AV_CODEC_FLAG_GRAY; -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = AV_CODEC_FLAG_PSNR; - CODEC_FLAG_TRUNCATED = AV_CODEC_FLAG_TRUNCATED; - -{$IFDEF FF_API_NORMALIZE_AQP} -(** - * @deprecated use the flag "naq" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization -{$IFEND} - CODEC_FLAG_INTERLACED_DCT = AV_CODEC_FLAG_INTERLACED_DCT; - CODEC_FLAG_LOW_DELAY = AV_CODEC_FLAG_LOW_DELAY; - CODEC_FLAG_GLOBAL_HEADER = AV_CODEC_FLAG_GLOBAL_HEADER; - CODEC_FLAG_BITEXACT = AV_CODEC_FLAG_BITEXACT; - CODEC_FLAG_AC_PRED = AV_CODEC_FLAG_AC_PRED; - CODEC_FLAG_LOOP_FILTER = AV_CODEC_FLAG_LOOP_FILTER; - CODEC_FLAG_INTERLACED_ME = AV_CODEC_FLAG_INTERLACED_ME; - CODEC_FLAG_CLOSED_GOP = AV_CODEC_FLAG_CLOSED_GOP; - CODEC_FLAG2_FAST = AV_CODEC_FLAG2_FAST; - CODEC_FLAG2_NO_OUTPUT = AV_CODEC_FLAG2_NO_OUTPUT; - CODEC_FLAG2_LOCAL_HEADER = AV_CODEC_FLAG2_LOCAL_HEADER; - CODEC_FLAG2_DROP_FRAME_TIMECODE = AV_CODEC_FLAG2_DROP_FRAME_TIMECODE; - CODEC_FLAG2_IGNORE_CROP = AV_CODEC_FLAG2_IGNORE_CROP; - - CODEC_FLAG2_CHUNKS = AV_CODEC_FLAG2_CHUNKS; - CODEC_FLAG2_SHOW_ALL = AV_CODEC_FLAG2_SHOW_ALL; - CODEC_FLAG2_EXPORT_MVS = AV_CODEC_FLAG2_EXPORT_MVS; - CODEC_FLAG2_SKIP_MANUAL = AV_CODEC_FLAG2_SKIP_MANUAL; - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = AV_CODEC_CAP_DRAW_HORIZ_BAND; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = AV_CODEC_CAP_DR1; - CODEC_CAP_TRUNCATED = AV_CODEC_CAP_TRUNCATED; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = AV_CODEC_CAP_DELAY; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = AV_CODEC_CAP_SMALL_LAST_FRAME; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = AV_CODEC_CAP_HWACCEL_VDPAU; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carrying such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = AV_CODEC_CAP_SUBFRAMES; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = AV_CODEC_CAP_EXPERIMENTAL; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = AV_CODEC_CAP_CHANNEL_CONF; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = AV_CODEC_CAP_FRAME_THREADS; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = AV_CODEC_CAP_SLICE_THREADS; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = AV_CODEC_CAP_PARAM_CHANGE; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = AV_CODEC_CAP_AUTO_THREADS; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = AV_CODEC_CAP_VARIABLE_FRAME_SIZE; - -(** - * Codec is intra only. - *) - CODEC_CAP_INTRA_ONLY = AV_CODEC_CAP_INTRA_ONLY; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = AV_CODEC_CAP_LOSSLESS; -{$ENDIF} (* FF_API_WITHOUT_PREFIX *) - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - // Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note bits 24-31 are reserved for codec specific use (H.264 ref0, MPEG-1 0mv, ...) *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - -{$IFDEF FF_API_RC_STRATEGY} - FF_RC_STRATEGY_XVID = 1; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; -{$ENDIF} - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - -{$IFDEF FF_API_AFD} - {attribute_deprecated} - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; -{$IFEND} - -{$IFDEF FF_API_QUANT_BIAS} - FF_DEFAULT_QUANT_BIAS = 999999; -{$ENDIF} - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG-2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - -{$IFDEF FF_API_CODER_TYPE} - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_CODER_TYPE_DEFLATE = 4; -{$ENDIF} {FF_API_UNUSED_MEMBERS} -{$ENDIF} {FF_API_CODER_TYPE} - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - FF_EC_FAVOR_INTER = 256; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DEBUG_PTS = $00000200; -{$ENDIF} - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; ///< only access through AVOptions from outside libavcodec - FF_DEBUG_VIS_MB_TYPE = $00004000; ///< only access through AVOptions from outside libavcodec -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - FF_DEBUG_GREEN_MD = $00800000; - FF_DEBUG_NOMC = $01000000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; // visualize forward predicted MVs of P-frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; // visualize forward predicted MVs of B-frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; // visualize backward predicted MVs of B-frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; ///< detect bitstream specification deviations - AV_EF_BUFFER = 4; ///< detect improper bitstream length - AV_EF_EXPLODE = 8; ///< abort decoding on minor error detection - - AV_EF_IGNORE_ERR = 32768; ///< ignore errors and continue - AV_EF_CAREFUL = 65536; ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors - AV_EF_COMPLIANT = 131072; ///< consider all spec non compliances as errors - AV_EF_AGGRESSIVE = 262144; ///< consider things that a sane encoder should not do as an error - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; -{$IFDEF FF_API_ARCH_SH4} - FF_IDCT_SH4 = 9; -{$ENDIF} - FF_IDCT_SIMPLEARM = 10; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_IDCT_IPP = 13; -{$ENDIF} - FF_IDCT_XVID = 14; -{$IFDEF FF_API_IDCT_XVIDMMX} - FF_IDCT_XVIDMMX = 14; -{$ENDIF} - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; -{$IFDEF FF_API_ARCH_SPARC} - FF_IDCT_SIMPLEVIS = 18; -{$ENDIF} - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - FF_IDCT_SIMPLEAUTO = 128; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_DTS_EXPRESS = 70; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 1; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 2; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 32768; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_VP9_0 = 0; - FF_PROFILE_VP9_1 = 1; - FF_PROFILE_VP9_2 = 2; - FF_PROFILE_VP9_3 = 3; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - FF_PROFILE_HEVC_REXT = 4; - - - FF_LEVEL_UNKNOWN = -99; - -type - - (** - * This structure describes the bitrate properties of an encoded bitstream. It - * roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD - * parameters for H.264/HEVC. - *) - PAVCPBProperties = ^TAVCPBProperties; - TAVCPBProperties = record - (** - * Maximum bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - max_bitrate: cint; - (** - * Minimum bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - min_bitrate: cint; - (** - * Average bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - avg_bitrate: cint; - - (** - * The size of the buffer to which the ratecontrol is applied, in bits. - * Zero if unknown or unspecified. - *) - buffer_size: cint; - - (** - * The delay between the time the packet this structure is associated with - * is received and the time when it should be decoded, in periods of a 27MHz - * clock. - * - * UINT64_MAX when unknown or unspecified. - *) - vbv_delay: cuint64; - end; {TAVCPBProperties} - - TAVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * This side data should be associated with an audio stream and contains - * ReplayGain information in form of the AVReplayGain struct. - *) - AV_PKT_DATA_REPLAYGAIN, - - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the decoded video frames for - * correct presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_PKT_DATA_DISPLAYMATRIX, - - (** - * This side data should be associated with a video stream and contains - * Stereoscopic 3D information in form of the AVStereo3D struct. - *) - AV_PKT_DATA_STEREO3D, - - (** - * This side data should be associated with an audio stream and corresponds - * to enum AVAudioServiceType. - *) - AV_PKT_DATA_AUDIO_SERVICE_TYPE, - - (** - * This side data contains quality related information from the encoder. - * @code - * u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad). - * u8 picture type - * u8 error count - * u16 reserved - * u64le[error count] sum of squared differences between encoder in and output - * @endcode - *) - AV_PKT_DATA_QUALITY_STATS, - - (** - * This side data contains an integer value representing the stream index - * of a "fallback" track. A fallback track indicates an alternate - * track to use when the current track can not be decoded for some reason. - * e.g. no decoder available for codec. - *) - AV_PKT_DATA_FALLBACK_TRACK, - - (** - * This side data corresponds to the AVCPBProperties struct. - *) - AV_PKT_DATA_CPB_PROPERTIES, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE, - - (** - * MPEGTS stream ID, this is required to pass the stream ID - * information from the demuxer to the corresponding muxer. - *) - AV_PKT_DATA_MPEGTS_STREAM_ID, - - (** - * Mastering display metadata (based on SMPTE-2086:2014). This metadata - * should be associated with a video stream and containts data in the form - * of the AVMasteringDisplayMetadata struct. - *) - AV_PKT_DATA_MASTERING_DISPLAY_METADATA - ); - - PAVPacketSideData = ^TAVPacketSideData; - TAVPacketSideData = record - data: PByte; - size: cint; - type_: TAVPacketSideDataType; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. Encoders are allowed to output empty - * packets, with no compressed data, containing only side data - * (e.g. to update some stream parameters at the end of encoding). - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf field. - * If it is set, the packet data is dynamically allocated and is - * valid indefinitely until a call to av_packet_unref() reduces the - * reference count to 0. - * - * If the buf field is not set av_packet_ref() would make a copy instead - * of increasing the reference count. - * - * The side data is always allocated with av_malloc(), copied by - * av_packet_ref() and freed by av_packet_unref(). - * - * @see av_packet_ref - * @see av_packet_unref - *) - PPAVPacket= ^PAVPacket; - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideData; - side_data_elems: cint; - - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint64; - - pos: cint64; // byte position in stream, -1 if unknown - -{$IFDEF FF_API_CONVERGENCE_DURATION} - (* - * @deprecated Same as the duration field, but as int64_t. This was required - * for Matroska subtitles, whose duration values could overflow when the - * duration field was still an int. - *) - convergence_duration: cint64; {deprecated} -{$ENDIF} - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - - AV_NUM_DATA_POINTERS = 8; - - AV_PKT_DATA_QUALITY_FACTOR = AV_PKT_DATA_QUALITY_STATS; //DEPRECATED - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * The name string for AVOptions options matches the associated command line - * parameter name and can be found in libavcodec/options_table.h - * The AVOption/command line parameter names differ in some cases from the C - * structure field names for historic reasons or brevity. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; -{$IFDEF FF_API_CODEC_NAME} - (** - * @deprecated this field is not used for anything in libavcodec - *) - {attribute_deprecated} - codec_name: array [0..31] of AnsiChar; -{$IFEND} - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - -{$IFDEF FF_API_STREAM_CODEC_TAG} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - stream_codec_tag: cuint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by user, may be overwritten by libavcodec - * if this info is available in the stream - *) - bit_rate: cint64; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * AV_CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * AV_CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * MJPEG: Huffman tables - * rv10: additional flags - * MPEG-4: global headers (they can be in the bitstream or here) - * The allocated memory should be AV_FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * This often, but not always is the inverse of the frame rate or field rate - * for video. 1/time_base is not the average frame rate if the frame rate is not - * constant. - * - * Like containers, elementary streams also can store timestamps, 1/time_base - * is the unit in which these timestamps are specified. - * As example of such codec time base see ISO/IEC 14496-2:2001(E) - * vop_time_increment_resolution and fixed_vop_rate - * (fixed_vop_rate == 0 implies that it is different from the framerate) - * - * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this field is unused (see initial_padding). - * - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - * @note Those fields may not match the values of the last - * AVFrame output by avcodec_decode_video2 due frame - * reordering. - * - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - * @note Those field may not match the value of the last - * AVFrame output by avcodec_receive_frame() due frame - * reordering. - * - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - * @note This field may not match the value of the last - * AVFrame output by avcodec_receive_frame() due frame - * reordering. - * - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec while - * parsing the data. - *) - pix_fmt: TAVPixelFormat; - -{$IFDEF FF_API_MOTION_EST} - (** - * This option does nothing - *@deprecated use codec private options instead - *) - {attribute_deprecated} - me_method: cint; -{$ENDIF} - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @note The callback may be called again immediately if initialization for - * the selected (hardware-accelerated) pixel format failed. - * @warning Behavior is undefined if the callback returns a value not - * in the fmt list of formats. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - -{$IFDEF FF_API_RC_STRATEGY} - (** @deprecated use codec private option instead *) - {attribute_deprecated} - rc_strategy: cint; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - b_frame_strategy: cint; {deprecated} -{$ENDIF} - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - mpeg_quant: cint; {deprecated} -{$ENDIF} - - (** - * qscale factor between P- and I-frames - * If > 0 then the last P- frame quantizer will be used (q = lastp_q * factor + offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - prediction_method: cint; {deprecated} -{$ENDIF} - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - pre_me: cint; {deprecated} -{$ENDIF} - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - -{$IFDEF FF_API_AFD} - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - * @deprecated Deprecated in favor of AVSideData - *) - {attribute_deprecated} - dtg_active_format: cint; -{$IFEND} - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - -{$IFDEF FF_API_QUANT_BIAS} - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - intra_quant_bias: cint; - - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - inter_quant_bias: cint; -{$ENDIF} - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - scenechange_threshold: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - noise_reduction: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - me_threshold: cint; - - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - mb_threshold: cint; -{$ENDIF} - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: Set by libavcodec - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - border_masking: cfloat; -{$ENDIF} - (** - * minimum MB Lagrange multiplier - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB Lagrange multiplier - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** - * @deprecated use encoder private options instead - *) - me_penalty_compensation: cint; {deprecated} -{$ENDIF} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - brd_scale: cint; {deprecated} -{$ENDIF} - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - chromaoffset: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_UNUSED_MEMBERS} - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; {attribute_deprecated} -{$IFEND} - - (** - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - b_sensitivity: cint; {deprecated} -{$ENDIF} - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise extended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * This is always automatically enabled if avcodec_receive_frame() is used. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_qsquish: cfloat; - - {attribute_deprecated} - rc_qmod_amp: cfloat; - {attribute_deprecated} - rc_qmod_freq: cint; -{$ENDIF} - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_eq: {const} PAnsiChar; -{$ENDIF} - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: Set by user, may be overwritten by libavcodec. - *) - rc_max_rate: cint64; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint64; - -{$IFDEF FF_API_MPV_OPT} - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_buffer_aggressivity: cfloat; - - {attribute_deprecated} - rc_initial_cplx: cfloat; -{$ENDIF} - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - -{$IFDEF FF_API_CODER_TYPE} - (** - * @deprecated use encoder private options instead - *) - coder_type: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - context_model: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmin: cint; - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmax: cint; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - frame_skip_threshold: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_factor: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_exp: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_cmp: cint; {deprecated} -{$ENDIF} - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - min_prediction_order: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - max_prediction_order: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - timecode_frame_start: cint64; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_RTP_CALLBACK} - (** - * @deprecated unused - *) - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - rtp_payload_size: cint; {deprecated} (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) -{$ENDIF} - -{$IFDEF FF_API_STAT_BITS} - (* statistics, used for 2-pass encoding *) - mv_bits: cint; {deprecated} - header_bits: cint; {deprecated} - i_tex_bits: cint; {deprecated} - p_tex_bits: cint; {deprecated} - i_count: cint; {deprecated} - p_count: cint; {deprecated} - skip_count: cint; {deprecated} - misc_bits: cint; {deprecated} - - (** @deprecated this field is unused *) - frame_bits: cint; {deprecated} -{$ENDIF} - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG-4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64-bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - -{$IFDEF FF_API_CODED_FRAME} - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - * - * @deprecated use the quality factor packet side data instead - *) - {attribute_deprecated} - coded_frame: PAVFrame; -{$ENDIF} - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_VBV_DELAY} - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - * @deprecated this value is now exported as a part of - * AV_PKT_DATA_CPB_PROPERTIES packet side data - *) - vbv_delay: cuint64; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_SIDEDATA_ONLY_PKT} - (** - * Encoding only and set by default. Allow encoders to output packets - * that do not contain any encoded data, only side data. - * - * Some encoders need to output such packets, e.g. to update some stream - * parameters at the end of encoding. - * - * @deprecated this field disables the default behaviour and - * it is kept only for compatibility. - *) - side_data_only_packets: cint; {deprecated} -{$ENDIF} - - (** - * Audio only. The number of "priming" samples (padding) inserted by the - * encoder at the beginning of the audio. I.e. this number of leading - * decoded samples must be discarded by the caller to get the original audio - * without leading padding. - * - * - decoding: unused - * - encoding: Set by libavcodec. The timestamps on the output packets are - * adjusted by the encoder so that they always refer to the - * first sample of the data actually contained in the packet, - * including any added padding. E.g. if the timebase is - * 1/samplerate and the timestamp of the first input sample is - * 0, the timestamp of the first output packet will be - * -initial_padding. - *) - initial_padding: cint; - - (** - * - decoding: For codecs that store a framerate value in the compressed - * bitstream, the decoder may export it here. { 0, 1} when - * unknown. - * - encoding: May be used to signal the framerate of CFR content to an - * encoder. - *) - framerate: TAVRational; - - (** - * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - * - encoding: unused. - * - decoding: Set by libavcodec before calling get_format() - *) - sw_pix_fmt: TAVPixelFormat; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * Code outside libavcodec should access this field using AVOptions - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavcodec should access this field using AVOptions - * (NO direct access). - * - encoding: Set by user. - * - decoding: Set by user. - *) - dump_separator: Pcuint8; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (* - * Properties of the stream that gets decoded - * To be accessed through av_codec_get_properties() (NO direct access) - * - encoding: unused - * - decoding: set by libavcodec - *) - properties: cuint; - - (** - * Additional data associated with the entire coded stream. - * - * - decoding: unused - * - encoding: may be set by libavcodec after avcodec_open2(). - *) - coded_side_data: PAVPacketSideData; - nb_coded_side_data: cint; - - (** - * Encoding only. - * - * For hardware encoders configured to use a hwaccel pixel format, this - * field should be set by the caller to a reference to the AVHWFramesContext - * describing input frames. AVHWFramesContext.format must be equal to - * AVCodecContext.pix_fmt. - * - * This field should be set before avcodec_open2() is called and is - * afterwards owned and managed by libavcodec. - *) - hw_frames_ctx: PAVBufferRef; - - (** - * Control the form of AVSubtitle.rects[N]->ass - * - decoding: set by user - * - encoding: unused - *) - sub_text_format: cint; - end; {TAVCodecContext} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - -{$IFDEF FF_API_AVPICTURE} - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * Picture data structure. - * - * Up to four components can be stored into it, the last component is - * alpha. - * @deprecated use AVFrame or imgutils functions instead - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; {deprecated} - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; {deprecated} ///< number of bytes per line - end; {TAVPicture} -{$ENDIF} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - -{$IFDEF FF_API_AVPICTURE} - (** - * @deprecated unused - *) - pict: TAVPicture; {deprecated} -{$ENDIF} - (** - * data+linesize for the bitmap of this subtitle. - * Can be set for text/ass as well once they are rendered. - *) - data: Array [0..4] of PByte; - linesize: Array [0..4] of cint; - - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - - (** - * This struct describes the properties of an encoded stream. - * - * sizeof(AVCodecParameters) is not a part of the public ABI, this struct must - * be allocated with avcodec_parameters_alloc() and freed with - * avcodec_parameters_free(). - *) - PPAVCodecParameters = ^PAVCodecParameters; - PAVCodecParameters = ^TAVCodecParameters; - TAVCodecParameters = record - (** - * General type of the encoded data. - *) - codec_type: TAVMediaType; - (** - * Specific type of the encoded data (the codec used). - *) - codec_id: TAVCodecID; - (** - * Additional information about the codec (corresponds to the AVI FOURCC). - *) - codec_tag: cuint32; - - (** - * Extra binary data needed for initializing the decoder, codec-dependent. - * - * Must be allocated with av_malloc() and will be freed by - * avcodec_parameters_free(). The allocated size of extradata must be at - * least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding - * bytes zeroed. - *) - extradata: Pcuint8; - (** - * Size of the extradata content in bytes. - *) - extradata_size: cint; - - (** - * - video: the pixel format, the value corresponds to enum AVPixelFormat. - * - audio: the sample format, the value corresponds to enum AVSampleFormat. - *) - format: cint; - - (** - * The average bitrate of the encoded data (in bits per second). - *) - bit_rate: cint64; - - (** - * The number of bits per sample in the codedwords. - * - * This is basically the bitrate per sample. It is mandatory for a bunch of - * formats to actually decode them. It's the number of bits for one sample in - * the actual coded bitstream. - * - * This could be for example 4 for ADPCM - * For PCM formats this matches bits_per_raw_sample - * Can be 0 - *) - bits_per_coded_sample: cint; - - (** - * This is the number of valid bits in each output sample. If the - * sample format has more bits, the least significant bits are additional - * padding bits, which are always 0. Use right shifts to reduce the sample - * to its actual size. For example, audio formats with 24 bit samples will - * have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. - * To get the original sample use "(int32_t)sample >> 8"." - * - * For ADPCM this might be 12 or 16 or similar - * Can be 0 - *) - bits_per_raw_sample: cint; - - (** - * Codec-specific bitstream restrictions that the stream conforms to. - *) - profile: cint; - level: cint; - - (** - * Video only. The dimensions of the video frame in pixels. - *) - width: cint; - height: cint; - - (** - * Video only. The aspect ratio (width / height) which a single pixel - * should have when displayed. - * - * When the aspect ratio is unknown / undefined, the numerator should be - * set to 0 (the denominator may have any value). - *) - sample_aspect_ratio: TAVRational; - - (** - * Video only. The order of the fields in interlaced video. - *) - field_order: TAVFieldOrder; - - (** - * Video only. Additional colorspace characteristics. - *) - color_range: TAVColorRange; - color_primaries: TAVColorPrimaries; - color_trc: TAVColorTransferCharacteristic; - color_space: TAVColorSpace; - chroma_location: TAVChromaLocation; - - (** - * Video only. Number of delayed frames. - *) - video_delay: cint; - - (** - * Audio only. The channel layout bitmask. May be 0 if the channel layout is - * unknown or unspecified, otherwise the number of bits set must be equal to - * the channels field. - *) - channel_layout: cuint64; - (** - * Audio only. The number of audio channels. - *) - channels: cint; - (** - * Audio only. The number of audio samples per second. - *) - sample_rate: cint; - (** - * Audio only. The number of bytes per coded audio frame, required by some - * formats. - * - * Corresponds to nBlockAlign in WAVEFORMATEX. - *) - block_align: cint; - (** - * Audio only. Audio frame size, if known. Required by some formats to be static. - *) - frame_size: cint; - - (** - * Audio only. The amount of padding (in samples) inserted by the encoder at - * the beginning of the audio. I.e. this number of leading decoded samples - * must be discarded by the caller to get the original audio without leading - * padding. - *) - initial_padding: cint; - (** - * Audio only. The amount of padding (in samples) appended by the encoder to - * the end of the audio. I.e. this number of decoded samples must be - * discarded by the caller from the end of the stream to get the original - * audio without any trailing padding. - *) - trailing_padding: cint; - (** - * Audio only. Number of samples to skip after a discontinuity. - *) - seek_preroll: cint; - end; {TAVCodecParameters} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see AV_CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< maximum value for lowres supported by the decoder, no direct access, use av_codec_get_max_lowres() - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Decode/encode API with decoupled packet/frame dataflow. The API is the - * same as the avcodec_ prefixed APIs (avcodec_send_frame() etc.), except - * that: - * - never called if the codec is closed or the wrong type, - * - AVPacket parameter change side data is applied right before calling - * AVCodec->send_packet, - * - if AV_CODEC_CAP_DELAY is not set, drain packets or frames are never sent, - * - only one drain packet is ever passed down (until the next flush()), - * - a drain AVPacket is always NULL (no need to check for avpkt->size). - *) - send_frame: function(avctx: PAVCodecContext; frame: {const} PAVFrame): cint; cdecl; - send_packet: function(avctx: PAVCodecContext; frame: {const} PAVPacket): cint; cdecl; - receive_frame: function(avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - receive_packet: function(avctx: PAVCodecContext; avpkt: PAVPacket): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - (** - * Internal codec capabilities. - * See FF_CODEC_CAP_* in internal.h - *) - caps_internal: cint; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * @defgroup lavc_hwaccel AVHWAccel - * @{ - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVHWAccel; - - (** - * Allocate a custom buffer - *) - alloc_frame: function (avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - frame_priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the ff_mpv_decode_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - decode_mb: procedure(s: PMpegEncContext); cdecl; - - (** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - *) - init: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - *) - uninit: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - *) - priv_data_size: cint; - end; {TAVHWAccel} - -const - (** - * Hardware acceleration should be used for decoding even if the codec level - * used is unknown or higher than the maximum supported level reported by the - * hardware driver. - * - * It's generally a good idea to pass this flag unless you have a specific - * reason not to, as hardware tends to under-report supported levels. - *) - AV_HWACCEL_FLAG_IGNORE_LEVEL = (1 << 0); - - (** - * Hardware acceleration can output YUV pixel formats with a different chroma - * sampling than 4:2:0 and/or other than 8 bits per component. - *) - AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = (1 << 1); - - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - FF_CODEC_PROPERTY_LOSSLESS = $00000001; - FF_CODEC_PROPERTY_CLOSED_CAPTIONS = $00000002; - FF_SUB_TEXT_FMT_ASS = 0; -{$IFDEF FF_API_ASS_TIMING} - FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS = 1; -{$ENDIF} - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_codec_properties(avctx: {const} PAVCodecContext): cuint; - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct should be freed with avcodec_free_context(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Free the codec context and everything associated with it and write NULL to - * the provided pointer. - *) -procedure avcodec_free_context(var avctx: PAVCodecContext); - cdecl; external av__codec; - -{$IFDEF FF_API_GET_CONTEXT_DEFAULTS} -(** - * @deprecated This function should not be used, as closing and opening a codec - * context multiple time is not supported. A new codec context should be - * allocated for each new use. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -{$IFDEF FF_API_COPY_CONTEXT} -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - * - * @deprecated The semantics of this function are ill-defined and it should not - * be used. If you need to transfer the stream parameters from one codec context - * to another, use an intermediate AVCodecParameters instance and the - * avcodec_parameters_from_context() / avcodec_parameters_to_context() - * functions. - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Allocate a new AVCodecParameters and set its fields to default values - * (unknown/invalid/0). The returned struct must be freed with - * avcodec_parameters_free(). - *) -function avcodec_parameters_alloc(): PAVCodecParameters; - cdecl; external av__codec; - -(** - * Free an AVCodecParameters instance and everything associated with it and - * write NULL to the supplied pointer. - *) -procedure avcodec_parameters_free(par: PPAVCodecParameters); - cdecl; external av__codec; - -(** - * Copy the contents of src to dst. Any allocated fields in dst are freed and - * replaced with newly allocated duplicates of the corresponding fields in src. - * - * @return >= 0 on success, a negative AVERROR code on failure. - *) -function avcodec_parameters_copy(dst: PAVCodecParameters; src: {const} PAVCodecParameters): cint; - cdecl; external av__codec; - -(** - * Fill the parameters struct based on the values from the supplied codec - * context. Any allocated fields in par are freed and replaced with duplicates - * of the corresponding fields in codec. - * - * @return >= 0 on success, a negative AVERROR code on failure - *) -function avcodec_parameters_from_context(par: PAVCodecParameters; - codec: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Fill the codec context based on the values from the supplied codec - * parameters. Any allocated fields in codec that have a corresponding field in - * par are freed and replaced with duplicates of the corresponding field in par. - * Fields in codec that do not have a counterpart in par are not touched. - * - * @return >= 0 on success, a negative AVERROR code on failure. - *) -function avcodec_parameters_to_context(codec: PAVCodecContext; - par: {const} PAVCodecParameters): cint; - cdecl; external av__codec; - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_receive_frame()). - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * for this context, then this parameter MUST be either NULL or - * equal to the previously passed codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() with a non-NULL - * codec. Subsequent calls will do nothing. - * - * @note Do not use this function. Use avcodec_free_context() to destroy a - * codec context (either open or closed). Opening and closing a codec context - * multiple times is not supported anymore -- use multiple codec contexts - * instead. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -(** - * Allocate an AVPacket and set its fields to default values. The resulting - * struct must be freed using av_packet_free(). - * - * @return An AVPacket filled with default values or NULL on failure. - * - * @note this only allocates the AVPacket itself, not the data buffers. Those - * must be allocated through other means such as av_new_packet. - * - * @see av_new_packet - *) -function av_packet_alloc(): PAVPacket; - cdecl; external av__codec; - -(** - * Create a new packet that references the same data as src. - * - * This is a shortcut for av_packet_alloc()+av_packet_ref(). - * - * @return newly created AVPacket on success, NULL on error. - * - * @see av_packet_alloc - * @see av_packet_ref - *) -function av_packet_clone(src: PAVPacket): PAVPacket; - cdecl; external av__codec; - -(** - * Free the packet, if the packet is reference counted, it will be - * unreferenced first. - * - * @param packet packet to be freed. The pointer will be set to NULL. - * @note passing NULL is a no-op. - *) -procedure av_packet_free(pkt: PPAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVPACKET_OLD_API} -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - * - * @deprecated Use av_packet_ref - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @deprecated Use av_packet_unref - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Wrap an existing array as a packet side data. - * - * @param pkt packet - * @param type side information type - * @param data the side data array. It must be allocated with the av_malloc() - * family of functions. The ownership of the data is transferred to - * pkt. - * @param size side information size - * @return a non-negative number on success, a negative AVERROR code on - * failure. On failure, the packet is unchanged and the data remains - * owned by the caller. - *) -function av_packet_add_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - data: Pcuint8; size: size_t): cint; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_side_data_name(type_: TAVPacketSideDataType): PAnsiChar; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Convert valid timing fields (timestamps / durations) in a packet from one - * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be - * ignored. - * - * @param pkt packet on which the conversion will be performed - * @param tb_src source timebase, in which the timing fields in pkt are - * expressed - * @param tb_dst destination timebase, to which the timing fields will be - * converted - *) -procedure av_packet_rescale_ts(pkt: PAVPacket; tb_src, tb_dst: TAVRational); - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * AV_CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame and the return value would be - * less than the packet size. In this case, avcodec_decode_audio4 has to be - * called again with an AVPacket containing the remaining data in order to - * decode the second frame, etc... Even if no frames are returned, the packet - * needs to be fed to the decoder with remaining data until it is completely - * consumed or an error occurs. - * - * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning samples. It is safe to flush even those decoders that are not - * marked with AV_CODEC_CAP_DELAY, then no samples will be returned. - * - * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. Note that this field being set to zero - * does not mean that an error has occurred. For - * decoders with AV_CODEC_CAP_DELAY set, no given decode - * call is guaranteed to produce a frame. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - * - * @deprecated Use avcodec_send_packet() and avcodec_receive_frame(). - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be AV_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note Codecs which have the AV_CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - * - * @deprecated Use avcodec_send_packet() and avcodec_receive_frame(). - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; deprecated; - -(* - * Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning subtitles. It is safe to flush even those decoders that are not - * marked with CODEC_CAP_DELAY, then no subtitles will be returned. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, - * must be freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Supply raw packet data as input to a decoder. - * - * Internally, this call will copy relevant AVCodecContext fields, which can - * influence decoding per-packet, and apply them when the packet is actually - * decoded. (For example AVCodecContext.skip_frame, which might direct the - * decoder to drop the frame contained by the packet sent with this function.) - * - * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @warning Do not mix this API with the legacy API (like avcodec_decode_video2()) - * on the same AVCodecContext. It will return unexpected results now - * or in future libavcodec versions. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx codec context - * @param[in] avpkt The input AVPacket. Usually, this will be a single video - * frame, or several complete audio frames. - * Ownership of the packet remains with the caller, and the - * decoder will not write to the packet. The decoder may create - * a reference to the packet data (or copy it if the packet is - * not reference-counted). - * Unlike with older APIs, the packet is always fully consumed, - * and if it contains multiple frames (e.g. some audio codecs), - * will require you to call avcodec_receive_frame() multiple - * times afterwards before you can send a new packet. - * It can be NULL (or an AVPacket with data set to NULL and - * size set to 0); in this case, it is considered a flush - * packet, which signals the end of the stream. Sending the - * first flush packet will return success. Subsequent ones are - * unnecessary and will return AVERROR_EOF. If the decoder - * still has frames buffered, it will return them after sending - * a flush packet. - * - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted right now - the packet must be - * resent after trying to read output - * AVERROR_EOF: the decoder has been flushed, and no new packets can - * be sent to it (also returned if more than 1 flush - * packet is sent) - * AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate decoding errors - *) -function avcodec_send_packet(avctx: PAVCodecContext; avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Return decoded output data from a decoder. - * - * @param avctx codec context - * @param frame This will be set to a reference-counted video or audio - * frame (depending on the decoder type) allocated by the - * decoder. Note that the function will always call - * av_frame_unref(frame) before doing anything else. - * - * @return - * 0: success, a frame was returned - * AVERROR(EAGAIN): output is not available right now - user must try - * to send new input - * AVERROR_EOF: the decoder has been fully flushed, and there will be - * no more output frames - * AVERROR(EINVAL): codec not opened, or it is an encoder - * other negative values: legitimate decoding errors - *) -function avcodec_receive_frame(avctx: PAVCodecContext; frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Supply a raw video or audio frame to the encoder. Use avcodec_receive_packet() - * to retrieve buffered output packets. - * - * @param avctx codec context - * @param[in] frame AVFrame containing the raw audio or video frame to be encoded. - * Ownership of the frame remains with the caller, and the - * encoder will not write to the frame. The encoder may create - * a reference to the frame data (or copy it if the frame is - * not reference-counted). - * It can be NULL, in which case it is considered a flush - * packet. This signals the end of the stream. If the encoder - * still has packets buffered, it will return them after this - * call. Once flushing mode has been entered, additional flush - * packets are ignored, and sending frames will return - * AVERROR_EOF. - * - * For audio: - * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted right now - the frame must be - * resent after trying to read output packets - * AVERROR_EOF: the encoder has been flushed, and no new frames can - * be sent to it - * AVERROR(EINVAL): codec not opened, refcounted_frames not set, it is a - * decoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate decoding errors - *) -function avcodec_send_frame(avctx: PAVCodecContext; frame: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Read encoded data from the encoder. - * - * @param avctx codec context - * @param avpkt This will be set to a reference-counted packet allocated by the - * encoder. Note that the function will always call - * av_frame_unref(frame) before doing anything else. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): output is not available right now - user must try - * to send input - * AVERROR_EOF: the encoder has been fully flushed, and there will be - * no more output packets - * AVERROR(EINVAL): codec not opened, or it is an encoder - * other errors: legitimate decoding errors - *) -function avcodec_receive_packet(avctx: PAVCodecContext; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - -{$IFDEF FF_API_CONVERGENCE_DURATION} - (** - * @deprecated unused - *) - convergence_duration: cint64; {deprecated} -{$ENDIF} - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - (** - * Picture number incremented in presentation or output order. - * This field may be reinitialized at the first picture of a new sequence. - * - * For example, this corresponds to H.264 PicOrderCnt. - *) - output_picture_number: cint; - - (** - * Dimensions of the decoded video intended for presentation. - *) - width: cint; - height: cint; - - (** - * Dimensions of the coded video. - *) - coded_width: cint; - coded_height: cint; - - (** - * The format of the coded data, corresponds to enum AVPixelFormat for video - * and for enum AVSampleFormat for audio. - * - * Note that a decoder can have considerable freedom in how exactly it - * decodes the data, so the format reported here might be different from the - * one returned by a decoder. - *) - format: cint; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - (* This callback never returns an error, a negative value means that - * the frame start was in a previous packet. *) - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: {const} PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_packet_unref(). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - * - * @deprecated use avcodec_send_frame()/avcodec_receive_packet() instead - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; deprecated; - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_packet_unref(). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - * - * @deprecated use avcodec_send_frame()/avcodec_receive_packet() instead - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; deprecated; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -{$IFDEF FF_API_AVPICTURE} -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * @deprecated unused - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_fill_arrays() instead. - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_copy_to_buffer() instead. - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_get_buffer_size() instead. - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated av_image_copy() instead. - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * @deprecated see av_get_pix_fmt_loss() - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @deprecated see av_find_best_pix_fmt_of_2() - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -{$IFDEF AV_HAVE_INCOMPATIBLE_LIBAV_ABI} -function avcodec_find_best_pix_fmt2(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ELSE} -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec_id the ID of the codec to which the requested profile belongs - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - * - * @note unlike av_get_profile_name(), which searches a list of profiles - * supported by a specific decoder or encoder implementation, this - * function searches the list of profiles from the AVCodecDescriptor - *) -function avcodec_profile_name(codec_id: TAVCodecID; profile: cint): {const} PChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -(** - * This function is the same as av_get_audio_frame_duration(), except it works - * with AVCodecParameters instead of an AVCodecContext. - *) -function av_get_audio_frame_duration2(par: PAVCodecParameters; frame_bytes: cint): cint; - cdecl; external av__codec; - -type -{$IFDEF FF_API_OLD_BSF} - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - (** - * Internal default arguments, used if NULL is passed to av_bitstream_filter_filter(). - * Not for access by library users. - *) - args: PChar; - end; -{$ENDIF} - - PAVBSFInternal = ^TAVBSFInternal; - TAVBSFInternal = record - end; - - (** - * The bitstream filter state. - * - * This struct must be allocated with av_bsf_alloc() and freed with - * av_bsf_free(). - * - * The fields in the struct will only be changed (by the caller or by the - * filter) as described in their documentation, and are to be considered - * immutable otherwise. - *) - PPAVBSFContext = ^PAVBSFContext; - PAVBSFContext = ^TAVBSFContext; - TAVBSFContext = record - (** - * A class for logging and AVOptions - *) - av_class: {const} PAVClass; - - (** - * The bitstream filter this context is an instance of. - *) - filter: {const} PAVBitStreamFilter; - - (** - * Opaque libavcodec internal data. Must not be touched by the caller in any - * way. - *) - internal: PAVBSFInternal; - - (** - * Opaque filter-specific private data. If filter->priv_class is non-NULL, - * this is an AVOptions-enabled struct. - *) - priv_data: pointer; - - (** - * Parameters of the input stream. Set by the caller before av_bsf_init(). - *) - par_in: PAVCodecParameters; - - (** - * Parameters of the output stream. Set by the filter in av_bsf_init(). - *) - par_out: PAVCodecParameters; - - (** - * The timebase used for the timestamps of the input packets. Set by the - * caller before av_bsf_init(). - *) - time_base_in: TAVRational; - - (** - * The timebase used for the timestamps of the output packets. Set by the - * filter in av_bsf_init(). - *) - time_base_out: TAVRational; - end; {TAVBSFContext} - - TAVBitStreamFilter = record - name: PAnsiChar; - - (** - * A list of codec ids supported by the filter, terminated by - * AV_CODEC_ID_NONE. - * May be NULL, in that case the bitstream filter works with any codec id. - *) - codec_ids: PAVCodecID; - - (** - * A class for the private data, used to declare bitstream filter private - * AVOptions. This field is NULL for bitstream filters that do not declare - * any options. - * - * If this field is non-NULL, the first member of the filter private data - * must be a pointer to AVClass, which will be set by libavcodec generic - * code to this class. - *) - priv_class: PAVClass; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - priv_data_size: cint; - init: function(ctx: PAVBSFContext): cint; cdecl; - filter: function(ctx: PAVBSFContext; pkt: PAVPacket): cint; cdecl; - close: procedure(ctx: PAVBSFContext); cdecl; - end; - -{$IFDEF FF_API_OLD_BSF} -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; deprecated; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; deprecated; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is available in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output buffer is not allocated and - * should be considered identical to the input buffer, or in case - * *poutbuf was set it points to the input buffer (not necessarily to - * its starting address). A special case is if *poutbuf was set to NULL and - * *poutbuf_size was set to 0, which indicates the packet should be dropped. - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; deprecated; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: {const} PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * @return a bitstream filter with the specified name or NULL if no such - * bitstream filter exists. - *) -function av_bsf_get_by_name(name: {const} PAnsiChar): {const} PAVBitStreamFilter; - cdecl; external av__codec; - -(** - * Iterate over all registered bitstream filters. - * - * @param opaque a pointer where libavcodec will store the iteration state. Must - * point to NULL to start the iteration. - * - * @return the next registered bitstream filter or NULL when the iteration is - * finished - *) -function av_bsf_next(opaque: pointer): {const} PAVBitStreamFilter; - cdecl; external av__codec; - -(** - * Allocate a context for a given bitstream filter. The caller must fill in the - * context parameters as described in the documentation and then call - * av_bsf_init() before sending any data to the filter. - * - * @param filter the filter for which to allocate an instance. - * @param ctx a pointer into which the pointer to the newly-allocated context - * will be written. It must be freed with av_bsf_free() after the - * filtering is done. - * - * @return 0 on success, a negative AVERROR code on failure - *) -function av_bsf_alloc(filter: {const} PAVBitStreamFilter; ctx: PPAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Prepare the filter for use, after all the parameters and options have been - * set. - *) -function av_bsf_init(ctx: PAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Submit a packet for filtering. - * - * After sending each packet, the filter must be completely drained by calling - * av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or - * AVERROR_EOF. - * - * @param pkt the packet to filter. The bitstream filter will take ownership of - * the packet and reset the contents of pkt. pkt is not touched if an error occurs. - * This parameter may be NULL, which signals the end of the stream (i.e. no more - * packets will be sent). That will cause the filter to output any packets it - * may have buffered internally. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_bsf_send_packet(ctx: PAVBSFContext; pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Retrieve a filtered packet. - * - * @param[out] pkt this struct will be filled with the contents of the filtered - * packet. It is owned by the caller and must be freed using - * av_packet_unref() when it is no longer needed. - * This parameter should be "clean" (i.e. freshly allocated - * with av_packet_alloc() or unreffed with av_packet_unref()) - * when this function is called. If this function returns - * successfully, the contents of pkt will be completely - * overwritten by the returned data. On failure, pkt is not - * touched. - * - * @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the - * filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there - * will be no further output from the filter. Another negative AVERROR value if - * an error occurs. - * - * @note one input packet may result in several output packets, so after sending - * a packet with av_bsf_send_packet(), this function needs to be called - * repeatedly until it stops returning 0. It is also possible for a filter to - * output fewer packets than were sent to it, so this function may return - * AVERROR(EAGAIN) immediately after a successful av_bsf_send_packet() call. - *) -function av_bsf_receive_packet(ctx: PAVBSFContext; pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Free a bitstream filter context and everything associated with it; write NULL - * into the supplied pointer. - *) -procedure av_bsf_free(ctx: PPAVBSFContext); - cdecl; external av__codec; - -(** - * Get the AVClass for AVBSFContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function av_bsf_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbiage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: {const} PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. The "mutex" argument to the function points - * to a (void * ) where the lockmgr should store/get a pointer to a user - * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the - * value left by the last call for all other ops. If the lock manager is - * unable to perform the op then it should leave the mutex in the same - * state as when it was called and return a non-zero value. However, - * when called with AV_LOCK_DESTROY the mutex will always be assumed to - * have been successfully destroyed. If av_lockmgr_register succeeds - * it will return a non-negative value, if it fails it will return a - * negative value and destroy all mutex and unregister all callbacks. - * av_lockmgr_register is not thread-safe, it must be called from a - * single thread before any calls which make use of locking are used. - * - * @param cb User defined callback. av_lockmgr_register invokes calls - * to this callback and the previously registered callback. - * The callback will be used to create more than one mutex - * each of which must be backed by its own underlying locking - * mechanism (i.e. do not use a single static object to - * implement your lock manager). If cb is set to NULL the - * lockmgr will be unregistered. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Allocate a CPB properties structure and initialize its fields to default - * values. - * - * @param size if non-NULL, the size of the allocated struct will be written - * here. This is useful for embedding it in side data. - * - * @return the newly allocated struct or NULL on failure - *) -function av_cpb_properties_alloc(size: Psize_t): PAVCPBProperties; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-3.1/avformat.pas b/src/lib/ffmpeg-3.1/avformat.pas deleted file mode 100644 index 752a2317..00000000 --- a/src/lib/ffmpeg-3.1/avformat.pas +++ /dev/null @@ -1,3118 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 56.4.101 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 2.4.* - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 57; - LIBAVFORMAT_MAX_VERSION_MINOR = 41; - LIBAVFORMAT_MAX_VERSION_RELEASE = 100; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 57; - LIBAVFORMAT_MIN_VERSION_MINOR = 40; - LIBAVFORMAT_MIN_VERSION_RELEASE = 101; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * @defgroup libavf I/O and Muxing/Demuxing Library - * @ - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * It is possible to configure lavf muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @section urls - * URL strings in libavformat are made of a scheme/protocol, a ':', and a - * scheme specific string. URLs without a scheme and ':' used for local files - * are supported but deprecated. "file:" should be used for local files. - * - * It is important that the scheme string is not taken from untrusted - * sources without checks. - * - * Note that some schemes/protocols are quite powerful, allowing access to - * both local and remote files, parts of them, concatenations of them, local - * audio and video devices and so on. - * - * @defgroup lavf_decoding Demuxing - * @ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "file:in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_send_packet() or avcodec_decode_subtitle2() if the - * caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_packet_unref() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @ - * - * @defgroup lavf_encoding Muxing - * @ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codecpar "stream codec parameters" information, such as the - * codec @ref AVCodecParameters.codec_type "type", @ref AVCodecParameters.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVStream.time_base "stream timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - It is advised to manually initialize only the relevant fields in - * AVCodecParameters, rather than using @ref avcodec_parameters_copy() during - * remuxing: there is no guarantee that the codec context values remain valid - * for both input and output format contexts. - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase - * requested by the caller. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @section lavf_io_dirlist Directory listing - * The directory listing API makes it possible to list files on remote servers. - * - * Some of possible use cases: - * - an "open file" dialog to choose files from a remote location, - * - a recursive media finder providing a player with an ability to play all - * files from a given directory. - * - * @subsection lavf_io_dirlist_open Opening a directory - * At first, a directory needs to be opened by calling avio_open_dir() - * supplied with a URL and, optionally, ::AVDictionary containing - * protocol-specific parameters. The function returns zero or positive - * integer and allocates AVIODirContext on success. - * - * @code - * AVIODirContext *ctx = NULL; - * if (avio_open_dir(&ctx, "smb://example.com/some_dir", NULL) < 0) { - * fprintf(stderr, "Cannot open directory.\n"); - * abort(); - * } - * @endcode - * - * This code tries to open a sample directory using smb protocol without - * any additional parameters. - * - * @subsection lavf_io_dirlist_read Reading entries - * Each directory's entry (i.e. file, another directory, anything else - * within ::AVIODirEntryType) is represented by AVIODirEntry. - * Reading consecutive entries from an opened AVIODirContext is done by - * repeatedly calling avio_read_dir() on it. Each call returns zero or - * positive integer if successful. Reading can be stopped right after the - * NULL entry has been read -- it means there are no entries left to be - * read. The following code reads all entries from a directory associated - * with ctx and prints their names to standard output. - * @code - * AVIODirEntry *entry = NULL; - * for (;;) { - * if (avio_read_dir(ctx, &entry) < 0) { - * fprintf(stderr, "Cannot list directory.\n"); - * abort(); - * } - * if (!entry) - * break; - * printf("%s\n", entry->name); - * avio_free_directory_entry(&entry); - * } - * @endcode - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - *) - -//type - -(* - * @defgroup metadata_api Public Metadata API - * @ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @ - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_LAVF_FRAC} -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; -{$ENDIF} - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - {const} mime_type: PAnsiChar; (**< mime_type, when known. *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MIME = 75; ///< score for file mime type - AVPROBE_SCORE_MAX = 100; ///< maximum score - - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) -{$IFDEF FF_API_LAVF_FMT_RAWPICTURE} - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. @deprecated Not used anymore *) -{$ENDIF} - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) - AVFMT_TS_NONSTRICT = $20000;(**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_FLUSH_PACKETS = $0200; ///< Flush the AVIOContext every packet. -(** - * When muxing, try to avoid writing any random/volatile data to the output. - * This includes any random IDs, real-time timestamps/dates, muxer version, etc. - * - * This flag is mainly intended for testing. - *) - AVFMT_FLAG_BITEXACT = $0400; - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - AVFMT_FLAG_FAST_SEEK = $80000; ///< Enable fast, but inaccurate seeks for some formats - - // used by AVStream - AVSTREAM_EVENT_FLAG_METADATA_UPDATED = $0001; ///< The call resulted in updated metadata. - MAX_STD_TIMEBASES = (30*12+30+3+6); - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The single packet associated with it will be returned - * among the first few packets read from the file unless seeking takes place. - * It can also be accessed at any time in AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - AVFMT_EVENT_FLAG_METADATA_UPDATED = 0001; ///< The call resulted in updated metadata. - - RAW_PACKET_BUFFER_SIZE = 2500000; - - AVFMT_AVOID_NEG_TS_AUTO = -1; ///< Enabled when required by target format - AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 1; ///< Shift timestamps so they are non negative - AVFMT_AVOID_NEG_TS_MAKE_ZERO = 2; ///< Shift timestamps so that they start at 0 - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - - PAVDeviceCapabilitiesQuery = ^TAVDeviceCapabilitiesQuery; - TAVDeviceCapabilitiesQuery = record - end; - - PFFFrac = ^TFFFrac; - TFFFrac = record - val: cint64; - num: cint64; - den: cint64; - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - data_codec: TAVCodecID; (**< default data codec *) - - (** - * Initialize format. May allocate data here, and set any AVFormatContext or - * AVStream parameters that need to be set before packets are sent. - * This method must not write output. - * - * Any allocations made here must be freed in deinit(). - *) - init: function(s: PAVFormatContext): cint; cdecl; - - (** - * Deinitialize format. If present, this is called whenever the muxer is being - * destroyed, regardless of whether or not the header has been written. - * - * If a trailer is being written, this is called after write_trailer(). - * - * This is called if init() fails as well. - *) - deinit: procedure(s: PAVFormatContext); - - (** - * Set up any necessary bitstream filtering and extract any extra data needed - * for the global header. - * Return 0 if more packets from this stream must be checked; 1 if not. - *) - check_bitstream: function(s: PAVFormatContext; pkt: {const} PAVPacket): cint; cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (** - * Comma-separated list of mime types. - * It is used check for matching mime types while probing. - * @see av_probe_input_format2 - *) - mime_type: {const} PAnsiChar; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) -{$IFDEF FF_API_LAVF_AVCTX} - (** - * @deprecated use the codecpar struct instead - *) - codec: PAVCodecContext; {deprecated} -{$ENDIF} - priv_data: pointer; - -{$IFDEF FF_API_LAVF_FRAC} - (** - * @deprecated this field is unused - *) - pts: TAVFrac; {attribute_deprecated} -{$ENDIF} - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the desired timebase. In - * avformat_write_header(), the muxer will overwrite this field - * with the timebase that will actually be used for the timestamps - * written into the file (which may or may not be related to the - * user-provided one, depending on the format). - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - * - * - demuxing: May be set by libavformat when creating the stream or in - * avformat_find_stream_info(). - * - muxing: May be set by the caller before avformat_write_header(). - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (** - * An array of side data that applies to the whole stream (i.e. the - * container does not allow it to change between packets). - * - * There may be no overlap between the side data in this array and side data - * in the packets. I.e. a given side data is either exported by the muxer - * (demuxing) / set by the caller (muxing) in this array, then it never - * appears in the packets, or the side data is exported / sent through - * the packets (always in the first packet where the value becomes known or - * changes), then it does not appear in this array. - * - * - demuxing: Set by libavformat when the stream is created. - * - muxing: May be set by the caller before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - * - * @see av_format_inject_global_side_data() - *) - side_data: PAVPacketSideData; - - (** - * The number of elements in the AVStream.side_data array. - *) - nb_side_data: cint; - - (** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. - *) - event_flags: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * If not 0, the number of samples that should be skipped from the start of - * the stream (the samples are removed from packets with pts==0, which also - * assumes negative timestamps do not happen). - * Intended for use with formats such as mp3 with ad-hoc gapless audio - * support. - *) - start_skip_samples: cint64; - - (** - * If not 0, the first audio sample that should be discarded from the stream. - * This is broken by design (needs global sample count), but can't be - * avoided for broken by design formats such as mp3 with ad-hoc gapless - * audio support. - *) - first_discard_sample: cint64; - - (** - * The sample after last sample that is intended to be discarded after - * first_discard_sample. Works on frame boundaries only. Used to prevent - * early EOF if the gapless info is broken (considered concatenated mp3s). - *) - last_discard_sample: cint64; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - (** - * Internal data to inject global side data - *) - inject_global_side_data: cint; - - (** - * String containing paris of key and values describing recommended encoder configuration. - * Paris are separated by ','. - * Keys are separated from values by '='. - *) - recommended_encoder_configuration: PAnsiChar; - - (** - * display aspect ratio (0 if unknown) - * - encoding: unused - * - decoding: Set by libavformat to calculate sample_aspect_ratio internally - *) - display_aspect_ratio: TAVRational; - - priv_pts: PFFFrac; - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: pointer; - - (* - * Codec parameters associated with this stream. Allocated and freed by - * libavformat in avformat_new_stream() and avformat_free_context() - * respectively. - * - * - demuxing: filled by libavformat on stream creation or in - * avformat_find_stream_info() - * - muxing: filled by the caller before avformat_write_header() - *) - codecpar: PAVCodecParameters; - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - TAVOpenCallback = function (s: PAVFormatContext; pb: PPAVIOContext; url: {const} PAnsiChar; flags: cint; - int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - * - * Fields can be accessed through AVOptions (av_opt* ), - * the name string used matches the associated command line parameter name and - * can be found in libavformat/options_table.h. - * The AVOption/command line parameter names differ in some cases from the C - * structure field names for historic reasons or brevity. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - (** - * Flags signalling stream properties. A combination of AVFMTCTX_*. - * Set by libavformat. - *) - ctx_flags: cint; - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint64; - - packet_size: cuint; - max_delay: cint; - - (** - * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. - * Set by the user before avformat_open_input() / avformat_write_header(). - *) - flags: cint; - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input(). - *) - probesize: cint64; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - * Can be set to 0 to let avformat choose using a heuristic. - *) - max_analyze_duration: cint64; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * - muxing: Set by the caller before avformat_write_header(). If set to - * either 0 or AV_NOPTS_VALUE, then the current wall-time will - * be used. - * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that - * the value may become known after some number of frames - * have been received. - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Allow non-standard and experimental extension - * @see AVCodecContext.strict_std_compliance - *) - strict_std_compliance: cint; - - (** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. - *) - event_flags: cint; - - (** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - *) - max_ts_probe: cint; - - (** - * Avoid negative timestamps during muxing. - * Any value of the AVFMT_AVOID_NEG_TS_* constants. - * Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) - * - muxing: Set by user - * - demuxing: unused - *) - avoid_negative_ts: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cint64; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (** - * format probing score. - * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes - * the format. - * - encoding: unused - * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) - *) - probe_score: cint; - - (** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - format_probesize: cint; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (** - * ',' separated list of allowed demuxers. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - format_whitelist: PAnsiChar; - - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_video_codec (NO direct access). - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). - *) - subtitle_codec: PAVCodec; - - (** - * Forced data codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_data_codec (NO direct access). - *) - data_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user via AVOptions (NO direct access) - *) - output_ts_offset: cint64; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavformat should access this field using AVOptions - * (NO direct access). - * - muxing: Set by user. - * - demuxing: Set by user. - *) - dump_separator: Pcuint8; - - (** - * Forced Data codec_id. - * Demuxing: Set by user. - *) - data_codec_id: TAVCodecID; -{$IFDEF FF_API_OLD_OPEN_CALLBACKS} - (** - * Called to open further IO contexts when needed for demuxing. - * - * This can be set by the user application to perform security checks on - * the URLs before opening them. - * The function should behave like avio_open2(), AVFormatContext is provided - * as contextual information and to reach AVFormatContext.opaque. - * - * If NULL then some simple checks are used together with avio_open2(). - * - * Must not be accessed directly from outside avformat. - * @See av_format_set_open_cb() - * - * Demuxing: Set by user. - * - * @deprecated Use io_open and io_close. - *) - open_cb: function(s: PAVFormatContext; p: PPAVIOContext; url: {const} PAnsiChar; flags: cint; int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; {deprecated} -{$ENDIF} - - (** - * ',' separated list of allowed protocols. - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - protocol_whitelist: pchar; - - (* - * A callback for opening new IO streams. - * - * Whenever a muxer or a demuxer needs to open an IO stream (typically from - * avformat_open_input() for demuxers, but for certain formats can happen at - * other times as well), it will call this callback to obtain an IO context. - * - * @param s the format context - * @param pb on success, the newly opened IO context should be returned here - * @param url the url to open - * @param flags a combination of AVIO_FLAG_* - * @param options a dictionary of additional options, with the same - * semantics as in avio_open2() - * @return 0 on success, a negative AVERROR code on failure - * - * @note Certain muxers and demuxers do nesting, i.e. they open one or more - * additional internal format contexts. Thus the AVFormatContext pointer - * passed to this callback may be different from the one facing the caller. - * It will, however, have the same 'opaque' field. - *) - io_open: function(s: PAVFormatContext; pb: PPAVIOContext; url: {const} pchar; - flags: cint; options: PPAVDictionary): cint; cdecl; - - (** - * A callback for closing the streams opened with AVFormatContext.io_open(). - *) - io_close: procedure(s: PAVFormatContext; pb: PAVIOContext); cdecl; - - (** - * ',' separated list of disallowed protocols. - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - protocol_blacklist: PAnsiChar; - end; (** TAVFormatContext **) - -function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_data_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_data_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; -procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; -procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; -function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; -procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; -{$IFDEF FF_API_OLD_OPEN_CALLBACKS} -function av_format_get_open_cb(s: {const} PAVFormatContext): TAVOpenCallback; {deprecated} - cdecl; external av__format; -procedure av_format_set_open_cb(s: PAVFormatContext; callback: TAVOpenCallback); {deprecated} - cdecl; external av__format; -{$ENDIF} - -(** - * This function will cause global side data to be injected in the next packet - * of each stream as well as after any subsequent seek. - *) -procedure av_format_inject_global_side_data(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; -function av_stream_get_parser(s: {const} PAVStream): PAVCodecParserContext; - cdecl; external av__format; -function av_stream_get_recommended_encoder_configuration({const} s: PAVStream): PAnsiChar; - cdecl; external av__format; -procedure av_stream_set_recommended_encoder_configuration(s: PAVStream; configuration: PAnsiChar); - cdecl; external av__format; - -(** - * Returns the pts of the last muxed packet + its duration - * - * the retuned value is undefined when used with a demuxer. - *) -function av_stream_get_end_pts(st: {const} PAVStream): cint64; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: {const} PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: {const} PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -(** - * Allocate new information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_stream_new_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: cint): Pcuint8; - cdecl; external av__format; - -(** - * Get side information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_stream_get_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param url the url of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer2(pb: PAVIOContext; var fmt: PAVInputFormat; - url: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Like av_probe_input_buffer2() but returns 0 on success - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - url: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param url URL of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; url: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -procedure av_program_add_stream_index(ac: PAVFormatContext; progid: cint; idx: cuint); - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until avformat_close_input(). Otherwise the packet - * is valid indefinitely. In both cases the packet must be freed with - * av_packet_unref when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Discard all internally buffered data. This can be useful when dealing with - * discontinuities in the byte stream. Generally works only with formats that - * can resync. This includes headerless formats like MPEG-TS/TS but should also - * work with NUT, Ogg and in a limited way AVI for example. - * - * The set of streams, the detected duration, stream parameters and codecs do - * not change when calling this function. If you want a complete reset, it's - * better to open a new AVFormatContext. - * - * This does not flush the AVIOContext (s->pb). If necessary, call - * avio_flush(s->pb) before calling this function. - * - * @param s media file handle - * @return >=0 on success, error code otherwise - *) -function avformat_flush(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". - *
- * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") - * must be set to correct values in the stream's timebase (unless the - * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then - * they can be set to AV_NOPTS_VALUE). - * The dts for subsequent packets passed to this function must be strictly - * increasing when compared in their respective timebases (unless the - * output format is flagged with the AVFMT_TS_NONSTRICT, then they - * merely have to be nondecreasing). @ref AVPacket.duration - * "duration") should also be set if known. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * Using this function instead of av_write_frame() can give muxers advance - * knowledge of future packets, improving e.g. the behaviour of the mp4 - * muxer for VFR content in fragmenting mode. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". - *
- * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") - * must be set to correct values in the stream's timebase (unless the - * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then - * they can be set to AV_NOPTS_VALUE). - * The dts for subsequent packets in one stream must be strictly - * increasing (unless the output format is flagged with the - * AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). - * @ref AVPacket.duration "duration") should also be set if known. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write an uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write an uncoded frame to an output media file. - * - * If the muxer supports it, this function makes it possible to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: {const} PAVPacket; dump_payload: cint; st: {const} PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: {const} PAVPacket; dump_payload: cint; - st: {const} PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - url: {const} PAnsiChar); - cdecl; external av__format; - -(** - * Print detailed information about the input or output format, such as - * duration, bitrate, streams, container, programs, metadata, side data, - * codec and time base. - * - * @param ic the context to analyze - * @param index index of the stream to dump information about - * @param url the URL to print, such as source or destination file - * @param is_output Select whether the specified context is an input(0) or output(1) - *) -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: {const} PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: {const} PAVOutputFormat; codec_id: TAVCodecID; - std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Apply a list of bitstream filters to a packet. - * - * @param codec AVCodecContext, usually from an AVStream - * @param pkt the packet to apply filters to. If, on success, the returned - * packet has size == 0 and side_data_elems == 0, it indicates that - * the packet should be dropped - * @param pkt the packet to apply filters to - * @param bsfc a NULL-terminated list of filters to apply - * @return >=0 on success; - * AVERROR code on failure - *) -{$IFDEF FF_API_OLD_BSF} -function av_apply_bitstream_filters(codec: PAVCodecContext; pkt: PAVPacket; - bsfc: PAVBitStreamFilterContext): cint; - cdecl; external av__format; deprecated; -{$ENDIF} -implementation - -end. diff --git a/src/lib/ffmpeg-3.1/avio.pas b/src/lib/ffmpeg-3.1/avio.pas deleted file mode 100644 index 023429e0..00000000 --- a/src/lib/ffmpeg-3.1/avio.pas +++ /dev/null @@ -1,928 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 56.4.101 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - - (** - * Directory entry types. - *) - TAVIODirEntryType = ( - AVIO_ENTRY_UNKNOWN, - AVIO_ENTRY_BLOCK_DEVICE, - AVIO_ENTRY_CHARACTER_DEVICE, - AVIO_ENTRY_DIRECTORY, - AVIO_ENTRY_NAMED_PIPE, - AVIO_ENTRY_SYMBOLIC_LINK, - AVIO_ENTRY_SOCKET, - AVIO_ENTRY_FILE, - AVIO_ENTRY_SERVER, - AVIO_ENTRY_SHARE, - AVIO_ENTRY_WORKGROUP - ); - - TAVIODataMarkerType = ( - (** - * Header data; this needs to be present for the stream to be decodeable. - *) - AVIO_DATA_MARKER_HEADER, - (** - * A point in the output bytestream where a decoder can start decoding - * (i.e. a keyframe). A demuxer/decoder given the data flagged with - * AVIO_DATA_MARKER_HEADER, followed by any AVIO_DATA_MARKER_SYNC_POINT, - * should give decodeable results. - *) - AVIO_DATA_MARKER_SYNC_POINT, - (** - * A point in the output bytestream where a demuxer can start parsing - * (for non self synchronizing bytestream formats). That is, any - * non-keyframe packet start point. - *) - AVIO_DATA_MARKER_BOUNDARY_POINT, - (** - * This is any, unlabelled data. It can either be a muxer not marking - * any positions at all, it can be an actual boundary/sync point - * that the muxer chooses not to mark, or a later part of a packet/fragment - * that is cut into multiple write callbacks due to limited IO buffer size. - *) - AVIO_DATA_MARKER_UNKNOWN, - (** - * Trailer data, which doesn't contain actual content, but only for - * finalizing the output file. - *) - AVIO_DATA_MARKER_TRAILER - ); - - (** - * Describes single entry of the directory. - * - * Only name and type fields are guaranteed be set. - * Rest of fields are protocol or/and platform dependent and might be unknown. - *) - PPAVIODirEntry = ^PAVIODirEntry; - PAVIODirEntry = ^TAVIODirEntry; - TAVIODirEntry = record - name: PAnsiChar; (**< Filename *) - type_: cint; (**< Type of the entry *) - utf8: cint; (**< Set to 1 when name is encoded with UTF-8, 0 otherwise. - Name can be encoded with UTF-8 even though 0 is set. *) - size: cint64; (**< File size in bytes, -1 if unknown. *) - modification_timestamp: cint64; (**< Time of last modification in microseconds since unix - epoch, -1 if unknown. *) - access_timestamp: cint64; (**< Time of last access in microseconds since unix epoch, - -1 if unknown. *) - status_change_timestamp: cint64; (**< Time of last status change in microseconds since unix - epoch, -1 if unknown. *) - user_id: cint64; (**< User ID of owner, -1 if unknown. *) - group_id: cint64; (**< Group ID of owner, -1 if unknown. *) - filemode: cint64; (**< Unix file mode, -1 if unknown. *) - end; - - PPAVIODirContext = ^PAVIODirContext; - PAVIODirContext = ^TAVIODirContext; - TAVIODirContext = record - url_context: pointer; - (** struct URLContext *url_context; *) - end; - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - - (* - * The following shows the relationship between buffer, buf_ptr, buf_end, buf_size, - * and pos, when reading and when writing (since AVIOContext is used for both): - * - ********************************************************************************** - * READING - ********************************************************************************** - * - * | buffer_size | - * |---------------------------------------| - * | | - * - * buffer buf_ptr buf_end - * +---------------+-----------------------+ - * |/ / / / / / / /|/ / / / / / /| | - * read buffer: |/ / consumed / | to be read /| | - * |/ / / / / / / /|/ / / / / / /| | - * +---------------+-----------------------+ - * - * pos - * +-------------------------------------------+-----------------+ - * input file: | | | - * +-------------------------------------------+-----------------+ - * - * - ********************************************************************************** - * WRITING - ********************************************************************************** - * - * | buffer_size | - * |-------------------------------| - * | | - * - * buffer buf_ptr buf_end - * +-------------------+-----------+ - * |/ / / / / / / / / /| | - * write buffer: | / to be flushed / | | - * |/ / / / / / / / / /| | - * +-------------------+-----------+ - * - * pos - * +--------------------------+-----------------------------------+ - * output file: | | | - * +--------------------------+-----------------------------------+ - * - *) - - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - - (** - * Original buffer size - * used internally after probing and ensure seekback to reset the buffer size - * This field is internal to libavformat and access from outside is not allowed. - *) - orig_buffer_size: cint; - - (** - * Threshold to favor readahead over seek. - * This is current internal only, do not use from outside. - *) - short_seek_threshold: cint; - - (** - * ',' separated list of allowed protocols. - *) - protocol_whitelist: {const} PAnsiChar; - - (** - * A callback that is used instead of write_packet. - *) - write_data_type: function(opaque: pointer; buf: Pcuint8; buf_size: cint; - type_: TAVIODataMarkerType; time: cint64): cint; cdecl; - (** - * If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT, - * but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly - * small chunks of data returned from the callback). - *) - ignore_boundary_point: cint; - - (** - * Internal, not meant to be used from outside of AVIOContext. - *) - current_type: TAVIODataMarkerType; - last_time: cint64; - end; {AVIOContext} - -(* unbuffered I/O *) - -(** - * Return the name of the protocol that will handle the passed URL. - * - * NULL is returned if no protocol could be found for the given URL. - * - * @return Name of the protocol or NULL. - *) -function avio_find_protocol_name(url: {const} PAnsiChar): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Move or rename a resource. - * - * @note url_src and url_dst should share the same protocol and authority. - * - * @param url_src url to resource to be moved - * @param url_dst new url to resource if the operation succeeded - * @return >=0 on success or negative on error. - *) -function avpriv_io_move(url_src: {const} PAnsiChar; url_dst: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Delete a resource. - * - * @param url resource to be deleted. - * @return >=0 on success or negative on error. - *) -function avpriv_io_delete(url: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Open directory for reading. - * - * @param s directory read context. Pointer to a NULL pointer must be passed. - * @param url directory to be listed. - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dictionary - * containing options that were not found. May be NULL. - * @return >=0 on success or negative on error. - *) -function avio_open_dir(s: PPAVIODirContext; url: {const} PAnsiChar; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Get next directory entry. - * - * Returned entry must be freed with avio_free_directory_entry(). In particular - * it may outlive AVIODirContext. - * - * @param s directory read context. - * @param[out] next next entry or NULL when no more entries. - * @return >=0 on success or negative on error. End of list is not considered an - * error. - *) -function avio_read_dir(s: PAVIODirContext; next: PPAVIODirEntry): cint; - cdecl; external av__format; - -(** - * Close directory. - * - * @note Entries created using avio_read_dir() are not deleted and must be - * freeded with avio_free_directory_entry(). - * - * @param s directory read context. - * @return >=0 on success or negative on error. - *) -function avio_close_dir(s: PPAVIODirContext): cint; - cdecl; external av__format; - -(** - * Free entry allocated by avio_read_dir(). - * - * @param entry entry to be freed. - *) -procedure avio_free_directory_entry(entry: PPAVIODirEntry); - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * It may be freed and replaced with a new buffer by libavformat. - * AVIOContext.buffer holds the buffer currently in use, - * which must be later freed with av_free(). - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16BE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16be(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Mark the written bytestream as a specific type. - * - * Zero-length ranges are omitted from the output. - * - * @param time the stream time the current bytestream pos corresponds to - * (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not - * applicable - * @param type the kind of data written starting at the current pos - *) -procedure avio_write_marker(s: PAVIOContext; time: cint64; type_: TAVIODataMarkerType); - cdecl; external av__format; - -const -(** - * ORing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Passing this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function avio_feof(s: PAVIOContext): cint; - cdecl; external av__format; -{$IFDEF FF_API_URL_FEOF} -(** - * @deprecated use avio_feof() - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; {attribute_deprecated} -{$ENDIF} - -(** @warning Writes up to 4 KiB per call *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data. - * - * For write streams, force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - * - * For read streams, discard all currently buffered data, and advance the - * reported file position to that of the underlying stream. This does not - * read new data, and does not perform any seeks. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -(* Avoid a warning. The header can not be included because it breaks c++. *) -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; - -(** - * Read contents of h into print buffer, up to max_size bytes, or up to EOF. - * - * @return 0 for success (max_size bytes read or EOF reached), negative error - * code otherwise - *) -function avio_read_to_bprint(h: PAVIOContext; pb: PAVBPrint; max_size: size_t): cint; - cdecl; external av__format; - -(** - * Accept and allocate a client context on a server context. - * @param s the server context - * @param c the client context, must be unallocated - * @return >= 0 on success or a negative value corresponding - * to an AVERROR on failure - *) -function avio_accept(s: PAVIOContext; c: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Perform one step of the protocol handshake to accept a new client. - * This function must be called on a client returned by avio_accept() before - * using it as a read/write context. - * It is separate from avio_accept() because it may block. - * A step of the handshake is defined by places where the application may - * decide to change the proceedings. - * For example, on a protocol with a request header and a reply header, each - * one can constitute a step because the application may use the parameters - * from the request to change parameters in the reply; or each individual - * chunk of the request can constitute a step. - * If the handshake is already finished, avio_handshake() does nothing and - * returns 0 immediately. - * - * @param c the client context to perform the handshake on - * @return 0 on a complete and successful handshake - * > 0 if the handshake progressed, but is not complete - * < 0 for an AVERROR code - *) -function avio_handshake(c: PAVIOContext): cint; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-3.1/avutil.pas b/src/lib/ffmpeg-3.1/avutil.pas deleted file mode 100644 index 6d256e96..00000000 --- a/src/lib/ffmpeg-3.1/avutil.pas +++ /dev/null @@ -1,366 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 54.7.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 55; - LIBAVUTIL_MAX_VERSION_MINOR = 28; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 55; - LIBAVUTIL_MIN_VERSION_MINOR = 27; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return an informative version string. This usually is the actual release - * version number or a git commit description. This string has no fixed format - * and can change any time. It should never be parsed by code. - *) -function av_version_info(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG-4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -(** - * Return the fractional representation of the internal time base. - *) -function av_get_time_base_q: TAVRational; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -function AVERROR(e: integer): integer; -begin - AVERROR := AVERROR_SIGN * e; -end; - -end. diff --git a/src/lib/ffmpeg-3.1/ff_api-defines.inc b/src/lib/ffmpeg-3.1/ff_api-defines.inc deleted file mode 100644 index a90acbe9..00000000 --- a/src/lib/ffmpeg-3.1/ff_api-defines.inc +++ /dev/null @@ -1,251 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_VIMA_DECODER} -{$define FF_API_VIMA_DECODER := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := FF_API_AUDIO_CONVERT} -{$endif} -{$ifndef FF_API_GETCHROMA} -{$define FF_API_GETCHROMA := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_SH4} -{$define FF_API_ARCH_SH4 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_SPARC} -{$define FF_API_ARCH_SPARC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_UNUSED_MEMBERS} -{$define FF_API_UNUSED_MEMBERS := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_IDCT_XVIDMMX} -{$define FF_API_IDCT_XVIDMMX := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_INPUT_PRESERVED} -{$define FF_API_INPUT_PRESERVED := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NORMALIZE_AQP} -{$define FF_API_NORMALIZE_AQP := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_GMC} -{$define FF_API_GMC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MV0} -{$define FF_API_MV0 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_CODEC_NAME} -{$define FF_API_CODEC_NAME := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AFD} -{$define FF_API_AFD := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VISMV} -(* XXX: don't forget to drop the -vismv documentation *) -{$define FF_API_VISMV := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AUDIOENC_DELAY} -{$define FF_API_AUDIOENC_DELAY := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VAAPI_CONTEXT} -{$define FF_API_VAAPI_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCTX_TIMEBASE} -{$define FF_API_AVCTX_TIMEBASE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MPV_OPT} -{$define FF_API_MPV_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STREAM_CODEC_TAG} -{$define FF_API_STREAM_CODEC_TAG := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_QUANT_BIAS} -{$define FF_API_QUANT_BIAS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_RC_STRATEGY} -{$define FF_API_RC_STRATEGY := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CODED_FRAME} -{$define FF_API_CODED_FRAME := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MOTION_EST} -{$define FF_API_MOTION_EST := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_WITHOUT_PREFIX} -{$define FF_API_WITHOUT_PREFIX := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_SIDEDATA_ONLY_PKT} -{$define FF_API_SIDEDATA_ONLY_PKT:= (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_VDPAU_PROFILE} -{$define FF_API_VDPAU_PROFILE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CONVERGENCE_DURATION} -{$define FF_API_CONVERGENCE_DURATION := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_AVPICTURE} -{$define FF_API_AVPICTURE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_AVPACKET_OLD_API} -{$define FF_API_AVPACKET_OLD_API := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_RTP_CALLBACK} -{$define FF_API_RTP_CALLBACK := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_VBV_DELAY} -{$define FF_API_VBV_DELAY := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CODER_TYPE} -{$define FF_API_CODER_TYPE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STAT_BITS} -{$define FF_API_STAT_BITS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_PRIVATE_OPT} -{$define FF_API_PRIVATE_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_ASS_TIMING} -{$define FF_API_ASS_TIMING := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_OLD_BSF} -{$define FF_API_OLD_BSF := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_COPY_CONTEXT} -{$define FF_API_COPY_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_GET_CONTEXT_DEFAULTS} -{$define FF_API_GET_CONTEXT_DEFAULTS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_NVENC_OLD_NAME} -{$define FF_API_NVENC_OLD_NAME := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DLOG} -{$define FF_API_DLOG := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_VAAPI} -{$define FF_API_VAAPI := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FRAME_QP} -{$define FF_API_FRAME_QP := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_PLUS1_MINUS1} -{$define FF_API_PLUS1_MINUS1 := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ERROR_FRAME} -{$define FF_API_ERROR_FRAME := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CRC_BIG_TABLE} -{$define FF_API_CRC_BIG_TABLE := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_LAVF_BITEXACT} -{$define FF_API_LAVF_BITEXACT := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_FRAC} -{$define FF_API_LAVF_FRAC := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_CODEC_TB} -{$define FF_API_LAVF_CODEC_TB := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_URL_FEOF} -{$define FF_API_URL_FEOF := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_FMT_RAWPICTURE} -{$define FF_API_LAVF_FMT_RAWPICTURE := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_COMPUTE_PKT_FIELDS2} -{$define FF_API_COMPUTE_PKT_FIELDS2 := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_OLD_OPEN_CALLBACKS} -{$define FF_API_OLD_OPEN_CALLBACKS := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_AVCTX} -{$define FF_API_LAVF_AVCTX := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} - -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** swscale FF_API defines *) -{$ifndef FF_API_SWS_VECTOR} -{$define FF_API_SWS_VECTOR := (LIBSWSCALE_VERSION_MAJOR < 6)} -{$endif} - -{$ENDIF PASDOC} diff --git a/src/lib/ffmpeg-3.1/libavcodec/audioconvert.pas b/src/lib/ffmpeg-3.1/libavcodec/audioconvert.pas deleted file mode 100644 index 38bef39c..00000000 --- a/src/lib/ffmpeg-3.1/libavcodec/audioconvert.pas +++ /dev/null @@ -1,294 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_HEXADECAGONAL = (AV_CH_LAYOUT_OCTAGONAL or AV_CH_WIDE_LEFT or AV_CH_WIDE_RIGHT or AV_CH_TOP_BACK_LEFT or - AV_CH_TOP_BACK_RIGHT or AV_CH_TOP_BACK_CENTER or AV_CH_TOP_FRONT_CENTER or - AV_CH_TOP_FRONT_LEFT or AV_CH_TOP_FRONT_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - AVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} \ No newline at end of file diff --git a/src/lib/ffmpeg-3.1/libavutil/buffer.pas b/src/lib/ffmpeg-3.1/libavutil/buffer.pas deleted file mode 100644 index 0cf47b05..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/buffer.pas +++ /dev/null @@ -1,309 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 54.7.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - TAlloc2 = function(opaque: pointer; size: cint): PAVBufferRef; - TPoolFree = procedure(opaque: pointer); - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Same as av_buffer_alloc(), except the returned buffer will be initialized - * to zero. - *) -function av_buffer_allocz(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferPool; - cdecl; external av__util; - -(** - * Allocate and initialize a buffer pool with a more complex allocator. - * - * @param size size of each buffer in this pool - * @param opaque arbitrary user data used by the allocator - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. - * @param pool_free a function that will be called immediately before the pool - * is freed. I.e. after av_buffer_pool_can_uninit() is called - * by the pool and all the frames are returned to the pool and - * freed. It is intended to uninitialize the user opaque data. - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init2(size: cint; opaque: pointer; - alloc: TAlloc2; - pool_free: TPoolFree): PAVBufferPool; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.1/libavutil/cpu.pas b/src/lib/ffmpeg-3.1/libavutil/cpu.pas deleted file mode 100644 index 1e1e6777..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/cpu.pas +++ /dev/null @@ -1,124 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 54.7.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AESNI = $80000; ///< Advanced Encryption Standard functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_AVXSLOW = $8000000; ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer) - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - AV_CPU_FLAG_VSX = $0002; ///< ISA 2.06 - AV_CPU_FLAG_POWER8 = $0004; ///< ISA 2.07 - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - AV_CPU_FLAG_ARMV8 = (1 << 6); - AV_CPU_FLAG_VFP_VM = (1 << 7); ///< VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations - AV_CPU_FLAG_SETEND = (1 <<16); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in an application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.1/libavutil/dict.pas b/src/lib/ffmpeg-3.1/libavutil/dict.pas deleted file mode 100644 index ef54610c..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/dict.pas +++ /dev/null @@ -1,168 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 54.7.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - AV_DICT_MULTIKEY = 64; (**< Allow to store several equal keys in the dictionary *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get({const} m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, - * these arguments will be freed on error. - * - * Warning: Adding a new entry to a dictionary invalidates all existing entries - * previously returned with av_dict_get. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) - * @param value entry value to add to *pm (will be av_strduped or added as a new key depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Convenience wrapper for av_dict_set that converts the value to a string - * and stores it. - * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. - *) -function av_dict_set_int(var pm: PAVDictionary; {const} key: PAnsiChar; - value: cint64; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - * @return 0 on success, negative AVERROR code on failure. If dst was allocated - * by this function, callers should free the associated memory. - *) -function av_dict_copy(var dst: PAVDictionary; {const} src: PAVDictionary; flags: cint): cint; - cdecl; external av__util; - -(** - * Get dictionary entries as a string. - * - * Create a string containing dictionary's entries. - * Such string may be passed back to av_dict_parse_string(). - * @note String is escaped with backslashes ('\'). - * - * @param[in] m dictionary - * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. - * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other - * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. - *) -function av_dict_get_string({const} m: PAVDictionary; buffer: PPAnsiChar; - {const} key_val_sep: AnsiChar; {const} pairs_sep: AnsiChar): cint; - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.1/libavutil/error.pas b/src/lib/ffmpeg-3.1/libavutil/error.pas deleted file mode 100644 index f972aa7d..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/error.pas +++ /dev/null @@ -1,169 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; - EAGAIN = ESysEAGAIN; -{$ELSE} - ENOENT = 2; - EIO = 5; - EAGAIN = 11; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) -function AVERROR(e: integer): integer; - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) - AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) -(* HTTP & RTSP errors *) - AVERROR_HTTP_BAD_REQUEST = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('0') shl 24)); - AVERROR_HTTP_UNAUTHORIZED = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('1') shl 24)); - AVERROR_HTTP_FORBIDDEN = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('3') shl 24)); - AVERROR_HTTP_NOT_FOUND = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('4') shl 24)); - AVERROR_HTTP_OTHER_4XX = -(ord($F8) or (ord('4') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - AVERROR_HTTP_SERVER_ERROR = -(ord($F8) or (ord('5') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-3.1/libavutil/frame.pas b/src/lib/ffmpeg-3.1/libavutil/frame.pas deleted file mode 100644 index 2f168e11..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/frame.pas +++ /dev/null @@ -1,820 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 54.7.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - (** from the definitions of TAVFrame *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - AV_FRAME_FLAG_CORRUPT = (1 << 0); - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type -(* is already in pixfmt.pas - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); -*) - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO, - (** - * ReplayGain information in the form of the AVReplayGain struct. - *) - AV_FRAME_DATA_REPLAYGAIN, - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the frame for correct - * presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_FRAME_DATA_DISPLAYMATRIX, - (** - * Active Format Description data consisting of a single byte as specified - * in ETSI TS 101 154 using AVActiveFormatDescription enum. - *) - AV_FRAME_DATA_AFD, - (** - * Motion vectors exported by some codecs (on demand through the export_mvs - * flag set in the libavcodec AVCodecContext flags2 option). - * The data is the AVMotionVector struct defined in - * libavutil/motion_vector.h. - *) - AV_FRAME_DATA_MOTION_VECTORS, - (** - * Recommmends skipping the specified number of samples. This is exported - * only if the "skip_manual" AVOption is set in libavcodec. - * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_FRAME_DATA_SKIP_SAMPLES, - (** - * This side data must be associated with an audio frame and corresponds to - * enum AVAudioServiceType defined in avcodec.h. - *) - AV_FRAME_DATA_AUDIO_SERVICE_TYPE, - (** - * Mastering display metadata associated with a video frame. The payload is - * an AVMasteringDisplayMetadata type and contains information about the - * mastering display color volume. - *) - AV_FRAME_DATA_MASTERING_DISPLAY_METADATA, - (** - * The GOP timecode in 25 bit timecode format. Data format is 64-bit integer. - * This is set on the first frame of a GOP that has a temporal reference of 0. - *) - AV_FRAME_DATA_GOP_TIMECODE - ); - - TAVActiveFormatDescription = ( - AV_AFD_SAME = 8, - AV_AFD_4_3 = 9, - AV_AFD_16_9 = 10, - AV_AFD_14_9 = 11, - AV_AFD_4_3_SP_14_9 = 13, - AV_AFD_16_9_SP_14_9 = 14, - AV_AFD_SP_4_3 = 15 - ); {TAVActiveFormatDescription} - - PAVFrameSideData = ^TAVFrameSideData; -(** - * Structure to hold side data for an AVFrame. - * - * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - *) - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - buf: PAVBufferRef; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - * - * Fields can be accessed through AVOptions, the name string used, matches the - * C structure field name for fields accessable through AVOptions. The AVClass - * for AVFrame can be obtained from avcodec_get_frame_class() - *) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - * - * NOTE: Except for hwaccel formats, pointers not needed by the format - * MUST be set to NULL. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used in order to access all channels. - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - *) - key_frame: cint; - - (** - * Picture type of the frame - *) - pict_type: TAVPictureType; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - *) - pkt_pts: cint64; - - (** - * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) - * This is also the Presentation time of this AVFrame calculated from - * only AVPacket.dts values without pts values. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - *) - coded_picture_number: cint; - - (** - * picture number in display order - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - *) - quality: cint; - - (** - * for some private data of the user - *) - opaque: pointer; - -{$IFDEF FF_API_ERROR_FRAME} - (** - * @deprecated unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - *) - palette_has_changed: cint; - - (** - * reordered opaque 64 bits (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - *) - reordered_opaque: cint64; - - (** - * Sample rate of the audio data. - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. This array - * must be filled contiguously -- if buf[i] is non-NULL then buf[j] must - * also be non-NULL for all j < i. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * Flags describing additional frame properties. - * - * @ - *) - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - color_primaries: TAVColorPrimaries; - - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - chroma_location: TAVChromaLocation; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavutil should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavutil should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavutil should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavutil should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavutil should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavutil should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - -{$IFDEF FF_API_FRAME_QP} - (** - * QP table - * Not to be accessed directly from outside libavutil - *) - qscale_table: PByte; {deprecated} - (** - * QP store stride - * Not to be accessed directly from outside libavutil - *) - qstride: cint; {deprecated} - - qscale_type: cint; {deprecated} - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; {deprecated} -{$ENDIF} - (** - * For hwaccel-format frames, this should be a reference to the - * AVHWFramesContext describing the frame. - *) - hw_frames_ctx: PAVBufferRef; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavutil. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -{$IFDEF FF_API_FRAME_QP} -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -{$ENDIF} -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__util; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__util; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @warning: dst MUST have been either unreferenced with av_frame_unref(dst), - * or newly allocated with av_frame_alloc() before calling this - * function, or undefined behavior will occur. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__util; - -(** - * Move everything contained in src to dst and reset src. - * - * @warning: dst is not unreferenced, but directly overwritten without reading - * or deallocating its contents. Call av_frame_unref(dst) manually - * before calling this function to ensure that no memory is leaked. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @warning: if frame already has been allocated, calling this function will - * leak memory. In addition, undefined behavior can occur in certain - * cases. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - -(** - * If side data of the supplied type exists in the frame, free it and remove it - * from the frame. - *) -procedure av_frame_remove_side_data(frame: PAVFrame; type_: TAVFrameSideDataType); - cdecl; external av__codec; - -(** - * @return a string identifying the side data type - *) -function av_frame_side_data_name(type_: TAVFrameSideDataType): PAnsiChar; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-3.1/libavutil/log.pas b/src/lib/ffmpeg-3.1/libavutil/log.pas deleted file mode 100644 index c184047f..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/log.pas +++ /dev/null @@ -1,545 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * log - *) - -type - (* from opt.h *) - TAVOptionType = ( - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_DICT, - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_BOOL = $424F4F4C, ///< MKBETAG('B','O','O','L'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_PIXEL_FMlT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is intended for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, - AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, - AV_CLASS_CATEGORY_DEVICE_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_INPUT, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(* -#define AV_IS_INPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) - -#define AV_IS_OUTPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -*) - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - (** - * Value range. - * For string ranges this represents the min/max length. - * For dimensions this represents the min/max pixel count or width/height in multi-component case. - *) - value_min, value_max: cdouble; - (** - * Value's component range. - * For string this represents the unicode range for chars, 0-127 limits to ASCII. - *) - component_min, component_max: cdouble; - (** - * Range flag. - * If set to 1 the struct encodes a range, if set to 0 a single value. - *) - is_range: cint; - end; - - (** - * List of AVOptionRange structs. - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - (** - * Array of option ranges. - * - * Most of option types use just one component. - * Following describes multi-component option types: - * - * AV_OPT_TYPE_IMAGE_SIZE: - * component index 0: range of pixel count (width * height). - * component index 1: range of width. - * component index 2: range of height. - * - * @note To obtain multi-component version of this structure, user must - * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or - * av_opt_query_ranges_default function. - * - * Multi-component range can be read as in following example: - * - * @code - * int range_index, component_index; - * AVOptionRanges *ranges; - * AVOptionRange *range[3]; //may require more than 3 in the future. - * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); - * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { - * for (component_index = 0; component_index < ranges->nb_components; component_index++) - * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; - * //do something with range here. - * } - * av_opt_freep_ranges(&ranges); - * @endcode - *) - range: PPAVOptionRange; - (** - * Number of ranges per component. - *) - nb_ranges: cint; - (** - * Number of componentes. - *) - nb_components: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - -(** - * Extremely verbose debugging, useful for libav* development. - *) - AV_LOG_TRACE = 56; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Sets additional colors for extended debugging sessions. - * @code - av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); - @endcode - * Requires 256color terminal support. Uses outside debugging is not - * recommended. - *) -{** to be translated if needed - AV_LOG_C(x) (x << 8) -**} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct or NULL if general log. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formatted line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formatted line; - * may be NULL if line_size is 0 - * @param line_size size of the buffer; at most line_size-1 characters will - * be written to the buffer, plus one null terminator - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - * @return Returns a negative value if an error occurred, otherwise returns - * the number of characters that would have been written for a - * sufficiently large buffer, not including the terminating null - * character. If the return value is not less than line_size, it means - * that the log message was truncated to fit the buffer. - *) -function av_log_format_line2(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint): cint; - cdecl; external av__util; - -{$IFDEF FF_API_DLOG} -(** - * av_dlog macros - * @deprecated unused - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) -{$ENDIF} //FF_API_DLOG - -const -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) - AV_LOG_SKIP_REPEATED = 1; - -(** - * Include the log severity in messages originating from codecs. - * - * Results in messages such as: - * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts - *) - AV_LOG_PRINT_LEVEL = 2; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; - -function av_log_get_flags: cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.1/libavutil/mathematics.pas b/src/lib/ffmpeg-3.1/libavutil/mathematics.pas deleted file mode 100644 index 3815ea1f..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/mathematics.pas +++ /dev/null @@ -1,145 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 54.7.100 - * - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - AV_ROUND_PASS_MINMAX = 8192 ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE - ); - -(** - * Compute the greatest common divisor of a and b. - * - * @return gcd of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; - * if a == 0 and b == 0, returns 0. - *) -function av_gcd(a, b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_rnd (a, b, c: cint64; d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is - * INT64_MIN or INT64_MAX then a is passed through unchanged. - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - d: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a, b, modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * @param in_ts Input timestamp - * @param in_tb Input timebase - * @param fs_tb Duration and *last timebase - * @param duration duration till the next call - * @param out_tb Output timebase - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function guarantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.1/libavutil/mem.pas b/src/lib/ffmpeg-3.1/libavutil/mem.pas deleted file mode 100644 index 2d049ae8..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/mem.pas +++ /dev/null @@ -1,369 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of size * nmemb bytes with av_malloc(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param size Size in bytes of the memory block to be allocated or - * reallocated. - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate or reallocate a block of memory. - * This function does the same thing as av_realloc, except: - * - It takes two arguments and checks the result of the multiplication for - * integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic "buf = realloc(buf); if (!buf) return -1;". - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate or reallocate a block of memory. - * If *ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param size Size in bytes for the memory block to be allocated or - * reallocated - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_reallocp(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate or reallocate an array. - * If ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or NULL. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate or reallocate an array through a pointer to a pointer. - * If *ptr is NULL and nmemb > 0, allocate a new block. If - * nmemb is zero, free the memory block pointed to by ptr. - * @param ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or pointer to a pointer to NULL. - * The pointer is updated on success, or freed on failure. - * @param nmemb Number of elements - * @param size Size of the single element - * @return Zero on success, an AVERROR error code on failure. - * @warning Pointers originating from the av_malloc() family of functions must - * not be passed to av_realloc(). The former can be implemented using - * memalign() (or other functions), and there is no guarantee that - * pointers from such functions can be passed to realloc() at all. - * The situation is undefined according to POSIX and may crash with - * some libc implementations. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate a block of size * nmemb bytes with av_mallocz(). - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a substring of the string s. - * @param s string to be duplicated - * @param len the maximum length of the resulting string (not counting the - * terminating byte). - * @return Pointer to a newly-allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strndup({const} s: PAnsiChar; len: size_t): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate the buffer p. - * @param p buffer to be duplicated - * @return Pointer to a newly allocated buffer containing a - * copy of p or NULL if the buffer cannot be allocated. - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @note passing a pointer to a NULL pointer is safe and leads to no action. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @see av_dynarray_add_nofree(), av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * Function has the same functionality as av_dynarray_add(), - * but it doesn't free memory on fails. It returns error code - * instead and leave current buffer untouched. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem element to add - * @return >=0 on success, negative otherwise. - * @see av_dynarray_add(), av_dynarray2_add() - *) -function av_dynarray_add_nofree(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer): cint; - cdecl; external av__util; - -(** - * Add an element of size elem_size to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by nb_ptr - * is incremented. - * In case of failure, the array is freed, *tab_ptr is set to NULL and - * *nb_ptr is set to 0. - * - * @param tab_ptr pointer to the array to grow - * @param nb_ptr pointer to the number of elements in the array - * @param elem_size size in bytes of the elements in the array - * @param elem_data pointer to the data of the element to add. If NULL, the space of - * the new added element is not filled. - * @return pointer to the data of the element to copy in the new allocated space. - * If NULL, the new allocated space is left uninitialized." - * @see av_dynarray_add(), av_dynarray_add_nofree() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * Multiply two size_t values checking for overflow. - * @return 0 if success, AVERROR(EINVAL) if overflow. - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: only try the division if nelem and elsize - * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may me allocated in one block. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; - -(** - * deliberately overlapping memcpy implementation - * @param dst destination buffer - * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 - * @param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * All newly allocated space is initially cleared - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.1/libavutil/opt.pas b/src/lib/ffmpeg-3.1/libavutil/opt.pas deleted file mode 100644 index 87ec68aa..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/opt.pas +++ /dev/null @@ -1,507 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 54.7.100 - * - *) - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. Only these - * AVOption fields for which (opt->flags & mask) == flags will have their - * default applied to s. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - * @param mask combination of AV_OPT_FLAG_* - * @param flags combination of AV_OPT_FLAG_* - *) -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all allocated objects in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict2(obj: pointer; var options: PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = (1 << 0); (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = (1 << 1); - -(** - * In av_opt_get, return NULL if the option has a pointer type and is set to NULL, - * rather than returning an empty string. - *) - AV_OPT_ALLOW_NULL = (1 << 2); -(** - * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than - * one component for certain option types. - * @see AVOptionRanges for details. - *) - AV_OPT_MULTI_COMPONENT_RANGE = (1 << 12); - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: {const} pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * @note Any old dictionary present is discarded and replaced with a copy of the new one. The - * caller still owns val is and responsible for freeing it. - *) -function av_opt_set_dict_val(obj: pointer; name: {const} PAnsiChar; val: {const} PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - * - * @note if AV_OPT_ALLOW_NULL is set in search_flags in av_opt_get, and the option has - * AV_OPT_TYPE_STRING or AV_OPT_TYPE_BINARY and is set to NULL, *out_val will be set - * to NULL instead of an allocated empty string. - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @param[out] out_val The returned dictionary is a copy of the actual value and must - * be freed with av_dict_free() by the caller - *) -function av_opt_get_dict_val (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: PAVDictionary): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -function av_opt_copy(dest: pointer;src: {const }pointer): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-3.1/libavutil/pixfmt.pas b/src/lib/ffmpeg-3.1/libavutil/pixfmt.pas deleted file mode 100644 index 16fc8760..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/pixfmt.pas +++ /dev/null @@ -1,547 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB32 palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8 bits per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bits with AV_PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - {$define AV_PIX_FMT_XVMC := (AV_PIX_FMT_XVMC_MPEG2_IDCT)} -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, most significant bit to 1 -{$IFDEF FF_API_VAAPI} - (** Deprecated pixel formats *) - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a VASurfaceID - - AV_PIX_FMT_VAAPI = AV_PIX_FMT_VAAPI_VLD, -{$ELSE} - AV_PIX_FMT_VAAPI, -{$ENDIF} - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG-4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_YA8, ///< 8 bits gray, 8 bits alpha -(* see const declaration way down - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -*) - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - - AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb - - AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef - - AV_PIX_FMT_YA16BE, ///< 16 bits gray, 16 bits alpha (big-endian) - AV_PIX_FMT_YA16LE, ///< 16 bits gray, 16 bits alpha (little-endian) - - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - (** - * HW acceleration through QSV, data[3] contains a pointer to the - * mfxFrameSurface1 structure. - *) - AV_PIX_FMT_QSV, - (** - * HW acceleration though MMAL, data[3] contains a pointer to the - * MMAL_BUFFER_HEADER_T structure. - *) - AV_PIX_FMT_MMAL, - - AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer - - (** - * HW acceleration through CUDA. data[i] contain CUdeviceptr pointers - * exactly as for system memory frames. - *) - AV_PIX_FMT_CUDA, - - AV_PIX_FMT_0RGB = $123 + 4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_AYUV64LE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_AYUV64BE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - - AV_PIX_FMT_VIDEOTOOLBOX, ///< hardware decoding through Videotoolbox - - AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian - AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian - - AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian - - AV_PIX_FMT_GBRAP10BE, ///< planar GBR 4:4:4:4 40bpp, big-endian - AV_PIX_FMT_GBRAP10LE, ///< planar GBR 4:4:4:4 40bpp, little-endian - - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP; - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP10 = AV_PIX_FMT_GBRAP10BE; - AV_PIX_FMT_GBRAP12 = AV_PIX_FMT_GBRAP12BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP10 = AV_PIX_FMT_GBRAP10LE; - AV_PIX_FMT_GBRAP12 = AV_PIX_FMT_GBRAP12LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64LE; -{$ENDIF} - -type -(** - * Chromaticity coordinates of the source primaries. - *) - TAVColorPrimaries = ( - AVCOL_PRI_RESERVED0 = 0, - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_RESERVED = 3, - AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_SMPTEST428_1= 10,///< SMPTE ST 428-1 (CIE 1931 XYZ) - AVCOL_PRI_NB ///< Not part of ABI - ); - -(** - * Color Transfer Characteristic. - *) - TAVColorTransferCharacteristic = ( - AVCOL_TRC_RESERVED0 = 0, - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_RESERVED = 3, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10-bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12-bit system - AVCOL_TRC_SMPTEST2084 = 16, ///< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems - AVCOL_TRC_SMPTEST428_1 = 17, ///< SMPTE ST 428-1 - AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma" - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * YUV colorspace type. - *) - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_RESERVED = 3, - AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_SPC_SMPTE240M = 7, ///< functionally identical to above - AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - -const - AVCOL_SPC_YCGCO = AVCOL_SPC_YCOCG; - -type -(** - * MPEG vs JPEG YUV range. - *) - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * Location of chroma samples. - * - * Illustration showing the location of the first (top left) chroma sample of the - * image, the left shows only luma, the right - * shows the location of the chroma sample, the 2 could be imagined to overlay - * each other but are drawn separately due to limitations of ASCII - * - * 1st 2nd 1st 2nd horizontal luma sample positions - * v v v v - * ______ ______ - *1st luma line > |X X ... |3 4 X ... X are luma samples, - * | |1 2 1-6 are possible chroma positions - *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< MPEG-2/4 4:2:0, H.264 default for 4:2:0 - AVCHROMA_LOC_CENTER = 2, ///< MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0 - AVCHROMA_LOC_TOPLEFT = 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); diff --git a/src/lib/ffmpeg-3.1/libavutil/samplefmt.pas b/src/lib/ffmpeg-3.1/libavutil/samplefmt.pas deleted file mode 100644 index f3f8ead2..00000000 --- a/src/lib/ffmpeg-3.1/libavutil/samplefmt.pas +++ /dev/null @@ -1,285 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 54.7.100 - * - *) - -type -(** - * @addtogroup lavu_audio - * @ - * - * @defgroup lavu_sampfmts Audio sample formats - * - * Audio sample format enumeration and related convenience functions. - * @ - *) - -(** - * Audio sample formats - * - * - The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * - The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * @par - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - * - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * @ - * - * @defgroup lavu_sampmanip Samples manipulation - * - * Functions that manipulate audio samples - * @ - *) - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.1/rational.pas b/src/lib/ffmpeg-3.1/rational.pas deleted file mode 100644 index 0c795c54..00000000 --- a/src/lib/ffmpeg-3.1/rational.pas +++ /dev/null @@ -1,241 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 54.7.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create a rational. - * Useful for compilers that do not support compound literals. - * @note The return value is not reduced. - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-3.1/swresample.pas b/src/lib/ffmpeg-3.1/swresample.pas deleted file mode 100644 index fb9dc6d2..00000000 --- a/src/lib/ffmpeg-3.1/swresample.pas +++ /dev/null @@ -1,434 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 0.18.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 2; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 1; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 2; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 1; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type -(** Dithering algorithms *) - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - -(** Resampling Engines *) - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - -(** Resampling Filter Types *) - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall windowed sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser windowed sinc *) - ); - -(** - * The libswresample context. Unlike libavcodec and libavformat, this structure - * is opaque. This means that if you would like to set options, you must use - * the @ref avoptions API and cannot directly set values to members of the - * structure. - *) - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * - * @param[in,out] s Swr context to initialize - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @param[in] s Swr context to check - * @see swr_init() - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - * - * @param[in] s a pointer to a pointer to Swr context - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Closes the context so that swr_is_initialized() returns 0. - * - * The context can be brought back to life by running swr_init(), - * swr_init() can also be used without swr_close(). - * This function is mainly provided for simplifying the usecase - * where one tries to support libavresample and libswresample. - * - * @param[in,out] s Swr context to be closed - *) -procedure swr_close(s: PSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space, then the input will be buffered. - * You can avoid this buffering by using swr_get_out_samples() to retrieve an - * upper bound on the required number of output samples for the given number of - * input samples. Conversion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - var in_: {const} PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation ("soft" compensation). This function is - * internally called when needed in swr_next_pts(). - * - * @param[in,out] s allocated Swr context. If it is not initialized, - * or SWR_FLAG_RESAMPLE is not set, swr_init() is - * called with the flag set. - * @param[in] sample_delta delta in PTS per sample - * @param[in] compensation_distance number of samples to compensate for - * @return >= 0 on success, AVERROR error codes if: - * @li @c s is NULL, - * @li @c compensation_distance is less than 0, - * @li @c compensation_distance is 0 but sample_delta is not, - * @li compensation unsupported by resampler, or - * @li swr_init() fails when called. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param[in,out] s allocated Swr context, not yet initialized - * @param[in] channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - * - * This function, along with swr_inject_silence(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - * - * This function, along with swr_drop_output(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be: - * @li if it's set to 1 the returned delay is in seconds - * @li if it's set to 1000 the returned delay is in milliseconds - * @li if it's set to the input sample rate then the returned - * delay is in input samples - * @li if it's set to the output sample rate then the returned - * delay is in output samples - * @li if it's the least common multiple of in_sample_rate and - * out_sample_rate then an exact rounding-free delay will be - * returned - * @returns the delay in 1 / @c base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Find an upper bound on the number of samples that the next swr_convert - * call will output, if called with in_samples of input samples. This - * depends on the internal state, and anything changing the internal state - * (like further swr_convert() calls) will may change the number of samples - * swr_get_out_samples() returns for the same number of input samples. - * - * @param in_samples number of input samples. - * @note any call to swr_inject_silence(), swr_convert(), swr_next_pts() - * or swr_set_compensation() invalidates this limit - * @note it is recommended to pass the correct available buffer size - * to all functions like swr_convert() even if swr_get_out_samples() - * indicates that less would be used. - * @returns an upper bound on the number of samples that the next swr_convert - * will output or a negative value to indicate an error - *) -function swr_get_out_samples(s: PSwrContext; in_samples: cint): cint; - cdecl; external sw__resample; - -(** - * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. - * - * This is useful to check if the build-time libswresample has the same version - * as the run-time one. - * - * @returns the unsigned int-typed version - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - * - * @returns the build-time @c ./configure flags - *) -function swresample_configuration(): PAnsiChar; - cdecl; external sw__resample; - -(** - * Return the swr license. - * - * @returns the license of libswresample, determined at build-time - *) -function swresample_license(): PAnsiChar; - cdecl; external sw__resample; - -implementation - -end. - diff --git a/src/lib/ffmpeg-3.1/swscale.pas b/src/lib/ffmpeg-3.1/swscale.pas deleted file mode 100644 index 88b6e630..00000000 --- a/src/lib/ffmpeg-3.1/swscale.pas +++ /dev/null @@ -1,439 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 3.0.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 4; - LIBSWSCALE_MAX_VERSION_MINOR = 1; - LIBSWSCALE_MAX_VERSION_RELEASE = 100; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominance subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - SWS_CS_BT2020 = 9; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @param param extra parameters to tune the used scaler - * For SWS_BICUBIC param[0] and [1] tune the shape of the basis - * function, param[0] tunes f(1) and param[1] f??(1) - * For SWS_GAUSS param[0] tunes the exponent and thus cutoff - * frequency - * For SWS_LANCZOS param[0] tunes the width of the window function - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: {const} PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -{$IFDEF FF_API_SWS_VECTOR} -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; deprecated; -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; deprecated; -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; deprecated; -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; deprecated; -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; deprecated; -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; deprecated; -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; deprecated; -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; deprecated; -{$ENDIF} - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-3.2/How to update the ffmpeg files.txt b/src/lib/ffmpeg-3.2/How to update the ffmpeg files.txt deleted file mode 100644 index ae65d477..00000000 --- a/src/lib/ffmpeg-3.2/How to update the ffmpeg files.txt +++ /dev/null @@ -1,20 +0,0 @@ -how to update the ffmpeg files: - -1) buffer.pas - cpu.pas - dict.pas - error.pas - frame.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas - swresample.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-3.2/ToDo.txt b/src/lib/ffmpeg-3.2/ToDo.txt deleted file mode 100644 index b0bd305e..00000000 --- a/src/lib/ffmpeg-3.2/ToDo.txt +++ /dev/null @@ -1,112 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog - - -FFmpeg 3.0 changes: -2016-02-10 - bc9a596 / 9f61abc - lavf 57.25.100 / 57.3.0 - avformat.h - Add AVFormatContext.opaque, io_open and io_close, allowing custom IO - -2016-02-01 - 1dba837 - lavf 57.24.100 - avformat.h, avio.h - Add protocol_whitelist to AVFormatContext, AVIOContext - -2016-01-31 - 66e9d2f - lavu 55.17.100 - frame.h - Add AV_FRAME_DATA_GOP_TIMECODE for exporting MPEG1/2 GOP timecodes. - -2016-01-01 - 5e8b053 / 2c68113 - lavc 57.21.100 / 57.12.0 - avcodec.h - Add AVCodecDescriptor.profiles and avcodec_profile_name(). - -2015-12-28 - 1f9139b - lavf 57.21.100 - avformat.h - Add automatic bitstream filtering; add av_apply_bitstream_filters() - -2015-12-22 - 39a09e9 - lavfi 6.21.101 - avfilter.h - Deprecate avfilter_link_set_closed(). - Applications are not supposed to mess with links, - they should close the sinks. - -2015-12-17 - lavc 57.18.100 / 57.11.0 - avcodec.h dirac.h - xxxxxxx - Add av_packet_add_side_data(). - xxxxxxx - Add AVCodecContext.coded_side_data. - xxxxxxx - Add AVCPBProperties API. - xxxxxxx - Add a new public header dirac.h containing - av_dirac_parse_sequence_header() - -2015-12-11 - 676a93f - lavf 57.20.100 - avformat.h - Add av_program_add_stream_index() - -2015-11-29 - 93fb4a4 - lavc 57.16.101 - avcodec.h - Deprecate rtp_callback without replacement, i.e. it won't be possible to - get image slices before the full frame is encoded any more. The libavformat - rtpenc muxer can still be used for RFC-2190 packetization. - -2015-11-22 - fe20e34 - lavc 57.16.100 - avcodec.h - Add AV_PKT_DATA_FALLBACK_TRACK for making fallback associations between - streams. - -2015-11-22 - ad317c9 - lavf 57.19.100 - avformat.h - Add av_stream_new_side_data(). - -2015-11-22 - e12f403 - lavu 55.8.100 - xtea.h - Add av_xtea_le_init and av_xtea_le_crypt - -2015-11-18 - lavu 55.7.100 - mem.h - Add av_fast_mallocz() - -2015-10-29 - lavc 57.12.100 / 57.8.0 - avcodec.h - xxxxxx - Deprecate av_free_packet(). Use av_packet_unref() as replacement, - it resets the packet in a more consistent way. - xxxxxx - Deprecate av_dup_packet(), it is a no-op for most cases. - Use av_packet_ref() to make a non-refcounted AVPacket refcounted. - xxxxxx - Add av_packet_alloc(), av_packet_clone(), av_packet_free(). - They match the AVFrame functions with the same name. - -2015-10-27 - 1e477a9 - lavu 55.5.100 - cpu.h - Add AV_CPU_FLAG_AESNI. - -2015-10-22 - ee573b4 / a17a766 - lavc 57.9.100 / 57.5.0 - avcodec.h - Add data and linesize array to AVSubtitleRect, to be used instead of - the ones from the embedded AVPicture. - -2015-10-22 - 866a417 / dc923bc - lavc 57.8.100 / 57.0.0 - qsv.h - Add an API for allocating opaque surfaces. - -2015-10-15 - 2c2d162 - lavf 57.4.100 - Remove the latm demuxer that was a duplicate of the loas demuxer. - -2015-10-14 - b994788 / 11c5f43 - lavu 55.4.100 / 55.2.0 - dict.h - Change return type of av_dict_copy() from void to int, so that a proper - error code can be reported. - -2015-09-29 - b01891a / 948f3c1 - lavc 57.3.100 / 57.2.0 - avcodec.h - Change type of AVPacket.duration from int to int64_t. - -2015-09-17 - 7c46f24 / e3d4784 - lavc 57.3.100 / 57.2.0 - d3d11va.h - Add av_d3d11va_alloc_context(). This function must from now on be used for - allocating AVD3D11VAContext. - -2015-09-15 - lavf 57.2.100 - avformat.h - probesize and max_analyze_duration switched to 64bit, both - are only accessible through AVOptions - -2015-09-15 - lavf 57.1.100 - avformat.h - bit_rate was changed to 64bit, make sure you update any - printf() or other type sensitive code - -2015-09-15 - lavc 57.2.100 - avcodec.h - bit_rate/rc_max_rate/rc_min_rate were changed to 64bit, make sure you update - any printf() or other type sensitive code - -2015-09-07 - lavu 55.0.100 / 55.0.0 - c734b34 / b8b5d82 - Change type of AVPixFmtDescriptor.flags from uint8_t to uint64_t. - f53569a / 6b3ef7f - Change type of AVComponentDescriptor fields from uint16_t to int - and drop bit packing. - 151aa2e / 2268db2 - Add step, offset, and depth to AVComponentDescriptor to replace - the deprecated step_minus1, offset_plus1, and depth_minus1. \ No newline at end of file diff --git a/src/lib/ffmpeg-3.2/avcodec.pas b/src/lib/ffmpeg-3.2/avcodec.pas deleted file mode 100644 index 05c7c07d..00000000 --- a/src/lib/ffmpeg-3.2/avcodec.pas +++ /dev/null @@ -1,6950 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 56.1.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 57; - LIBAVCODEC_MAX_VERSION_MINOR = 92; (* even up to FFmpeg commit 1fd762777 *) - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 57; - LIBAVCODEC_MIN_VERSION_MINOR = 64; - LIBAVCODEC_MIN_VERSION_RELEASE = 100; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @ingroup libavc - * @defgroup lavc_encdec send/receive encoding and decoding API overview - * @{ - * - * The avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/ - * avcodec_receive_packet() functions provide an encode/decode API, which - * decouples input and output. - * - * The API is very similar for encoding/decoding and audio/video, and works as - * follows: - * - Set up and open the AVCodecContext as usual. - * - Send valid input: - * - For decoding, call avcodec_send_packet() to give the decoder raw - * compressed data in an AVPacket. - * - For encoding, call avcodec_send_frame() to give the decoder an AVFrame - * containing uncompressed audio or video. - * In both cases, it is recommended that AVPackets and AVFrames are - * refcounted, or libavcodec might have to copy the input data. (libavformat - * always returns refcounted AVPackets, and av_frame_get_buffer() allocates - * refcounted AVFrames.) - * - Receive output in a loop. Periodically call one of the avcodec_receive_*() - * functions and process their output: - * - For decoding, call avcodec_receive_frame(). On success, it will return - * an AVFrame containing uncompressed audio or video data. - * - For encoding, call avcodec_receive_packet(). On success, it will return - * an AVPacket with a compressed frame. - * Repeat this call until it returns AVERROR(EAGAIN) or an error. The - * AVERROR(EAGAIN) return value means that new input data is required to - * return new output. In this case, continue with sending input. For each - * input frame/packet, the codec will typically return 1 output frame/packet, - * but it can also be 0 or more than 1. - * - * At the beginning of decoding or encoding, the codec might accept multiple - * input frames/packets without returning a frame, until its internal buffers - * are filled. This situation is handled transparently if you follow the steps - * outlined above. - * - * End of stream situations. These require "flushing" (aka draining) the codec, - * as the codec might buffer multiple frames or packets internally for - * performance or out of necessity (consider B-frames). - * This is handled as follows: - * - Instead of valid input, send NULL to the avcodec_send_packet() (decoding) - * or avcodec_send_frame() (encoding) functions. This will enter draining - * mode. - * - Call avcodec_receive_frame() (decoding) or avcodec_receive_packet() - * (encoding) in a loop until AVERROR_EOF is returned. The functions will - * not return AVERROR(EAGAIN), unless you forgot to enter draining mode. - * - Before decoding can be resumed again, the codec has to be reset with - * avcodec_flush_buffers(). - * - * Using the API as outlined above is highly recommended. But it is also - * possible to call functions outside of this rigid schema. For example, you can - * call avcodec_send_packet() repeatedly without calling - * avcodec_receive_frame(). In this case, avcodec_send_packet() will succeed - * until the codec's internal buffer has been filled up (which is typically of - * size 1 per output frame, after initial input), and then reject input with - * AVERROR(EAGAIN). Once it starts rejecting input, you have no choice but to - * read at least some output. - * - * Not all codecs will follow a rigid and predictable dataflow; the only - * guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on - * one end implies that a receive/send call on the other end will succeed. In - * general, no codec will permit unlimited buffering of input or output. - * - * This API replaces the following legacy functions: - * - avcodec_decode_video2() and avcodec_decode_audio4(): - * Use avcodec_send_packet() to feed input to the decoder, then use - * avcodec_receive_frame() to receive decoded frames after each packet. - * Unlike with the old video decoding API, multiple frames might result from - * a packet. For audio, splitting the input packet into frames by partially - * decoding packets becomes transparent to the API user. You never need to - * feed an AVPacket to the API twice. - * Additionally, sending a flush/draining packet is required only once. - * - avcodec_encode_video2()/avcodec_encode_audio2(): - * Use avcodec_send_frame() to feed input to the encoder, then use - * avcodec_receive_packet() to receive encoded packets. - * Providing user-allocated buffers for avcodec_receive_packet() is not - * possible. - * - The new API does not handle subtitles yet. - * - * Mixing new and old function calls on the same AVCodecContext is not allowed, - * and will result in undefined behavior. - * - * Some codecs might require using the new API; using the old API will return - * an error when calling it. - * @} - *) - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of an existing codec ID changes (that would break ABI), - * 2. it is as close as possible to similar codecs - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - PAVCodecID = ^TAVCodecID; - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1 = AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130, - AV_CODEC_ID_G2M, - AV_CODEC_ID_WEBP, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX, - AV_CODEC_ID_PAF_VIDEO, - AV_CODEC_ID_EXR, - AV_CODEC_ID_VP7, - AV_CODEC_ID_SANM, - AV_CODEC_ID_SGIRLE, - AV_CODEC_ID_MVC1, - AV_CODEC_ID_MVC2, - AV_CODEC_ID_HQX, - AV_CODEC_ID_TDSC, - AV_CODEC_ID_HQ_HQA, - AV_CODEC_ID_HAP, - AV_CODEC_ID_DDS, - AV_CODEC_ID_DXV, - AV_CODEC_ID_SCREENPRESSO, - AV_CODEC_ID_RSCC, - - AV_CODEC_ID_Y41P = $8000, - AV_CODEC_ID_AVRP, - AV_CODEC_ID_012V, - AV_CODEC_ID_AVUI, - AV_CODEC_ID_AYUV, - AV_CODEC_ID_TARGA_Y216, - AV_CODEC_ID_V308, - AV_CODEC_ID_V408, - AV_CODEC_ID_YUV4, - AV_CODEC_ID_AVRN, - AV_CODEC_ID_CPIA, - AV_CODEC_ID_XFACE, - AV_CODEC_ID_SNOW, - AV_CODEC_ID_SMVJPEG, - AV_CODEC_ID_APNG, - AV_CODEC_ID_DAALA, - AV_CODEC_ID_CFHD, - AV_CODEC_ID_TRUEMOTION2RT, - AV_CODEC_ID_M101, - AV_CODEC_ID_MAGICYUV, - AV_CODEC_ID_SHEERVIDEO, - AV_CODEC_ID_YLC, - - //* various PCM "codecs" */ - AV_CODEC_ID_FIRST_AUDIO = $10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, - AV_CODEC_ID_PCM_S24LE_PLANAR, - AV_CODEC_ID_PCM_S32LE_PLANAR, - AV_CODEC_ID_PCM_S16BE_PLANAR, - - AV_CODEC_ID_PCM_S64LE = $10800, - AV_CODEC_ID_PCM_S64BE, - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA, -{$IFDEF FF_API_VIMA_DECODER} - AV_CODEC_ID_VIMA = AV_CODEC_ID_ADPCM_VIMA, -{$IFEND} - AV_CODEC_ID_ADPCM_AFC = $11800, - AV_CODEC_ID_ADPCM_IMA_OKI, - AV_CODEC_ID_ADPCM_DTK, - AV_CODEC_ID_ADPCM_IMA_RAD, - AV_CODEC_ID_ADPCM_G726LE, - AV_CODEC_ID_ADPCM_THP_LE, - AV_CODEC_ID_ADPCM_PSX, - AV_CODEC_ID_ADPCM_AICA, - AV_CODEC_ID_ADPCM_IMA_DAT4, - AV_CODEC_ID_ADPCM_MTAF, - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - AV_CODEC_ID_SDX2_DPCM = $14800, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK, - AV_CODEC_ID_PAF_AUDIO, - AV_CODEC_ID_ON2AVC, - AV_CODEC_ID_DSS_SP, - - AV_CODEC_ID_FFWAVESYNTH = $15800, - AV_CODEC_ID_SONIC, - AV_CODEC_ID_SONIC_LS, - AV_CODEC_ID_EVRC, - AV_CODEC_ID_SMV, - AV_CODEC_ID_DSD_LSBF, - AV_CODEC_ID_DSD_MSBF, - AV_CODEC_ID_DSD_LSBF_PLANAR, - AV_CODEC_ID_DSD_MSBF_PLANAR, - AV_CODEC_ID_4GV, - AV_CODEC_ID_INTERPLAY_ACM, - AV_CODEC_ID_XMA1, - AV_CODEC_ID_XMA2, - AV_CODEC_ID_DST, - - //* subtitle codecs */ - AV_CODEC_ID_FIRST_SUBTITLE = $17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, - AV_CODEC_ID_MICRODVD = $17800, - AV_CODEC_ID_EIA_608, - AV_CODEC_ID_JACOSUB, - AV_CODEC_ID_SAMI, - AV_CODEC_ID_REALTEXT, - AV_CODEC_ID_STL, - AV_CODEC_ID_SUBVIEWER1, - AV_CODEC_ID_SUBVIEWER, - AV_CODEC_ID_SUBRIP, - AV_CODEC_ID_WEBVTT, - AV_CODEC_ID_MPL2, - AV_CODEC_ID_VPLAYER, - AV_CODEC_ID_PJS, - AV_CODEC_ID_ASS, - AV_CODEC_ID_HDMV_TEXT_SUBTITLE, - - //* other specific kind of codecs (generally used for attachments) */ - AV_CODEC_ID_FIRST_UNKNOWN = $18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, - - AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program stream. - AV_CODEC_ID_BINTEXT = $18800, - AV_CODEC_ID_XBIN, - AV_CODEC_ID_IDF, - AV_CODEC_ID_OTF, - AV_CODEC_ID_SMPTE_KLV, - AV_CODEC_ID_DVD_NAV, - AV_CODEC_ID_TIMED_ID3, - AV_CODEC_ID_BIN_DATA, - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - AV_CODEC_ID_WRAPPED_AVFRAME = $21001 ///< Passthrough codec, AVFrames wrapped in AVPacket - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_descriptor_get() - *) -type - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - - (** - * MIME type(s) associated with the codec. - * May be NULL; if not, a NULL-terminated array of MIME types. - * The first item is always non-NULL and is the preferred MIME type. - *) - mime_types: PAnsiChar; - - (** - * If non-NULL, an array of profiles recognized for this codec. - * Terminated with FF_PROFILE_UNKNOWN. - *) - profiles: PAVProfile; - end; - -const -(** - * Codec uses only intra compression. - * Video codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Codec supports frame reordering. That is, the coded order (the order in which - * the encoded packets are output by the encoders / stored / input to the - * decoders) may be different from the presentation order of the corresponding - * frames. - * - * For codecs that do not have this property set, PTS and DTS should always be - * equal. - *) - AV_CODEC_PROP_REORDER = 1 << 3; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - AV_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - AV_INPUT_BUFFER_MIN_SIZE = 16384; - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead - *) - FF_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead - *) - FF_MIN_BUFFER_SIZE = 16384; -{$ENDIF} - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - * @deprecated use codec private option instead - *) -{$IFDEF FF_API_MOTION_EST} - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); -{$ENDIF} - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONINTRA= 24, ///< discard all non intra frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{ removed, kept for the moment - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -} - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - AV_CODEC_FLAG_UNALIGNED = $0001; // (1 << 0) -(** - * Use fixed qscale. - *) - AV_CODEC_FLAG_QSCALE = $0002; // (1 << 1) -(** - * 4 MV per MB allowed / advanced prediction for H.263. - *) - AV_CODEC_FLAG_4MV = $0004; // (1 << 2) -(** - * Output even those frames that might be corrupted. - *) - AV_CODEC_FLAG_OUTPUT_CORRUPT = $0008; // (1 << 3) -(** - * Use qpel MC. - *) - AV_CODEC_FLAG_QPEL = $0010; // (1 << 4) -(** - * Use internal 2pass ratecontrol in first pass mode. - *) - AV_CODEC_FLAG_PASS1 = $0200; // (1 << 9) -(** - * Use internal 2pass ratecontrol in second pass mode. - *) - AV_CODEC_FLAG_PASS2 = $0400; // (1 << 10) -(** - * loop filter. - *) - AV_CODEC_FLAG_LOOP_FILTER = $0800; // (1 << 11) -(** - * Only decode/encode grayscale. - *) - AV_CODEC_FLAG_GRAY = $2000; // (1 << 13) -(** - * error[?] variables will be set during encoding. - *) - AV_CODEC_FLAG_PSNR = $8000; // (1 << 15) -(** - * Input bitstream might be truncated at a random location - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG_TRUNCATED = $10000; // (1 << 16) -(** - * Use interlaced DCT. - *) - AV_CODEC_FLAG_INTERLACED_DCT = $40000; // (1 << 18) -(** - * Force low delay. - *) - AV_CODEC_FLAG_LOW_DELAY = $80000; // (1 << 19) -(** - * Place global headers in extradata instead of every keyframe. - *) - AV_CODEC_FLAG_GLOBAL_HEADER = $400000; // (1 << 22) -(** - * Use only bitexact stuff (except (I)DCT). - *) - AV_CODEC_FLAG_BITEXACT = $800000; // (1 << 23) -(* Fx : Flag for H.263+ extra options *) -(** - * H.263 advanced intra coding / MPEG-4 AC prediction - *) - AV_CODEC_FLAG_AC_PRED = $1000000; // (1 << 24) -(** - * interlaced motion estimation - *) - AV_CODEC_FLAG_INTERLACED_ME = $20000000; // (1 << 29) - AV_CODEC_FLAG_CLOSED_GOP = $80000000; // (1U << 31) - -(** - * Allow non spec compliant speedup tricks. - *) - AV_CODEC_FLAG2_FAST = $0001; // (1 << 0) -(** - * Skip bitstream encoding. - *) - AV_CODEC_FLAG2_NO_OUTPUT = $0004; // (1 << 2) -(** - * Place global headers at every keyframe instead of in extradata. - *) - AV_CODEC_FLAG2_LOCAL_HEADER = $0008; // (1 << 3) - -(** - * timecode is in drop frame format. DEPRECATED!!!! - *) - AV_CODEC_FLAG2_DROP_FRAME_TIMECODE = $2000; // (1 << 13) - -(** - * Input bitstream might be truncated at a packet boundaries - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG2_CHUNKS = $8000; // (1 << 15) -(** - * Discard cropping information from SPS. - *) - AV_CODEC_FLAG2_IGNORE_CROP = $10000; // (1 << 16) - -(** - * Show all frames before the first keyframe - *) - AV_CODEC_FLAG2_SHOW_ALL = $400000; // (1 << 22) -(** - * Export motion vectors through frame side data - *) - AV_CODEC_FLAG2_EXPORT_MVS = $10000000; // (1 << 28) -(** - * Do not skip samples and export skip information as frame side data - *) - AV_CODEC_FLAG2_SKIP_MANUAL = $20000000; // (1 << 29) -(** - * Do not reset ASS ReadOrder field on flush (subtitles decoding) - *) - AV_CODEC_FLAG2_RO_FLUSH_NOOP = $40000000; - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independent Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - -(** - * Decoder can use draw_horiz_band callback. - *) - AV_CODEC_CAP_DRAW_HORIZ_BAND = $0001; // (1 << 0) -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - AV_CODEC_CAP_DR1 = $0002; // (1 << 1) - AV_CODEC_CAP_TRUNCATED = $0008; // (1 << 3) -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - AV_CODEC_CAP_DELAY = $0020; // (1 << 5) -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - AV_CODEC_CAP_SMALL_LAST_FRAME = $0040; // (1 << 6) - -{$IFDEF FF_API_CAP_VDPAU} -(** - * Codec can export data for HW decoding (VDPAU). - *) - AV_CODEC_CAP_HWACCEL_VDPAU = $0080; // (1 << 7) -{$ENDIF} - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carrying such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - AV_CODEC_CAP_SUBFRAMES = $0100; // (1 << 8) -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - AV_CODEC_CAP_EXPERIMENTAL = $0200; // (1 << 9) -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - AV_CODEC_CAP_CHANNEL_CONF = $0400; // (1 << 10) -(** - * Codec supports frame-level multithreading. - *) - AV_CODEC_CAP_FRAME_THREADS = $1000; // (1 << 12) -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - AV_CODEC_CAP_SLICE_THREADS = $2000; // (1 << 13) -(** - * Codec supports changed parameters at any point. - *) - AV_CODEC_CAP_PARAM_CHANGE = $4000; // (1 << 14) -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - AV_CODEC_CAP_AUTO_THREADS = $8000; // (1 << 15) -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - AV_CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; // (1 << 16) -(** - * Decoder is not a preferred choice for probing. - * This indicates that the decoder is not a good choice for probing. - * It could for example be an expensive to spin up hardware decoder, - * or it could simply not provide a lot of useful information about - * the stream. - * A decoder marked with this flag should only be used as last resort - * choice for probing. - *) - AV_CODEC_CAP_AVOID_PROBING = $20000; // (1 << 17) - -(** - * Codec is intra only. - *) - AV_CODEC_CAP_INTRA_ONLY = $40000000; -(** - * Codec is lossless. - *) - AV_CODEC_CAP_LOSSLESS = $80000000; - - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = AV_CODEC_FLAG_UNALIGNED; - CODEC_FLAG_QSCALE = AV_CODEC_FLAG_QSCALE; - CODEC_FLAG_4MV = AV_CODEC_FLAG_4MV; - CODEC_FLAG_OUTPUT_CORRUPT = AV_CODEC_FLAG_OUTPUT_CORRUPT; - CODEC_FLAG_QPEL = AV_CODEC_FLAG_QPEL; -{$IFDEF FF_API_GMC} -(** - * @deprecated use the "gmc" private option of the libxvid encoder - *) - CODEC_FLAG_GMC = $0020; ///< use GMC. -{$IFEND} -{$IFDEF FF_API_MV0} -(** - * @deprecated use the flag "mv0" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. -{$IFEND} -{$IFDEF FF_API_INPUT_PRESERVED} -(** - * @deprecated passing reference-counted frames to the encoders replaces this - * flag - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; -{$IFEND} - CODEC_FLAG_PASS1 = AV_CODEC_FLAG_PASS1; - CODEC_FLAG_PASS2 = AV_CODEC_FLAG_PASS2; - CODEC_FLAG_GRAY = AV_CODEC_FLAG_GRAY; -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = AV_CODEC_FLAG_PSNR; - CODEC_FLAG_TRUNCATED = AV_CODEC_FLAG_TRUNCATED; - -{$IFDEF FF_API_NORMALIZE_AQP} -(** - * @deprecated use the flag "naq" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization -{$IFEND} - CODEC_FLAG_INTERLACED_DCT = AV_CODEC_FLAG_INTERLACED_DCT; - CODEC_FLAG_LOW_DELAY = AV_CODEC_FLAG_LOW_DELAY; - CODEC_FLAG_GLOBAL_HEADER = AV_CODEC_FLAG_GLOBAL_HEADER; - CODEC_FLAG_BITEXACT = AV_CODEC_FLAG_BITEXACT; - CODEC_FLAG_AC_PRED = AV_CODEC_FLAG_AC_PRED; - CODEC_FLAG_LOOP_FILTER = AV_CODEC_FLAG_LOOP_FILTER; - CODEC_FLAG_INTERLACED_ME = AV_CODEC_FLAG_INTERLACED_ME; - CODEC_FLAG_CLOSED_GOP = AV_CODEC_FLAG_CLOSED_GOP; - CODEC_FLAG2_FAST = AV_CODEC_FLAG2_FAST; - CODEC_FLAG2_NO_OUTPUT = AV_CODEC_FLAG2_NO_OUTPUT; - CODEC_FLAG2_LOCAL_HEADER = AV_CODEC_FLAG2_LOCAL_HEADER; - CODEC_FLAG2_DROP_FRAME_TIMECODE = AV_CODEC_FLAG2_DROP_FRAME_TIMECODE; - CODEC_FLAG2_IGNORE_CROP = AV_CODEC_FLAG2_IGNORE_CROP; - - CODEC_FLAG2_CHUNKS = AV_CODEC_FLAG2_CHUNKS; - CODEC_FLAG2_SHOW_ALL = AV_CODEC_FLAG2_SHOW_ALL; - CODEC_FLAG2_EXPORT_MVS = AV_CODEC_FLAG2_EXPORT_MVS; - CODEC_FLAG2_SKIP_MANUAL = AV_CODEC_FLAG2_SKIP_MANUAL; - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = AV_CODEC_CAP_DRAW_HORIZ_BAND; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = AV_CODEC_CAP_DR1; - CODEC_CAP_TRUNCATED = AV_CODEC_CAP_TRUNCATED; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = AV_CODEC_CAP_DELAY; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = AV_CODEC_CAP_SMALL_LAST_FRAME; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = AV_CODEC_CAP_HWACCEL_VDPAU; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carrying such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = AV_CODEC_CAP_SUBFRAMES; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = AV_CODEC_CAP_EXPERIMENTAL; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = AV_CODEC_CAP_CHANNEL_CONF; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = AV_CODEC_CAP_FRAME_THREADS; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = AV_CODEC_CAP_SLICE_THREADS; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = AV_CODEC_CAP_PARAM_CHANGE; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = AV_CODEC_CAP_AUTO_THREADS; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = AV_CODEC_CAP_VARIABLE_FRAME_SIZE; - -(** - * Codec is intra only. - *) - CODEC_CAP_INTRA_ONLY = AV_CODEC_CAP_INTRA_ONLY; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = AV_CODEC_CAP_LOSSLESS; -{$ENDIF} (* FF_API_WITHOUT_PREFIX *) - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - // Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note bits 24-31 are reserved for codec specific use (H.264 ref0, MPEG-1 0mv, ...) *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - -{$IFDEF FF_API_RC_STRATEGY} - FF_RC_STRATEGY_XVID = 1; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; -{$ENDIF} - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_MEDIAN_SAD = 15; - FF_CMP_CHROMA = 256; - -{$IFDEF FF_API_AFD} - {attribute_deprecated} - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; -{$IFEND} - -{$IFDEF FF_API_QUANT_BIAS} - FF_DEFAULT_QUANT_BIAS = 999999; -{$ENDIF} - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG-2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - -{$IFDEF FF_API_CODER_TYPE} - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_CODER_TYPE_DEFLATE = 4; -{$ENDIF} {FF_API_UNUSED_MEMBERS} -{$ENDIF} {FF_API_CODER_TYPE} - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - FF_BUG_IEDGE = 32768; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - FF_EC_FAVOR_INTER = 256; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DEBUG_PTS = $00000200; -{$ENDIF} - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; ///< only access through AVOptions from outside libavcodec - FF_DEBUG_VIS_MB_TYPE = $00004000; ///< only access through AVOptions from outside libavcodec -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - FF_DEBUG_GREEN_MD = $00800000; - FF_DEBUG_NOMC = $01000000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; // visualize forward predicted MVs of P-frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; // visualize forward predicted MVs of B-frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; // visualize backward predicted MVs of B-frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; ///< detect bitstream specification deviations - AV_EF_BUFFER = 4; ///< detect improper bitstream length - AV_EF_EXPLODE = 8; ///< abort decoding on minor error detection - - AV_EF_IGNORE_ERR = 32768; ///< ignore errors and continue - AV_EF_CAREFUL = 65536; ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors - AV_EF_COMPLIANT = 131072; ///< consider all spec non compliances as errors - AV_EF_AGGRESSIVE = 262144; ///< consider things that a sane encoder should not do as an error - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; -{$IFDEF FF_API_ARCH_SH4} - FF_IDCT_SH4 = 9; -{$ENDIF} - FF_IDCT_SIMPLEARM = 10; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_IDCT_IPP = 13; -{$ENDIF} - FF_IDCT_XVID = 14; -{$IFDEF FF_API_IDCT_XVIDMMX} - FF_IDCT_XVIDMMX = 14; -{$ENDIF} - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; -{$IFDEF FF_API_ARCH_SPARC} - FF_IDCT_SIMPLEVIS = 18; -{$ENDIF} - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - FF_IDCT_SIMPLEAUTO = 128; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DNXHD = 0; - FF_PROFILE_DNXHR_LB = 1; - FF_PROFILE_DNXHR_SQ = 2; - FF_PROFILE_DNXHR_HQ = 3; - FF_PROFILE_DNXHR_HQX = 4; - FF_PROFILE_DNXHR_444 = 5; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_DTS_EXPRESS = 70; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_MULTIVIEW_HIGH = 118; - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_STEREO_HIGH = 128; - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 1; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 2; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 32768; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_VP9_0 = 0; - FF_PROFILE_VP9_1 = 1; - FF_PROFILE_VP9_2 = 2; - FF_PROFILE_VP9_3 = 3; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - FF_PROFILE_HEVC_REXT = 4; - - - FF_LEVEL_UNKNOWN = -99; - -type - - (** - * This structure describes the bitrate properties of an encoded bitstream. It - * roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD - * parameters for H.264/HEVC. - *) - PAVCPBProperties = ^TAVCPBProperties; - TAVCPBProperties = record - (** - * Maximum bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - max_bitrate: cint; - (** - * Minimum bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - min_bitrate: cint; - (** - * Average bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - avg_bitrate: cint; - - (** - * The size of the buffer to which the ratecontrol is applied, in bits. - * Zero if unknown or unspecified. - *) - buffer_size: cint; - - (** - * The delay between the time the packet this structure is associated with - * is received and the time when it should be decoded, in periods of a 27MHz - * clock. - * - * UINT64_MAX when unknown or unspecified. - *) - vbv_delay: cuint64; - end; {TAVCPBProperties} - - TAVPacketSideDataType = ( - AV_PKT_DATA_PALETTE, - - (** - * The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format - * that the extradata buffer was changed and the receiving side should - * act upon it appropriately. The new extradata is embedded in the side - * data buffer and should be immediately used for processing the current - * frame or packet. - *) - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * This side data should be associated with an audio stream and contains - * ReplayGain information in form of the AVReplayGain struct. - *) - AV_PKT_DATA_REPLAYGAIN, - - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the decoded video frames for - * correct presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_PKT_DATA_DISPLAYMATRIX, - - (** - * This side data should be associated with a video stream and contains - * Stereoscopic 3D information in form of the AVStereo3D struct. - *) - AV_PKT_DATA_STEREO3D, - - (** - * This side data should be associated with an audio stream and corresponds - * to enum AVAudioServiceType. - *) - AV_PKT_DATA_AUDIO_SERVICE_TYPE, - - (** - * This side data contains quality related information from the encoder. - * @code - * u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad). - * u8 picture type - * u8 error count - * u16 reserved - * u64le[error count] sum of squared differences between encoder in and output - * @endcode - *) - AV_PKT_DATA_QUALITY_STATS, - - (** - * This side data contains an integer value representing the stream index - * of a "fallback" track. A fallback track indicates an alternate - * track to use when the current track can not be decoded for some reason. - * e.g. no decoder available for codec. - *) - AV_PKT_DATA_FALLBACK_TRACK, - - (** - * This side data corresponds to the AVCPBProperties struct. - *) - AV_PKT_DATA_CPB_PROPERTIES, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE, - - (** - * MPEGTS stream ID, this is required to pass the stream ID - * information from the demuxer to the corresponding muxer. - *) - AV_PKT_DATA_MPEGTS_STREAM_ID, - - (** - * Mastering display metadata (based on SMPTE-2086:2014). This metadata - * should be associated with a video stream and containts data in the form - * of the AVMasteringDisplayMetadata struct. - *) - AV_PKT_DATA_MASTERING_DISPLAY_METADATA - ); - - PAVPacketSideData = ^TAVPacketSideData; - TAVPacketSideData = record - data: PByte; - size: cint; - type_: TAVPacketSideDataType; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. Encoders are allowed to output empty - * packets, with no compressed data, containing only side data - * (e.g. to update some stream parameters at the end of encoding). - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf field. - * If it is set, the packet data is dynamically allocated and is - * valid indefinitely until a call to av_packet_unref() reduces the - * reference count to 0. - * - * If the buf field is not set av_packet_ref() would make a copy instead - * of increasing the reference count. - * - * The side data is always allocated with av_malloc(), copied by - * av_packet_ref() and freed by av_packet_unref(). - * - * @see av_packet_ref - * @see av_packet_unref - *) - PPAVPacket= ^PAVPacket; - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideData; - side_data_elems: cint; - - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint64; - - pos: cint64; // byte position in stream, -1 if unknown - -{$IFDEF FF_API_CONVERGENCE_DURATION} - (* - * @deprecated Same as the duration field, but as int64_t. This was required - * for Matroska subtitles, whose duration values could overflow when the - * duration field was still an int. - *) - convergence_duration: cint64; {deprecated} -{$ENDIF} - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - (** - * Flag is used to discard packets which are required to maintain valid - * decoder state but are not required for output and should be dropped - * after decoding. - **) - AV_PKT_FLAG_DISCARD = $0004; - - AV_NUM_DATA_POINTERS = 8; - - AV_PKT_DATA_QUALITY_FACTOR = AV_PKT_DATA_QUALITY_STATS; //DEPRECATED - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * The name string for AVOptions options matches the associated command line - * parameter name and can be found in libavcodec/options_table.h - * The AVOption/command line parameter names differ in some cases from the C - * structure field names for historic reasons or brevity. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; -{$IFDEF FF_API_CODEC_NAME} - (** - * @deprecated this field is not used for anything in libavcodec - *) - {attribute_deprecated} - codec_name: array [0..31] of AnsiChar; -{$IFEND} - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - -{$IFDEF FF_API_STREAM_CODEC_TAG} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - stream_codec_tag: cuint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by user, may be overwritten by libavcodec - * if this info is available in the stream - *) - bit_rate: cint64; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * AV_CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * AV_CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * MJPEG: Huffman tables - * rv10: additional flags - * MPEG-4: global headers (they can be in the bitstream or here) - * The allocated memory should be AV_FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * This often, but not always is the inverse of the frame rate or field rate - * for video. 1/time_base is not the average frame rate if the frame rate is not - * constant. - * - * Like containers, elementary streams also can store timestamps, 1/time_base - * is the unit in which these timestamps are specified. - * As example of such codec time base see ISO/IEC 14496-2:2001(E) - * vop_time_increment_resolution and fixed_vop_rate - * (fixed_vop_rate == 0 implies that it is different from the framerate) - * - * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this field is unused (see initial_padding). - * - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - * @note Those fields may not match the values of the last - * AVFrame output by avcodec_decode_video2 due frame - * reordering. - * - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - * @note Those field may not match the value of the last - * AVFrame output by avcodec_receive_frame() due frame - * reordering. - * - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - * @note This field may not match the value of the last - * AVFrame output by avcodec_receive_frame() due frame - * reordering. - * - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec while - * parsing the data. - *) - pix_fmt: TAVPixelFormat; - -{$IFDEF FF_API_MOTION_EST} - (** - * This option does nothing - *@deprecated use codec private options instead - *) - {attribute_deprecated} - me_method: cint; -{$ENDIF} - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @note The callback may be called again immediately if initialization for - * the selected (hardware-accelerated) pixel format failed. - * @warning Behavior is undefined if the callback returns a value not - * in the fmt list of formats. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - -{$IFDEF FF_API_RC_STRATEGY} - (** @deprecated use codec private option instead *) - {attribute_deprecated} - rc_strategy: cint; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - b_frame_strategy: cint; {deprecated} -{$ENDIF} - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - mpeg_quant: cint; {deprecated} -{$ENDIF} - - (** - * qscale factor between P- and I-frames - * If > 0 then the last P- frame quantizer will be used (q = lastp_q * factor + offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - prediction_method: cint; {deprecated} -{$ENDIF} - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - pre_me: cint; {deprecated} -{$ENDIF} - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - -{$IFDEF FF_API_AFD} - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - * @deprecated Deprecated in favor of AVSideData - *) - {attribute_deprecated} - dtg_active_format: cint; -{$IFEND} - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - -{$IFDEF FF_API_QUANT_BIAS} - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - intra_quant_bias: cint; - - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - inter_quant_bias: cint; -{$ENDIF} - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - scenechange_threshold: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - noise_reduction: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - me_threshold: cint; - - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - mb_threshold: cint; -{$ENDIF} - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: Set by libavcodec - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - border_masking: cfloat; -{$ENDIF} - (** - * minimum MB Lagrange multiplier - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB Lagrange multiplier - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** - * @deprecated use encoder private options instead - *) - me_penalty_compensation: cint; {deprecated} -{$ENDIF} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - brd_scale: cint; {deprecated} -{$ENDIF} - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - chromaoffset: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_UNUSED_MEMBERS} - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; {attribute_deprecated} -{$IFEND} - - (** - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - b_sensitivity: cint; {deprecated} -{$ENDIF} - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise extended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * This is always automatically enabled if avcodec_receive_frame() is used. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_qsquish: cfloat; - - {attribute_deprecated} - rc_qmod_amp: cfloat; - {attribute_deprecated} - rc_qmod_freq: cint; -{$ENDIF} - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_eq: {const} PAnsiChar; -{$ENDIF} - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: Set by user, may be overwritten by libavcodec. - *) - rc_max_rate: cint64; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint64; - -{$IFDEF FF_API_MPV_OPT} - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_buffer_aggressivity: cfloat; - - {attribute_deprecated} - rc_initial_cplx: cfloat; -{$ENDIF} - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - -{$IFDEF FF_API_CODER_TYPE} - (** - * @deprecated use encoder private options instead - *) - coder_type: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - context_model: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmin: cint; - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmax: cint; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - frame_skip_threshold: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_factor: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_exp: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_cmp: cint; {deprecated} -{$ENDIF} - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - min_prediction_order: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - max_prediction_order: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - timecode_frame_start: cint64; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_RTP_CALLBACK} - (** - * @deprecated unused - *) - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - rtp_payload_size: cint; {deprecated} (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) -{$ENDIF} - -{$IFDEF FF_API_STAT_BITS} - (* statistics, used for 2-pass encoding *) - mv_bits: cint; {deprecated} - header_bits: cint; {deprecated} - i_tex_bits: cint; {deprecated} - p_tex_bits: cint; {deprecated} - i_count: cint; {deprecated} - p_count: cint; {deprecated} - skip_count: cint; {deprecated} - misc_bits: cint; {deprecated} - - (** @deprecated this field is unused *) - frame_bits: cint; {deprecated} -{$ENDIF} - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG-4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64-bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - -{$IFDEF FF_API_CODED_FRAME} - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - * - * @deprecated use the quality factor packet side data instead - *) - {attribute_deprecated} - coded_frame: PAVFrame; -{$ENDIF} - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_VBV_DELAY} - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - * @deprecated this value is now exported as a part of - * AV_PKT_DATA_CPB_PROPERTIES packet side data - *) - vbv_delay: cuint64; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_SIDEDATA_ONLY_PKT} - (** - * Encoding only and set by default. Allow encoders to output packets - * that do not contain any encoded data, only side data. - * - * Some encoders need to output such packets, e.g. to update some stream - * parameters at the end of encoding. - * - * @deprecated this field disables the default behaviour and - * it is kept only for compatibility. - *) - side_data_only_packets: cint; {deprecated} -{$ENDIF} - - (** - * Audio only. The number of "priming" samples (padding) inserted by the - * encoder at the beginning of the audio. I.e. this number of leading - * decoded samples must be discarded by the caller to get the original audio - * without leading padding. - * - * - decoding: unused - * - encoding: Set by libavcodec. The timestamps on the output packets are - * adjusted by the encoder so that they always refer to the - * first sample of the data actually contained in the packet, - * including any added padding. E.g. if the timebase is - * 1/samplerate and the timestamp of the first input sample is - * 0, the timestamp of the first output packet will be - * -initial_padding. - *) - initial_padding: cint; - - (** - * - decoding: For codecs that store a framerate value in the compressed - * bitstream, the decoder may export it here. { 0, 1} when - * unknown. - * - encoding: May be used to signal the framerate of CFR content to an - * encoder. - *) - framerate: TAVRational; - - (** - * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - * - encoding: unused. - * - decoding: Set by libavcodec before calling get_format() - *) - sw_pix_fmt: TAVPixelFormat; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_pkt_timebase(avctx) - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_codec_descriptor(avctx) - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - * Code outside libavcodec should access this field using: - * av_codec_{get,set}_lowres(avctx) - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * Code outside libavcodec should access this field using AVOptions - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavcodec should access this field using AVOptions - * (NO direct access). - * - encoding: Set by user. - * - decoding: Set by user. - *) - dump_separator: Pcuint8; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (* - * Properties of the stream that gets decoded - * To be accessed through av_codec_get_properties() (NO direct access) - * - encoding: unused - * - decoding: set by libavcodec - *) - properties: cuint; - - (** - * Additional data associated with the entire coded stream. - * - * - decoding: unused - * - encoding: may be set by libavcodec after avcodec_open2(). - *) - coded_side_data: PAVPacketSideData; - nb_coded_side_data: cint; - - (** - * A reference to the AVHWFramesContext describing the input (for encoding) - * or output (decoding) frames. The reference is set by the caller and - * afterwards owned (and freed) by libavcodec. - * - * - decoding: This field should be set by the caller from the get_format() - * callback. The previous reference (if any) will always be - * unreffed by libavcodec before the get_format() call. - * - * If the default get_buffer2() is used with a hwaccel pixel - * format, then this AVHWFramesContext will be used for - * allocating the frame buffers. - * - * - encoding: For hardware encoders configured to use a hwaccel pixel - * format, this field should be set by the caller to a reference - * to the AVHWFramesContext describing input frames. - * AVHWFramesContext.format must be equal to - * AVCodecContext.pix_fmt. - * - * This field should be set before avcodec_open2() is called. - *) - hw_frames_ctx: PAVBufferRef; - - (** - * Control the form of AVSubtitle.rects[N]->ass - * - decoding: set by user - * - encoding: unused - *) - sub_text_format: cint; - - (** - * Audio only. The amount of padding (in samples) appended by the encoder to - * the end of the audio. I.e. this number of decoded samples must be - * discarded by the caller from the end of the stream to get the original - * audio without any trailing padding. - * - * - decoding: unused - * - encoding: unused - *) - trailing_padding: cint; - - end; {TAVCodecContext} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - -{$IFDEF FF_API_AVPICTURE} - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * Picture data structure. - * - * Up to four components can be stored into it, the last component is - * alpha. - * @deprecated use AVFrame or imgutils functions instead - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; {deprecated} - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; {deprecated} ///< number of bytes per line - end; {TAVPicture} -{$ENDIF} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - -{$IFDEF FF_API_AVPICTURE} - (** - * @deprecated unused - *) - pict: TAVPicture; {deprecated} -{$ENDIF} - (** - * data+linesize for the bitmap of this subtitle. - * Can be set for text/ass as well once they are rendered. - *) - data: Array [0..4] of PByte; - linesize: Array [0..4] of cint; - - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - - (** - * This struct describes the properties of an encoded stream. - * - * sizeof(AVCodecParameters) is not a part of the public ABI, this struct must - * be allocated with avcodec_parameters_alloc() and freed with - * avcodec_parameters_free(). - *) - PPAVCodecParameters = ^PAVCodecParameters; - PAVCodecParameters = ^TAVCodecParameters; - TAVCodecParameters = record - (** - * General type of the encoded data. - *) - codec_type: TAVMediaType; - (** - * Specific type of the encoded data (the codec used). - *) - codec_id: TAVCodecID; - (** - * Additional information about the codec (corresponds to the AVI FOURCC). - *) - codec_tag: cuint32; - - (** - * Extra binary data needed for initializing the decoder, codec-dependent. - * - * Must be allocated with av_malloc() and will be freed by - * avcodec_parameters_free(). The allocated size of extradata must be at - * least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding - * bytes zeroed. - *) - extradata: Pcuint8; - (** - * Size of the extradata content in bytes. - *) - extradata_size: cint; - - (** - * - video: the pixel format, the value corresponds to enum AVPixelFormat. - * - audio: the sample format, the value corresponds to enum AVSampleFormat. - *) - format: cint; - - (** - * The average bitrate of the encoded data (in bits per second). - *) - bit_rate: cint64; - - (** - * The number of bits per sample in the codedwords. - * - * This is basically the bitrate per sample. It is mandatory for a bunch of - * formats to actually decode them. It's the number of bits for one sample in - * the actual coded bitstream. - * - * This could be for example 4 for ADPCM - * For PCM formats this matches bits_per_raw_sample - * Can be 0 - *) - bits_per_coded_sample: cint; - - (** - * This is the number of valid bits in each output sample. If the - * sample format has more bits, the least significant bits are additional - * padding bits, which are always 0. Use right shifts to reduce the sample - * to its actual size. For example, audio formats with 24 bit samples will - * have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. - * To get the original sample use "(int32_t)sample >> 8"." - * - * For ADPCM this might be 12 or 16 or similar - * Can be 0 - *) - bits_per_raw_sample: cint; - - (** - * Codec-specific bitstream restrictions that the stream conforms to. - *) - profile: cint; - level: cint; - - (** - * Video only. The dimensions of the video frame in pixels. - *) - width: cint; - height: cint; - - (** - * Video only. The aspect ratio (width / height) which a single pixel - * should have when displayed. - * - * When the aspect ratio is unknown / undefined, the numerator should be - * set to 0 (the denominator may have any value). - *) - sample_aspect_ratio: TAVRational; - - (** - * Video only. The order of the fields in interlaced video. - *) - field_order: TAVFieldOrder; - - (** - * Video only. Additional colorspace characteristics. - *) - color_range: TAVColorRange; - color_primaries: TAVColorPrimaries; - color_trc: TAVColorTransferCharacteristic; - color_space: TAVColorSpace; - chroma_location: TAVChromaLocation; - - (** - * Video only. Number of delayed frames. - *) - video_delay: cint; - - (** - * Audio only. The channel layout bitmask. May be 0 if the channel layout is - * unknown or unspecified, otherwise the number of bits set must be equal to - * the channels field. - *) - channel_layout: cuint64; - (** - * Audio only. The number of audio channels. - *) - channels: cint; - (** - * Audio only. The number of audio samples per second. - *) - sample_rate: cint; - (** - * Audio only. The number of bytes per coded audio frame, required by some - * formats. - * - * Corresponds to nBlockAlign in WAVEFORMATEX. - *) - block_align: cint; - (** - * Audio only. Audio frame size, if known. Required by some formats to be static. - *) - frame_size: cint; - - (** - * Audio only. The amount of padding (in samples) inserted by the encoder at - * the beginning of the audio. I.e. this number of leading decoded samples - * must be discarded by the caller to get the original audio without leading - * padding. - *) - initial_padding: cint; - (** - * Audio only. The amount of padding (in samples) appended by the encoder to - * the end of the audio. I.e. this number of decoded samples must be - * discarded by the caller from the end of the stream to get the original - * audio without any trailing padding. - *) - trailing_padding: cint; - (** - * Audio only. Number of samples to skip after a discontinuity. - *) - seek_preroll: cint; - end; {TAVCodecParameters} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see AV_CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< maximum value for lowres supported by the decoder, no direct access, use av_codec_get_max_lowres() - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Decode/encode API with decoupled packet/frame dataflow. The API is the - * same as the avcodec_ prefixed APIs (avcodec_send_frame() etc.), except - * that: - * - never called if the codec is closed or the wrong type, - * - AVPacket parameter change side data is applied right before calling - * AVCodec->send_packet, - * - if AV_CODEC_CAP_DELAY is not set, drain packets or frames are never sent, - * - only one drain packet is ever passed down (until the next flush()), - * - a drain AVPacket is always NULL (no need to check for avpkt->size). - *) - send_frame: function(avctx: PAVCodecContext; frame: {const} PAVFrame): cint; cdecl; - send_packet: function(avctx: PAVCodecContext; frame: {const} PAVPacket): cint; cdecl; - receive_frame: function(avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - receive_packet: function(avctx: PAVCodecContext; avpkt: PAVPacket): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - (** - * Internal codec capabilities. - * See FF_CODEC_CAP_* in internal.h - *) - caps_internal: cint; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * @defgroup lavc_hwaccel AVHWAccel - * @{ - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVHWAccel; - - (** - * Allocate a custom buffer - *) - alloc_frame: function (avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - frame_priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the ff_mpv_decode_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - decode_mb: procedure(s: PMpegEncContext); cdecl; - - (** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - *) - init: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - *) - uninit: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - *) - priv_data_size: cint; - end; {TAVHWAccel} - -const - (** - * Hardware acceleration should be used for decoding even if the codec level - * used is unknown or higher than the maximum supported level reported by the - * hardware driver. - * - * It's generally a good idea to pass this flag unless you have a specific - * reason not to, as hardware tends to under-report supported levels. - *) - AV_HWACCEL_FLAG_IGNORE_LEVEL = (1 << 0); - - (** - * Hardware acceleration can output YUV pixel formats with a different chroma - * sampling than 4:2:0 and/or other than 8 bits per component. - *) - AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = (1 << 1); - - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - FF_CODEC_PROPERTY_LOSSLESS = $00000001; - FF_CODEC_PROPERTY_CLOSED_CAPTIONS = $00000002; - FF_SUB_TEXT_FMT_ASS = 0; -{$IFDEF FF_API_ASS_TIMING} - FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS = 1; -{$ENDIF} - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_codec_properties(avctx: {const} PAVCodecContext): cuint; - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct should be freed with avcodec_free_context(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Free the codec context and everything associated with it and write NULL to - * the provided pointer. - *) -procedure avcodec_free_context(var avctx: PAVCodecContext); - cdecl; external av__codec; - -{$IFDEF FF_API_GET_CONTEXT_DEFAULTS} -(** - * @deprecated This function should not be used, as closing and opening a codec - * context multiple time is not supported. A new codec context should be - * allocated for each new use. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -{$IFDEF FF_API_COPY_CONTEXT} -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - * - * @deprecated The semantics of this function are ill-defined and it should not - * be used. If you need to transfer the stream parameters from one codec context - * to another, use an intermediate AVCodecParameters instance and the - * avcodec_parameters_from_context() / avcodec_parameters_to_context() - * functions. - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Allocate a new AVCodecParameters and set its fields to default values - * (unknown/invalid/0). The returned struct must be freed with - * avcodec_parameters_free(). - *) -function avcodec_parameters_alloc(): PAVCodecParameters; - cdecl; external av__codec; - -(** - * Free an AVCodecParameters instance and everything associated with it and - * write NULL to the supplied pointer. - *) -procedure avcodec_parameters_free(par: PPAVCodecParameters); - cdecl; external av__codec; - -(** - * Copy the contents of src to dst. Any allocated fields in dst are freed and - * replaced with newly allocated duplicates of the corresponding fields in src. - * - * @return >= 0 on success, a negative AVERROR code on failure. - *) -function avcodec_parameters_copy(dst: PAVCodecParameters; src: {const} PAVCodecParameters): cint; - cdecl; external av__codec; - -(** - * Fill the parameters struct based on the values from the supplied codec - * context. Any allocated fields in par are freed and replaced with duplicates - * of the corresponding fields in codec. - * - * @return >= 0 on success, a negative AVERROR code on failure - *) -function avcodec_parameters_from_context(par: PAVCodecParameters; - codec: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Fill the codec context based on the values from the supplied codec - * parameters. Any allocated fields in codec that have a corresponding field in - * par are freed and replaced with duplicates of the corresponding field in par. - * Fields in codec that do not have a counterpart in par are not touched. - * - * @return >= 0 on success, a negative AVERROR code on failure. - *) -function avcodec_parameters_to_context(codec: PAVCodecContext; - par: {const} PAVCodecParameters): cint; - cdecl; external av__codec; - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_receive_frame()). - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * for this context, then this parameter MUST be either NULL or - * equal to the previously passed codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() with a non-NULL - * codec. Subsequent calls will do nothing. - * - * @note Do not use this function. Use avcodec_free_context() to destroy a - * codec context (either open or closed). Opening and closing a codec context - * multiple times is not supported anymore -- use multiple codec contexts - * instead. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -(** - * Allocate an AVPacket and set its fields to default values. The resulting - * struct must be freed using av_packet_free(). - * - * @return An AVPacket filled with default values or NULL on failure. - * - * @note this only allocates the AVPacket itself, not the data buffers. Those - * must be allocated through other means such as av_new_packet. - * - * @see av_new_packet - *) -function av_packet_alloc(): PAVPacket; - cdecl; external av__codec; - -(** - * Create a new packet that references the same data as src. - * - * This is a shortcut for av_packet_alloc()+av_packet_ref(). - * - * @return newly created AVPacket on success, NULL on error. - * - * @see av_packet_alloc - * @see av_packet_ref - *) -function av_packet_clone(src: PAVPacket): PAVPacket; - cdecl; external av__codec; - -(** - * Free the packet, if the packet is reference counted, it will be - * unreferenced first. - * - * @param packet packet to be freed. The pointer will be set to NULL. - * @note passing NULL is a no-op. - *) -procedure av_packet_free(pkt: PPAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVPACKET_OLD_API} -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - * - * @deprecated Use av_packet_ref - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - *) -function av_copy_packet_side_data(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @deprecated Use av_packet_unref - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Wrap an existing array as a packet side data. - * - * @param pkt packet - * @param type side information type - * @param data the side data array. It must be allocated with the av_malloc() - * family of functions. The ownership of the data is transferred to - * pkt. - * @param size side information size - * @return a non-negative number on success, a negative AVERROR code on - * failure. On failure, the packet is unchanged and the data remains - * owned by the caller. - *) -function av_packet_add_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - data: Pcuint8; size: size_t): cint; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; - -function av_packet_side_data_name(type_: TAVPacketSideDataType): PAnsiChar; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Convert valid timing fields (timestamps / durations) in a packet from one - * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be - * ignored. - * - * @param pkt packet on which the conversion will be performed - * @param tb_src source timebase, in which the timing fields in pkt are - * expressed - * @param tb_dst destination timebase, to which the timing fields will be - * converted - *) -procedure av_packet_rescale_ts(pkt: PAVPacket; tb_src, tb_dst: TAVRational); - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * AV_CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame and the return value would be - * less than the packet size. In this case, avcodec_decode_audio4 has to be - * called again with an AVPacket containing the remaining data in order to - * decode the second frame, etc... Even if no frames are returned, the packet - * needs to be fed to the decoder with remaining data until it is completely - * consumed or an error occurs. - * - * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning samples. It is safe to flush even those decoders that are not - * marked with AV_CODEC_CAP_DELAY, then no samples will be returned. - * - * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. Note that this field being set to zero - * does not mean that an error has occurred. For - * decoders with AV_CODEC_CAP_DELAY set, no given decode - * call is guaranteed to produce a frame. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - * - * @deprecated Use avcodec_send_packet() and avcodec_receive_frame(). - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be AV_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note Codecs which have the AV_CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - * - * @deprecated Use avcodec_send_packet() and avcodec_receive_frame(). - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; deprecated; - -(* - * Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning subtitles. It is safe to flush even those decoders that are not - * marked with CODEC_CAP_DELAY, then no subtitles will be returned. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, - * must be freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Supply raw packet data as input to a decoder. - * - * Internally, this call will copy relevant AVCodecContext fields, which can - * influence decoding per-packet, and apply them when the packet is actually - * decoded. (For example AVCodecContext.skip_frame, which might direct the - * decoder to drop the frame contained by the packet sent with this function.) - * - * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @warning Do not mix this API with the legacy API (like avcodec_decode_video2()) - * on the same AVCodecContext. It will return unexpected results now - * or in future libavcodec versions. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx codec context - * @param[in] avpkt The input AVPacket. Usually, this will be a single video - * frame, or several complete audio frames. - * Ownership of the packet remains with the caller, and the - * decoder will not write to the packet. The decoder may create - * a reference to the packet data (or copy it if the packet is - * not reference-counted). - * Unlike with older APIs, the packet is always fully consumed, - * and if it contains multiple frames (e.g. some audio codecs), - * will require you to call avcodec_receive_frame() multiple - * times afterwards before you can send a new packet. - * It can be NULL (or an AVPacket with data set to NULL and - * size set to 0); in this case, it is considered a flush - * packet, which signals the end of the stream. Sending the - * first flush packet will return success. Subsequent ones are - * unnecessary and will return AVERROR_EOF. If the decoder - * still has frames buffered, it will return them after sending - * a flush packet. - * - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted right now - the packet must be - * resent after trying to read output - * AVERROR_EOF: the decoder has been flushed, and no new packets can - * be sent to it (also returned if more than 1 flush - * packet is sent) - * AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate decoding errors - *) -function avcodec_send_packet(avctx: PAVCodecContext; avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Return decoded output data from a decoder. - * - * @param avctx codec context - * @param frame This will be set to a reference-counted video or audio - * frame (depending on the decoder type) allocated by the - * decoder. Note that the function will always call - * av_frame_unref(frame) before doing anything else. - * - * @return - * 0: success, a frame was returned - * AVERROR(EAGAIN): output is not available right now - user must try - * to send new input - * AVERROR_EOF: the decoder has been fully flushed, and there will be - * no more output frames - * AVERROR(EINVAL): codec not opened, or it is an encoder - * other negative values: legitimate decoding errors - *) -function avcodec_receive_frame(avctx: PAVCodecContext; frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Supply a raw video or audio frame to the encoder. Use avcodec_receive_packet() - * to retrieve buffered output packets. - * - * @param avctx codec context - * @param[in] frame AVFrame containing the raw audio or video frame to be encoded. - * Ownership of the frame remains with the caller, and the - * encoder will not write to the frame. The encoder may create - * a reference to the frame data (or copy it if the frame is - * not reference-counted). - * It can be NULL, in which case it is considered a flush - * packet. This signals the end of the stream. If the encoder - * still has packets buffered, it will return them after this - * call. Once flushing mode has been entered, additional flush - * packets are ignored, and sending frames will return - * AVERROR_EOF. - * - * For audio: - * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted right now - the frame must be - * resent after trying to read output packets - * AVERROR_EOF: the encoder has been flushed, and no new frames can - * be sent to it - * AVERROR(EINVAL): codec not opened, refcounted_frames not set, it is a - * decoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate decoding errors - *) -function avcodec_send_frame(avctx: PAVCodecContext; frame: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Read encoded data from the encoder. - * - * @param avctx codec context - * @param avpkt This will be set to a reference-counted packet allocated by the - * encoder. Note that the function will always call - * av_frame_unref(frame) before doing anything else. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): output is not available right now - user must try - * to send input - * AVERROR_EOF: the encoder has been fully flushed, and there will be - * no more output packets - * AVERROR(EINVAL): codec not opened, or it is an encoder - * other errors: legitimate decoding errors - *) -function avcodec_receive_packet(avctx: PAVCodecContext; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - -{$IFDEF FF_API_CONVERGENCE_DURATION} - (** - * @deprecated unused - *) - convergence_duration: cint64; {deprecated} -{$ENDIF} - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - (** - * Picture number incremented in presentation or output order. - * This field may be reinitialized at the first picture of a new sequence. - * - * For example, this corresponds to H.264 PicOrderCnt. - *) - output_picture_number: cint; - - (** - * Dimensions of the decoded video intended for presentation. - *) - width: cint; - height: cint; - - (** - * Dimensions of the coded video. - *) - coded_width: cint; - coded_height: cint; - - (** - * The format of the coded data, corresponds to enum AVPixelFormat for video - * and for enum AVSampleFormat for audio. - * - * Note that a decoder can have considerable freedom in how exactly it - * decodes the data, so the format reported here might be different from the - * one returned by a decoder. - *) - format: cint; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - (* This callback never returns an error, a negative value means that - * the frame start was in a previous packet. *) - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: {const} PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size buffer size in bytes without the padding. I.e. the full buffer - size is assumed to be buf_size + AV_INPUT_BUFFER_PADDING_SIZE. - To signal EOF, this should be 0 (so that the last frame - can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_packet_unref(). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - * - * @deprecated use avcodec_send_frame()/avcodec_receive_packet() instead - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; deprecated; - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_packet_unref(). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - * - * @deprecated use avcodec_send_frame()/avcodec_receive_packet() instead - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; deprecated; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -{$IFDEF FF_API_AVPICTURE} -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * @deprecated unused - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_fill_arrays() instead. - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_copy_to_buffer() instead. - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_get_buffer_size() instead. - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated av_image_copy() instead. - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -(** - * Utility function to access log2_chroma_w log2_chroma_h from - * the pixel format AVPixFmtDescriptor. - * - * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample - * for one that returns a failure code and continues in case of invalid - * pix_fmts. - * - * @param[in] pix_fmt the pixel format - * @param[out] h_shift store log2_chroma_w - * @param[out] v_shift store log2_chroma_h - * - * @see av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * @deprecated see av_get_pix_fmt_loss() - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @deprecated see av_find_best_pix_fmt_of_2() - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec_id the ID of the codec to which the requested profile belongs - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - * - * @note unlike av_get_profile_name(), which searches a list of profiles - * supported by a specific decoder or encoder implementation, this - * function searches the list of profiles from the AVCodecDescriptor - *) -function avcodec_profile_name(codec_id: TAVCodecID; profile: cint): {const} PChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -(** - * This function is the same as av_get_audio_frame_duration(), except it works - * with AVCodecParameters instead of an AVCodecContext. - *) -function av_get_audio_frame_duration2(par: PAVCodecParameters; frame_bytes: cint): cint; - cdecl; external av__codec; - -type -{$IFDEF FF_API_OLD_BSF} - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - (** - * Internal default arguments, used if NULL is passed to av_bitstream_filter_filter(). - * Not for access by library users. - *) - args: PChar; - end; -{$ENDIF} - - PAVBSFInternal = ^TAVBSFInternal; - TAVBSFInternal = record - end; - - (** - * The bitstream filter state. - * - * This struct must be allocated with av_bsf_alloc() and freed with - * av_bsf_free(). - * - * The fields in the struct will only be changed (by the caller or by the - * filter) as described in their documentation, and are to be considered - * immutable otherwise. - *) - PPAVBSFContext = ^PAVBSFContext; - PAVBSFContext = ^TAVBSFContext; - TAVBSFContext = record - (** - * A class for logging and AVOptions - *) - av_class: {const} PAVClass; - - (** - * The bitstream filter this context is an instance of. - *) - filter: {const} PAVBitStreamFilter; - - (** - * Opaque libavcodec internal data. Must not be touched by the caller in any - * way. - *) - internal: PAVBSFInternal; - - (** - * Opaque filter-specific private data. If filter->priv_class is non-NULL, - * this is an AVOptions-enabled struct. - *) - priv_data: pointer; - - (** - * Parameters of the input stream. Set by the caller before av_bsf_init(). - *) - par_in: PAVCodecParameters; - - (** - * Parameters of the output stream. Set by the filter in av_bsf_init(). - *) - par_out: PAVCodecParameters; - - (** - * The timebase used for the timestamps of the input packets. Set by the - * caller before av_bsf_init(). - *) - time_base_in: TAVRational; - - (** - * The timebase used for the timestamps of the output packets. Set by the - * filter in av_bsf_init(). - *) - time_base_out: TAVRational; - end; {TAVBSFContext} - - TAVBitStreamFilter = record - name: PAnsiChar; - - (** - * A list of codec ids supported by the filter, terminated by - * AV_CODEC_ID_NONE. - * May be NULL, in that case the bitstream filter works with any codec id. - *) - codec_ids: PAVCodecID; - - (** - * A class for the private data, used to declare bitstream filter private - * AVOptions. This field is NULL for bitstream filters that do not declare - * any options. - * - * If this field is non-NULL, the first member of the filter private data - * must be a pointer to AVClass, which will be set by libavcodec generic - * code to this class. - *) - priv_class: PAVClass; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - priv_data_size: cint; - init: function(ctx: PAVBSFContext): cint; cdecl; - filter: function(ctx: PAVBSFContext; pkt: PAVPacket): cint; cdecl; - close: procedure(ctx: PAVBSFContext); cdecl; - end; - - PPAVBSFList = ^PAVBSFList; - PAVBSFList = ^TAVBSFList; - TAVBSFList = record - end; - -{$IFDEF FF_API_OLD_BSF} -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; deprecated; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; deprecated; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is available in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output buffer is not allocated and - * should be considered identical to the input buffer, or in case - * *poutbuf was set it points to the input buffer (not necessarily to - * its starting address). A special case is if *poutbuf was set to NULL and - * *poutbuf_size was set to 0, which indicates the packet should be dropped. - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; deprecated; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: {const} PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * @return a bitstream filter with the specified name or NULL if no such - * bitstream filter exists. - *) -function av_bsf_get_by_name(name: {const} PAnsiChar): {const} PAVBitStreamFilter; - cdecl; external av__codec; - -(** - * Iterate over all registered bitstream filters. - * - * @param opaque a pointer where libavcodec will store the iteration state. Must - * point to NULL to start the iteration. - * - * @return the next registered bitstream filter or NULL when the iteration is - * finished - *) -function av_bsf_next(opaque: pointer): {const} PAVBitStreamFilter; - cdecl; external av__codec; - -(** - * Allocate a context for a given bitstream filter. The caller must fill in the - * context parameters as described in the documentation and then call - * av_bsf_init() before sending any data to the filter. - * - * @param filter the filter for which to allocate an instance. - * @param ctx a pointer into which the pointer to the newly-allocated context - * will be written. It must be freed with av_bsf_free() after the - * filtering is done. - * - * @return 0 on success, a negative AVERROR code on failure - *) -function av_bsf_alloc(filter: {const} PAVBitStreamFilter; ctx: PPAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Prepare the filter for use, after all the parameters and options have been - * set. - *) -function av_bsf_init(ctx: PAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Submit a packet for filtering. - * - * After sending each packet, the filter must be completely drained by calling - * av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or - * AVERROR_EOF. - * - * @param pkt the packet to filter. pkt must contain some payload (i.e data or - * side data must be present in pkt). The bitstream filter will take ownership of - * the packet and reset the contents of pkt. pkt is not touched if an error occurs. - * This parameter may be NULL, which signals the end of the stream (i.e. no more - * packets will be sent). That will cause the filter to output any packets it - * may have buffered internally. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_bsf_send_packet(ctx: PAVBSFContext; pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Retrieve a filtered packet. - * - * @param[out] pkt this struct will be filled with the contents of the filtered - * packet. It is owned by the caller and must be freed using - * av_packet_unref() when it is no longer needed. - * This parameter should be "clean" (i.e. freshly allocated - * with av_packet_alloc() or unreffed with av_packet_unref()) - * when this function is called. If this function returns - * successfully, the contents of pkt will be completely - * overwritten by the returned data. On failure, pkt is not - * touched. - * - * @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the - * filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there - * will be no further output from the filter. Another negative AVERROR value if - * an error occurs. - * - * @note one input packet may result in several output packets, so after sending - * a packet with av_bsf_send_packet(), this function needs to be called - * repeatedly until it stops returning 0. It is also possible for a filter to - * output fewer packets than were sent to it, so this function may return - * AVERROR(EAGAIN) immediately after a successful av_bsf_send_packet() call. - *) -function av_bsf_receive_packet(ctx: PAVBSFContext; pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Free a bitstream filter context and everything associated with it; write NULL - * into the supplied pointer. - *) -procedure av_bsf_free(ctx: PPAVBSFContext); - cdecl; external av__codec; - -(** - * Get the AVClass for AVBSFContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function av_bsf_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Allocate empty list of bitstream filters. - * The list must be later freed by av_bsf_list_free() - * or finalized by av_bsf_list_finalize(). - * - * @return Pointer to @ref AVBSFList on success, NULL in case of failure - *) -function av_bsf_list_alloc(): PAVBSFList; - cdecl; external av__codec; - -(** - * Free list of bitstream filters. - * - * @param lst Pointer to pointer returned by av_bsf_list_alloc() - *) -procedure av_bsf_list_free(lst: PPAVBSFList); - cdecl; external av__codec; - -(** - * Append bitstream filter to the list of bitstream filters. - * - * @param lst List to append to - * @param bsf Filter context to be appended - * - * @return >=0 on success, negative AVERROR in case of failure - *) -function av_bsf_list_append(lst: PAVBSFList; bsf: PAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Construct new bitstream filter context given it's name and options - * and append it to the list of bitstream filters. - * - * @param lst List to append to - * @param bsf_name Name of the bitstream filter - * @param options Options for the bitstream filter, can be set to NULL - * - * @return >=0 on success, negative AVERROR in case of failure - *) -function av_bsf_list_append2(lst: PAVBSFList; bsf_name: {const} Pcchar; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Finalize list of bitstream filters. - * - * This function will transform @ref AVBSFList to single @ref AVBSFContext, - * so the whole chain of bitstream filters can be treated as single filter - * freshly allocated by av_bsf_alloc(). - * If the call is successful, @ref AVBSFList structure is freed and lst - * will be set to NULL. In case of failure, caller is responsible for - * freeing the structure by av_bsf_list_free() - * - * @param lst Filter list structure to be transformed - * @param[out] bsf Pointer to be set to newly created @ref AVBSFContext structure - * representing the chain of bitstream filters - * - * @return >=0 on success, negative AVERROR in case of failure - *) -function av_bsf_list_finalize(lst: PPAVBSFList; bsf: PPAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Parse string describing list of bitstream filters and create single - * @ref AVBSFContext describing the whole chain of bitstream filters. - * Resulting @ref AVBSFContext can be treated as any other @ref AVBSFContext freshly - * allocated by av_bsf_alloc(). - * - * @param str String describing chain of bitstream filters in format - * `bsf1[=opt1=val1:opt2=val2][,bsf2]` - * @param[out] bsf Pointer to be set to newly created @ref AVBSFContext structure - * representing the chain of bitstream filters - * - * @return >=0 on success, negative AVERROR in case of failure - *) -function av_bsf_list_parse_str(str: {const} Pcchar; bsf: PPAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Get null/pass-through bitstream filter. - * - * @param[out] bsf Pointer to be set to new instance of pass-through bitstream filter - * - * @return - *) -function av_bsf_get_null_filter(bsf: PPAVBSFContext): cint; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbiage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: {const} PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. The "mutex" argument to the function points - * to a (void * ) where the lockmgr should store/get a pointer to a user - * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the - * value left by the last call for all other ops. If the lock manager is - * unable to perform the op then it should leave the mutex in the same - * state as when it was called and return a non-zero value. However, - * when called with AV_LOCK_DESTROY the mutex will always be assumed to - * have been successfully destroyed. If av_lockmgr_register succeeds - * it will return a non-negative value, if it fails it will return a - * negative value and destroy all mutex and unregister all callbacks. - * av_lockmgr_register is not thread-safe, it must be called from a - * single thread before any calls which make use of locking are used. - * - * @param cb User defined callback. av_lockmgr_register invokes calls - * to this callback and the previously registered callback. - * The callback will be used to create more than one mutex - * each of which must be backed by its own underlying locking - * mechanism (i.e. do not use a single static object to - * implement your lock manager). If cb is set to NULL the - * lockmgr will be unregistered. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Allocate a CPB properties structure and initialize its fields to default - * values. - * - * @param size if non-NULL, the size of the allocated struct will be written - * here. This is useful for embedding it in side data. - * - * @return the newly allocated struct or NULL on failure - *) -function av_cpb_properties_alloc(size: Psize_t): PAVCPBProperties; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-3.2/avformat.pas b/src/lib/ffmpeg-3.2/avformat.pas deleted file mode 100644 index bc2755b0..00000000 --- a/src/lib/ffmpeg-3.2/avformat.pas +++ /dev/null @@ -1,3207 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 56.4.101 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 2.4.* - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 57; - LIBAVFORMAT_MAX_VERSION_MINOR = 72; - LIBAVFORMAT_MAX_VERSION_RELEASE = 101; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 57; - LIBAVFORMAT_MIN_VERSION_MINOR = 56; - LIBAVFORMAT_MIN_VERSION_RELEASE = 100; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * @defgroup libavf libavformat - * I/O and Muxing/Demuxing Library - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * It is possible to configure lavf muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @section urls - * URL strings in libavformat are made of a scheme/protocol, a ':', and a - * scheme specific string. URLs without a scheme and ':' used for local files - * are supported but deprecated. "file:" should be used for local files. - * - * It is important that the scheme string is not taken from untrusted - * sources without checks. - * - * Note that some schemes/protocols are quite powerful, allowing access to - * both local and remote files, parts of them, concatenations of them, local - * audio and video devices and so on. - * - * @{ - * - * @defgroup lavf_decoding Demuxing - * @defgroup lavf_decoding Demuxing - * @ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "file:in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_send_packet() or avcodec_decode_subtitle2() if the - * caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_packet_unref() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @ - * - * @defgroup lavf_encoding Muxing - * @ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codecpar "stream codec parameters" information, such as the - * codec @ref AVCodecParameters.codec_type "type", @ref AVCodecParameters.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVStream.time_base "stream timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - It is advised to manually initialize only the relevant fields in - * AVCodecParameters, rather than using @ref avcodec_parameters_copy() during - * remuxing: there is no guarantee that the codec context values remain valid - * for both input and output format contexts. - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase - * requested by the caller. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @section lavf_io_dirlist Directory listing - * The directory listing API makes it possible to list files on remote servers. - * - * Some of possible use cases: - * - an "open file" dialog to choose files from a remote location, - * - a recursive media finder providing a player with an ability to play all - * files from a given directory. - * - * @subsection lavf_io_dirlist_open Opening a directory - * At first, a directory needs to be opened by calling avio_open_dir() - * supplied with a URL and, optionally, ::AVDictionary containing - * protocol-specific parameters. The function returns zero or positive - * integer and allocates AVIODirContext on success. - * - * @code - * AVIODirContext *ctx = NULL; - * if (avio_open_dir(&ctx, "smb://example.com/some_dir", NULL) < 0) { - * fprintf(stderr, "Cannot open directory.\n"); - * abort(); - * } - * @endcode - * - * This code tries to open a sample directory using smb protocol without - * any additional parameters. - * - * @subsection lavf_io_dirlist_read Reading entries - * Each directory's entry (i.e. file, another directory, anything else - * within ::AVIODirEntryType) is represented by AVIODirEntry. - * Reading consecutive entries from an opened AVIODirContext is done by - * repeatedly calling avio_read_dir() on it. Each call returns zero or - * positive integer if successful. Reading can be stopped right after the - * NULL entry has been read -- it means there are no entries left to be - * read. The following code reads all entries from a directory associated - * with ctx and prints their names to standard output. - * @code - * AVIODirEntry *entry = NULL; - * for (;;) { - * if (avio_read_dir(ctx, &entry) < 0) { - * fprintf(stderr, "Cannot list directory.\n"); - * abort(); - * } - * if (!entry) - * break; - * printf("%s\n", entry->name); - * avio_free_directory_entry(&entry); - * } - * @endcode - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - *) - -//type - -(* - * @defgroup metadata_api Public Metadata API - * @ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @ - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_LAVF_FRAC} -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; -{$ENDIF} - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - {const} mime_type: PAnsiChar; (**< mime_type, when known. *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MIME = 75; ///< score for file mime type - AVPROBE_SCORE_MAX = 100; ///< maximum score - - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) -{$IFDEF FF_API_LAVF_FMT_RAWPICTURE} - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. @deprecated Not used anymore *) -{$ENDIF} - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) - AVFMT_TS_NONSTRICT = $20000;(**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - AVINDEX_DISCARD_FRAME = $0002; (** - * Flag is used to indicate which frame should be discarded after decoding. - *) - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_FLUSH_PACKETS = $0200; ///< Flush the AVIOContext every packet. -(** - * When muxing, try to avoid writing any random/volatile data to the output. - * This includes any random IDs, real-time timestamps/dates, muxer version, etc. - * - * This flag is mainly intended for testing. - *) - AVFMT_FLAG_BITEXACT = $0400; - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. - AVFMT_FLAG_FAST_SEEK = $80000; ///< Enable fast, but inaccurate seeks for some formats - AVFMT_FLAG_SHORTEST = $100000; ///< Stop muxing when the shortest stream stops. - AVFMT_FLAG_AUTO_BSF = $200000; ///< Wait for packet data before writing a header, and add bitstream filters as requested by the muxer - - // used by AVStream - AVSTREAM_EVENT_FLAG_METADATA_UPDATED = $0001; ///< The call resulted in updated metadata. - MAX_STD_TIMEBASES = (30*12+30+3+6); - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The first (usually only) packet associated with it - * will be returned among the first few packets read from the file unless - * seeking takes place. It can also be accessed at any time in - * AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * The stream is sparse, and contains thumbnail images, often corresponding - * to chapter markers. Only ever used with AV_DISPOSITION_ATTACHED_PIC. - *) - AV_DISPOSITION_TIMED_THUMBNAILS = $0800; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - AVFMT_EVENT_FLAG_METADATA_UPDATED = 0001; ///< The call resulted in updated metadata. - - RAW_PACKET_BUFFER_SIZE = 2500000; - - AVFMT_AVOID_NEG_TS_AUTO = -1; ///< Enabled when required by target format - AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 1; ///< Shift timestamps so they are non negative - AVFMT_AVOID_NEG_TS_MAKE_ZERO = 2; ///< Shift timestamps so that they start at 0 - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - - PAVDeviceCapabilitiesQuery = ^TAVDeviceCapabilitiesQuery; - TAVDeviceCapabilitiesQuery = record - end; - - PFFFrac = ^TFFFrac; - TFFFrac = record - val: cint64; - num: cint64; - den: cint64; - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - data_codec: TAVCodecID; (**< default data codec *) - - (** - * Initialize format. May allocate data here, and set any AVFormatContext or - * AVStream parameters that need to be set before packets are sent. - * This method must not write output. - * - * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure - * - * Any allocations made here must be freed in deinit(). - *) - init: function(s: PAVFormatContext): cint; cdecl; - - (** - * Deinitialize format. If present, this is called whenever the muxer is being - * destroyed, regardless of whether or not the header has been written. - * - * If a trailer is being written, this is called after write_trailer(). - * - * This is called if init() fails as well. - *) - deinit: procedure(s: PAVFormatContext); - - (** - * Set up any necessary bitstream filtering and extract any extra data needed - * for the global header. - * Return 0 if more packets from this stream must be checked; 1 if not. - *) - check_bitstream: function(s: PAVFormatContext; pkt: {const} PAVPacket): cint; cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (** - * Comma-separated list of mime types. - * It is used check for matching mime types while probing. - * @see av_probe_input_format2 - *) - mime_type: {const} PAnsiChar; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) -{$IFDEF FF_API_LAVF_AVCTX} - (** - * @deprecated use the codecpar struct instead - *) - codec: PAVCodecContext; {deprecated} -{$ENDIF} - priv_data: pointer; - -{$IFDEF FF_API_LAVF_FRAC} - (** - * @deprecated this field is unused - *) - pts: TAVFrac; {attribute_deprecated} -{$ENDIF} - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the desired timebase. In - * avformat_write_header(), the muxer will overwrite this field - * with the timebase that will actually be used for the timestamps - * written into the file (which may or may not be related to the - * user-provided one, depending on the format). - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - * - * - demuxing: May be set by libavformat when creating the stream or in - * avformat_find_stream_info(). - * - muxing: May be set by the caller before avformat_write_header(). - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (** - * An array of side data that applies to the whole stream (i.e. the - * container does not allow it to change between packets). - * - * There may be no overlap between the side data in this array and side data - * in the packets. I.e. a given side data is either exported by the muxer - * (demuxing) / set by the caller (muxing) in this array, then it never - * appears in the packets, or the side data is exported / sent through - * the packets (always in the first packet where the value becomes known or - * changes), then it does not appear in this array. - * - * - demuxing: Set by libavformat when the stream is created. - * - muxing: May be set by the caller before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - * - * @see av_format_inject_global_side_data() - *) - side_data: PAVPacketSideData; - - (** - * The number of elements in the AVStream.side_data array. - *) - nb_side_data: cint; - - (** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. - *) - event_flags: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - (** - * Stream information used internally by av_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * If not 0, the number of samples that should be skipped from the start of - * the stream (the samples are removed from packets with pts==0, which also - * assumes negative timestamps do not happen). - * Intended for use with formats such as mp3 with ad-hoc gapless audio - * support. - *) - start_skip_samples: cint64; - - (** - * If not 0, the first audio sample that should be discarded from the stream. - * This is broken by design (needs global sample count), but can't be - * avoided for broken by design formats such as mp3 with ad-hoc gapless - * audio support. - *) - first_discard_sample: cint64; - - (** - * The sample after last sample that is intended to be discarded after - * first_discard_sample. Works on frame boundaries only. Used to prevent - * early EOF if the gapless info is broken (considered concatenated mp3s). - *) - last_discard_sample: cint64; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - (** - * Internal data to inject global side data - *) - inject_global_side_data: cint; - - (** - * String containing paris of key and values describing recommended encoder configuration. - * Paris are separated by ','. - * Keys are separated from values by '='. - *) - recommended_encoder_configuration: PAnsiChar; - - (** - * display aspect ratio (0 if unknown) - * - encoding: unused - * - decoding: Set by libavformat to calculate sample_aspect_ratio internally - *) - display_aspect_ratio: TAVRational; - - priv_pts: PFFFrac; - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: pointer; - - (* - * Codec parameters associated with this stream. Allocated and freed by - * libavformat in avformat_new_stream() and avformat_free_context() - * respectively. - * - * - demuxing: filled by libavformat on stream creation or in - * avformat_find_stream_info() - * - muxing: filled by the caller before avformat_write_header() - *) - codecpar: PAVCodecParameters; - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - TAVOpenCallback = function (s: PAVFormatContext; pb: PPAVIOContext; url: {const} PAnsiChar; flags: cint; - int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - * - * Fields can be accessed through AVOptions (av_opt* ), - * the name string used matches the associated command line parameter name and - * can be found in libavformat/options_table.h. - * The AVOption/command line parameter names differ in some cases from the C - * structure field names for historic reasons or brevity. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - (** - * Flags signalling stream properties. A combination of AVFMTCTX_*. - * Set by libavformat. - *) - ctx_flags: cint; - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint64; - - packet_size: cuint; - max_delay: cint; - - (** - * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. - * Set by the user before avformat_open_input() / avformat_write_header(). - *) - flags: cint; - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input(). - *) - probesize: cint64; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - * Can be set to 0 to let avformat choose using a heuristic. - *) - max_analyze_duration: cint64; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * - muxing: Set by the caller before avformat_write_header(). If set to - * either 0 or AV_NOPTS_VALUE, then the current wall-time will - * be used. - * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that - * the value may become known after some number of frames - * have been received. - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Allow non-standard and experimental extension - * @see AVCodecContext.strict_std_compliance - *) - strict_std_compliance: cint; - - (** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. - *) - event_flags: cint; - - (** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - *) - max_ts_probe: cint; - - (** - * Avoid negative timestamps during muxing. - * Any value of the AVFMT_AVOID_NEG_TS_* constants. - * Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) - * - muxing: Set by user - * - demuxing: unused - *) - avoid_negative_ts: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - use_wallclock_as_timestamps: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user via AVOptions (NO direct access) - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user via AVOptions (NO direct access) - *) - skip_initial_bytes: cint64; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user via AVOPtions (NO direct access) - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user via AVOptions (NO direct access) - * - decoding: unused - *) - flush_packets: cint; - - (** - * format probing score. - * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes - * the format. - * - encoding: unused - * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) - *) - probe_score: cint; - - (** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user through AVOPtions (NO direct access) - *) - format_probesize: cint; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - codec_whitelist: PAnsiChar; - - (** - * ',' separated list of allowed demuxers. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - format_whitelist: PAnsiChar; - - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_video_codec (NO direct access). - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). - *) - subtitle_codec: PAVCodec; - - (** - * Forced data codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user via av_format_set_data_codec (NO direct access). - *) - data_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user via AVOptions (NO direct access) - *) - output_ts_offset: cint64; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * Code outside libavformat should access this field using AVOptions - * (NO direct access). - * - muxing: Set by user. - * - demuxing: Set by user. - *) - dump_separator: Pcuint8; - - (** - * Forced Data codec_id. - * Demuxing: Set by user. - *) - data_codec_id: TAVCodecID; -{$IFDEF FF_API_OLD_OPEN_CALLBACKS} - (** - * Called to open further IO contexts when needed for demuxing. - * - * This can be set by the user application to perform security checks on - * the URLs before opening them. - * The function should behave like avio_open2(), AVFormatContext is provided - * as contextual information and to reach AVFormatContext.opaque. - * - * If NULL then some simple checks are used together with avio_open2(). - * - * Must not be accessed directly from outside avformat. - * @See av_format_set_open_cb() - * - * Demuxing: Set by user. - * - * @deprecated Use io_open and io_close. - *) - open_cb: function(s: PAVFormatContext; p: PPAVIOContext; url: {const} PAnsiChar; flags: cint; int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; {deprecated} -{$ENDIF} - - (** - * ',' separated list of allowed protocols. - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - protocol_whitelist: pchar; - - (* - * A callback for opening new IO streams. - * - * Whenever a muxer or a demuxer needs to open an IO stream (typically from - * avformat_open_input() for demuxers, but for certain formats can happen at - * other times as well), it will call this callback to obtain an IO context. - * - * @param s the format context - * @param pb on success, the newly opened IO context should be returned here - * @param url the url to open - * @param flags a combination of AVIO_FLAG_* - * @param options a dictionary of additional options, with the same - * semantics as in avio_open2() - * @return 0 on success, a negative AVERROR code on failure - * - * @note Certain muxers and demuxers do nesting, i.e. they open one or more - * additional internal format contexts. Thus the AVFormatContext pointer - * passed to this callback may be different from the one facing the caller. - * It will, however, have the same 'opaque' field. - *) - io_open: function(s: PAVFormatContext; pb: PPAVIOContext; url: {const} pchar; - flags: cint; options: PPAVDictionary): cint; cdecl; - - (** - * A callback for closing the streams opened with AVFormatContext.io_open(). - *) - io_close: procedure(s: PAVFormatContext; pb: PAVIOContext); cdecl; - - (** - * ',' separated list of disallowed protocols. - * - encoding: unused - * - decoding: set by user through AVOptions (NO direct access) - *) - protocol_blacklist: PAnsiChar; - end; (** TAVFormatContext **) - - TAVTimebaseSource = ( - AVFMT_TBCF_AUTO = -1, - AVFMT_TBCF_DECODER, - AVFMT_TBCF_DEMUXER, -{$IFDEF FF_API_R_FRAME_RATE} - AVFMT_TBCF_R_FRAMERATE -{$ENDIF} - ); - -function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_data_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_data_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; -procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; -procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; -function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; -procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; -{$IFDEF FF_API_OLD_OPEN_CALLBACKS} -function av_format_get_open_cb(s: {const} PAVFormatContext): TAVOpenCallback; {deprecated} - cdecl; external av__format; -procedure av_format_set_open_cb(s: PAVFormatContext; callback: TAVOpenCallback); {deprecated} - cdecl; external av__format; -{$ENDIF} - -(** - * This function will cause global side data to be injected in the next packet - * of each stream as well as after any subsequent seek. - *) -procedure av_format_inject_global_side_data(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; -function av_stream_get_parser(s: {const} PAVStream): PAVCodecParserContext; - cdecl; external av__format; -function av_stream_get_recommended_encoder_configuration({const} s: PAVStream): PAnsiChar; - cdecl; external av__format; -procedure av_stream_set_recommended_encoder_configuration(s: PAVStream; configuration: PAnsiChar); - cdecl; external av__format; - -(** - * Returns the pts of the last muxed packet + its duration - * - * the retuned value is undefined when used with a demuxer. - *) -function av_stream_get_end_pts(st: {const} PAVStream): cint64; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: {const} PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: {const} PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -(** - * Allocate new information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_stream_new_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: cint): Pcuint8; - cdecl; external av__format; - -(** - * Get side information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -{$IFDEF FF_API_NOCONST_GET_SIDE_DATA} -function av_stream_get_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; -{$ELSE} -function av_stream_get_side_data(stream: {const} PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; -{$ENDIF} - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param url the url of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer2(pb: PAVIOContext; var fmt: PAVInputFormat; - url: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Like av_probe_input_buffer2() but returns 0 on success - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - url: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param url URL of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; url: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -procedure av_program_add_stream_index(ac: PAVFormatContext; progid: cint; idx: cuint); - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until avformat_close_input(). Otherwise the packet - * is valid indefinitely. In both cases the packet must be freed with - * av_packet_unref when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Discard all internally buffered data. This can be useful when dealing with - * discontinuities in the byte stream. Generally works only with formats that - * can resync. This includes headerless formats like MPEG-TS/TS but should also - * work with NUT, Ogg and in a limited way AVI for example. - * - * The set of streams, the detected duration, stream parameters and codecs do - * not change when calling this function. If you want a complete reset, it's - * better to open a new AVFormatContext. - * - * This does not flush the AVIOContext (s->pb). If necessary, call - * avio_flush(s->pb) before calling this function. - * - * @param s media file handle - * @return >=0 on success, error code otherwise - *) -function avformat_flush(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - - AVSTREAM_INIT_IN_WRITE_HEADER = 0; ///< stream parameters initialized in avformat_write_header - AVSTREAM_INIT_IN_INIT_OUTPUT = 1; ///< stream parameters initialized in avformat_init_output - - AV_FRAME_FILENAME_FLAGS_MULTIPLE = 1; ///< Allow multiple %d - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec had not already been fully initialized in avformat_init, - * AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec had already been fully initialized in avformat_init, - * negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_init_output. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Allocate the stream private data and initialize the codec, but do not write the header. - * May optionally be used before avformat_write_header to initialize stream parameters - * before actually writing the header. - * If using this function, do not pass the same options to avformat_write_header. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec requires avformat_write_header to fully initialize, - * AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec has been fully initialized, - * negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_write_header. - *) -{av_warn_unused_result} -function avformat_init_output(s: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". - *
- * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") - * must be set to correct values in the stream's timebase (unless the - * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then - * they can be set to AV_NOPTS_VALUE). - * The dts for subsequent packets passed to this function must be strictly - * increasing when compared in their respective timebases (unless the - * output format is flagged with the AVFMT_TS_NONSTRICT, then they - * merely have to be nondecreasing). @ref AVPacket.duration - * "duration") should also be set if known. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * Using this function instead of av_write_frame() can give muxers advance - * knowledge of future packets, improving e.g. the behaviour of the mp4 - * muxer for VFR content in fragmenting mode. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". - *
- * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") - * must be set to correct values in the stream's timebase (unless the - * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then - * they can be set to AV_NOPTS_VALUE). - * The dts for subsequent packets in one stream must be strictly - * increasing (unless the output format is flagged with the - * AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). - * @ref AVPacket.duration "duration") should also be set if known. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write an uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write an uncoded frame to an output media file. - * - * If the muxer supports it, this function makes it possible to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: {const} PAVPacket; dump_payload: cint; st: {const} PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: {const} PAVPacket; dump_payload: cint; - st: {const} PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - url: {const} PAnsiChar); - cdecl; external av__format; - -(** - * Print detailed information about the input or output format, such as - * duration, bitrate, streams, container, programs, metadata, side data, - * codec and time base. - * - * @param ic the context to analyze - * @param index index of the stream to dump information about - * @param url the URL to print, such as source or destination file - * @param is_output Select whether the specified context is an input(0) or output(1) - *) -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: {const} PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @param flags AV_FRAME_FILENAME_FLAGS_* - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename2(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint; flags: cint): cint; - cdecl; external av__format; -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: {const} PAVOutputFormat; codec_id: TAVCodecID; - std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Apply a list of bitstream filters to a packet. - * - * @param codec AVCodecContext, usually from an AVStream - * @param pkt the packet to apply filters to. If, on success, the returned - * packet has size == 0 and side_data_elems == 0, it indicates that - * the packet should be dropped - * @param pkt the packet to apply filters to - * @param bsfc a NULL-terminated list of filters to apply - * @return >=0 on success; - * AVERROR code on failure - *) -{$IFDEF FF_API_OLD_BSF} -function av_apply_bitstream_filters(codec: PAVCodecContext; pkt: PAVPacket; - bsfc: PAVBitStreamFilterContext): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Transfer internal timing information from one stream to another. - * - * This function is useful when doing stream copy. - * - * @param ofmt target output format for ost - * @param ost output stream which needs timings copy and adjustments - * @param ist reference input stream to copy timings from - * @param copy_tb define from where the stream codec timebase needs to be imported - *) -function avformat_transfer_internal_stream_timing_info(ofmt: {const} PAVOutputFormat; - ost: PAVStream; ist: {const} PAVStream; - copy_tb: TAVTimebaseSource): cint; - cdecl; external av__format; - -(** - * Get the internal codec timebase from a stream. - * - * @param st input stream to extract the timebase from - *) -function av_stream_get_codec_timebase(st: {const} PAVStream): TAVRational; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-3.2/avio.pas b/src/lib/ffmpeg-3.2/avio.pas deleted file mode 100644 index 023429e0..00000000 --- a/src/lib/ffmpeg-3.2/avio.pas +++ /dev/null @@ -1,928 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 56.4.101 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - AVIO_SEEKABLE_NORMAL = 0001; (**< Seeking works like for a local file *) - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - - (** - * Directory entry types. - *) - TAVIODirEntryType = ( - AVIO_ENTRY_UNKNOWN, - AVIO_ENTRY_BLOCK_DEVICE, - AVIO_ENTRY_CHARACTER_DEVICE, - AVIO_ENTRY_DIRECTORY, - AVIO_ENTRY_NAMED_PIPE, - AVIO_ENTRY_SYMBOLIC_LINK, - AVIO_ENTRY_SOCKET, - AVIO_ENTRY_FILE, - AVIO_ENTRY_SERVER, - AVIO_ENTRY_SHARE, - AVIO_ENTRY_WORKGROUP - ); - - TAVIODataMarkerType = ( - (** - * Header data; this needs to be present for the stream to be decodeable. - *) - AVIO_DATA_MARKER_HEADER, - (** - * A point in the output bytestream where a decoder can start decoding - * (i.e. a keyframe). A demuxer/decoder given the data flagged with - * AVIO_DATA_MARKER_HEADER, followed by any AVIO_DATA_MARKER_SYNC_POINT, - * should give decodeable results. - *) - AVIO_DATA_MARKER_SYNC_POINT, - (** - * A point in the output bytestream where a demuxer can start parsing - * (for non self synchronizing bytestream formats). That is, any - * non-keyframe packet start point. - *) - AVIO_DATA_MARKER_BOUNDARY_POINT, - (** - * This is any, unlabelled data. It can either be a muxer not marking - * any positions at all, it can be an actual boundary/sync point - * that the muxer chooses not to mark, or a later part of a packet/fragment - * that is cut into multiple write callbacks due to limited IO buffer size. - *) - AVIO_DATA_MARKER_UNKNOWN, - (** - * Trailer data, which doesn't contain actual content, but only for - * finalizing the output file. - *) - AVIO_DATA_MARKER_TRAILER - ); - - (** - * Describes single entry of the directory. - * - * Only name and type fields are guaranteed be set. - * Rest of fields are protocol or/and platform dependent and might be unknown. - *) - PPAVIODirEntry = ^PAVIODirEntry; - PAVIODirEntry = ^TAVIODirEntry; - TAVIODirEntry = record - name: PAnsiChar; (**< Filename *) - type_: cint; (**< Type of the entry *) - utf8: cint; (**< Set to 1 when name is encoded with UTF-8, 0 otherwise. - Name can be encoded with UTF-8 even though 0 is set. *) - size: cint64; (**< File size in bytes, -1 if unknown. *) - modification_timestamp: cint64; (**< Time of last modification in microseconds since unix - epoch, -1 if unknown. *) - access_timestamp: cint64; (**< Time of last access in microseconds since unix epoch, - -1 if unknown. *) - status_change_timestamp: cint64; (**< Time of last status change in microseconds since unix - epoch, -1 if unknown. *) - user_id: cint64; (**< User ID of owner, -1 if unknown. *) - group_id: cint64; (**< Group ID of owner, -1 if unknown. *) - filemode: cint64; (**< Unix file mode, -1 if unknown. *) - end; - - PPAVIODirContext = ^PAVIODirContext; - PAVIODirContext = ^TAVIODirContext; - TAVIODirContext = record - url_context: pointer; - (** struct URLContext *url_context; *) - end; - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - - (* - * The following shows the relationship between buffer, buf_ptr, buf_end, buf_size, - * and pos, when reading and when writing (since AVIOContext is used for both): - * - ********************************************************************************** - * READING - ********************************************************************************** - * - * | buffer_size | - * |---------------------------------------| - * | | - * - * buffer buf_ptr buf_end - * +---------------+-----------------------+ - * |/ / / / / / / /|/ / / / / / /| | - * read buffer: |/ / consumed / | to be read /| | - * |/ / / / / / / /|/ / / / / / /| | - * +---------------+-----------------------+ - * - * pos - * +-------------------------------------------+-----------------+ - * input file: | | | - * +-------------------------------------------+-----------------+ - * - * - ********************************************************************************** - * WRITING - ********************************************************************************** - * - * | buffer_size | - * |-------------------------------| - * | | - * - * buffer buf_ptr buf_end - * +-------------------+-----------+ - * |/ / / / / / / / / /| | - * write buffer: | / to be flushed / | | - * |/ / / / / / / / / /| | - * +-------------------+-----------+ - * - * pos - * +--------------------------+-----------------------------------+ - * output file: | | | - * +--------------------------+-----------------------------------+ - * - *) - - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< true if the next seek should flush *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - - (** - * Original buffer size - * used internally after probing and ensure seekback to reset the buffer size - * This field is internal to libavformat and access from outside is not allowed. - *) - orig_buffer_size: cint; - - (** - * Threshold to favor readahead over seek. - * This is current internal only, do not use from outside. - *) - short_seek_threshold: cint; - - (** - * ',' separated list of allowed protocols. - *) - protocol_whitelist: {const} PAnsiChar; - - (** - * A callback that is used instead of write_packet. - *) - write_data_type: function(opaque: pointer; buf: Pcuint8; buf_size: cint; - type_: TAVIODataMarkerType; time: cint64): cint; cdecl; - (** - * If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT, - * but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly - * small chunks of data returned from the callback). - *) - ignore_boundary_point: cint; - - (** - * Internal, not meant to be used from outside of AVIOContext. - *) - current_type: TAVIODataMarkerType; - last_time: cint64; - end; {AVIOContext} - -(* unbuffered I/O *) - -(** - * Return the name of the protocol that will handle the passed URL. - * - * NULL is returned if no protocol could be found for the given URL. - * - * @return Name of the protocol or NULL. - *) -function avio_find_protocol_name(url: {const} PAnsiChar): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Move or rename a resource. - * - * @note url_src and url_dst should share the same protocol and authority. - * - * @param url_src url to resource to be moved - * @param url_dst new url to resource if the operation succeeded - * @return >=0 on success or negative on error. - *) -function avpriv_io_move(url_src: {const} PAnsiChar; url_dst: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Delete a resource. - * - * @param url resource to be deleted. - * @return >=0 on success or negative on error. - *) -function avpriv_io_delete(url: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Open directory for reading. - * - * @param s directory read context. Pointer to a NULL pointer must be passed. - * @param url directory to be listed. - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dictionary - * containing options that were not found. May be NULL. - * @return >=0 on success or negative on error. - *) -function avio_open_dir(s: PPAVIODirContext; url: {const} PAnsiChar; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Get next directory entry. - * - * Returned entry must be freed with avio_free_directory_entry(). In particular - * it may outlive AVIODirContext. - * - * @param s directory read context. - * @param[out] next next entry or NULL when no more entries. - * @return >=0 on success or negative on error. End of list is not considered an - * error. - *) -function avio_read_dir(s: PAVIODirContext; next: PPAVIODirEntry): cint; - cdecl; external av__format; - -(** - * Close directory. - * - * @note Entries created using avio_read_dir() are not deleted and must be - * freeded with avio_free_directory_entry(). - * - * @param s directory read context. - * @return >=0 on success or negative on error. - *) -function avio_close_dir(s: PPAVIODirContext): cint; - cdecl; external av__format; - -(** - * Free entry allocated by avio_read_dir(). - * - * @param entry entry to be freed. - *) -procedure avio_free_directory_entry(entry: PPAVIODirEntry); - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with av_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * It may be freed and replaced with a new buffer by libavformat. - * AVIOContext.buffer holds the buffer currently in use, - * which must be later freed with av_free(). - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16BE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16be(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Mark the written bytestream as a specific type. - * - * Zero-length ranges are omitted from the output. - * - * @param time the stream time the current bytestream pos corresponds to - * (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not - * applicable - * @param type the kind of data written starting at the current pos - *) -procedure avio_write_marker(s: PAVIOContext; time: cint64; type_: TAVIODataMarkerType); - cdecl; external av__format; - -const -(** - * ORing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Passing this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function avio_feof(s: PAVIOContext): cint; - cdecl; external av__format; -{$IFDEF FF_API_URL_FEOF} -(** - * @deprecated use avio_feof() - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; {attribute_deprecated} -{$ENDIF} - -(** @warning Writes up to 4 KiB per call *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data. - * - * For write streams, force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - * - * For read streams, discard all currently buffered data, and advance the - * reported file position to that of the underlying stream. This does not - * read new data, and does not perform any seeks. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -(* Avoid a warning. The header can not be included because it breaks c++. *) -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; - -(** - * Read contents of h into print buffer, up to max_size bytes, or up to EOF. - * - * @return 0 for success (max_size bytes read or EOF reached), negative error - * code otherwise - *) -function avio_read_to_bprint(h: PAVIOContext; pb: PAVBPrint; max_size: size_t): cint; - cdecl; external av__format; - -(** - * Accept and allocate a client context on a server context. - * @param s the server context - * @param c the client context, must be unallocated - * @return >= 0 on success or a negative value corresponding - * to an AVERROR on failure - *) -function avio_accept(s: PAVIOContext; c: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Perform one step of the protocol handshake to accept a new client. - * This function must be called on a client returned by avio_accept() before - * using it as a read/write context. - * It is separate from avio_accept() because it may block. - * A step of the handshake is defined by places where the application may - * decide to change the proceedings. - * For example, on a protocol with a request header and a reply header, each - * one can constitute a step because the application may use the parameters - * from the request to change parameters in the reply; or each individual - * chunk of the request can constitute a step. - * If the handshake is already finished, avio_handshake() does nothing and - * returns 0 immediately. - * - * @param c the client context to perform the handshake on - * @return 0 on a complete and successful handshake - * > 0 if the handshake progressed, but is not complete - * < 0 for an AVERROR code - *) -function avio_handshake(c: PAVIOContext): cint; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-3.2/avutil.pas b/src/lib/ffmpeg-3.2/avutil.pas deleted file mode 100644 index d01be95e..00000000 --- a/src/lib/ffmpeg-3.2/avutil.pas +++ /dev/null @@ -1,366 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 54.7.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 55; - LIBAVUTIL_MAX_VERSION_MINOR = 61; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 55; - LIBAVUTIL_MIN_VERSION_MINOR = 34; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return an informative version string. This usually is the actual release - * version number or a git commit description. This string has no fixed format - * and can change any time. It should never be parsed by code. - *) -function av_version_info(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG-4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -(** - * Return the fractional representation of the internal time base. - *) -function av_get_time_base_q: TAVRational; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -function AVERROR(e: integer): integer; -begin - AVERROR := AVERROR_SIGN * e; -end; - -end. diff --git a/src/lib/ffmpeg-3.2/ff_api-defines.inc b/src/lib/ffmpeg-3.2/ff_api-defines.inc deleted file mode 100644 index 3a3bcf0e..00000000 --- a/src/lib/ffmpeg-3.2/ff_api-defines.inc +++ /dev/null @@ -1,260 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_VIMA_DECODER} -{$define FF_API_VIMA_DECODER := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := FF_API_AUDIO_CONVERT} -{$endif} -{$ifndef FF_API_GETCHROMA} -{$define FF_API_GETCHROMA := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_SH4} -{$define FF_API_ARCH_SH4 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_SPARC} -{$define FF_API_ARCH_SPARC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_UNUSED_MEMBERS} -{$define FF_API_UNUSED_MEMBERS := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_IDCT_XVIDMMX} -{$define FF_API_IDCT_XVIDMMX := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_INPUT_PRESERVED} -{$define FF_API_INPUT_PRESERVED := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NORMALIZE_AQP} -{$define FF_API_NORMALIZE_AQP := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_GMC} -{$define FF_API_GMC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MV0} -{$define FF_API_MV0 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_CODEC_NAME} -{$define FF_API_CODEC_NAME := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AFD} -{$define FF_API_AFD := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VISMV} -(* XXX: don't forget to drop the -vismv documentation *) -{$define FF_API_VISMV := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AUDIOENC_DELAY} -{$define FF_API_AUDIOENC_DELAY := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VAAPI_CONTEXT} -{$define FF_API_VAAPI_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCTX_TIMEBASE} -{$define FF_API_AVCTX_TIMEBASE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MPV_OPT} -{$define FF_API_MPV_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STREAM_CODEC_TAG} -{$define FF_API_STREAM_CODEC_TAG := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_QUANT_BIAS} -{$define FF_API_QUANT_BIAS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_RC_STRATEGY} -{$define FF_API_RC_STRATEGY := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CODED_FRAME} -{$define FF_API_CODED_FRAME := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MOTION_EST} -{$define FF_API_MOTION_EST := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_WITHOUT_PREFIX} -{$define FF_API_WITHOUT_PREFIX := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_SIDEDATA_ONLY_PKT} -{$define FF_API_SIDEDATA_ONLY_PKT:= (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_VDPAU_PROFILE} -{$define FF_API_VDPAU_PROFILE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CONVERGENCE_DURATION} -{$define FF_API_CONVERGENCE_DURATION := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_AVPICTURE} -{$define FF_API_AVPICTURE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_AVPACKET_OLD_API} -{$define FF_API_AVPACKET_OLD_API := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_RTP_CALLBACK} -{$define FF_API_RTP_CALLBACK := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_VBV_DELAY} -{$define FF_API_VBV_DELAY := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CODER_TYPE} -{$define FF_API_CODER_TYPE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STAT_BITS} -{$define FF_API_STAT_BITS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_PRIVATE_OPT} -{$define FF_API_PRIVATE_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_ASS_TIMING} -{$define FF_API_ASS_TIMING := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_OLD_BSF} -{$define FF_API_OLD_BSF := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_COPY_CONTEXT} -{$define FF_API_COPY_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_GET_CONTEXT_DEFAULTS} -{$define FF_API_GET_CONTEXT_DEFAULTS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_NVENC_OLD_NAME} -{$define FF_API_NVENC_OLD_NAME := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DLOG} -{$define FF_API_DLOG := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_VAAPI} -{$define FF_API_VAAPI := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FRAME_QP} -{$define FF_API_FRAME_QP := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_PLUS1_MINUS1} -{$define FF_API_PLUS1_MINUS1 := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ERROR_FRAME} -{$define FF_API_ERROR_FRAME := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CRC_BIG_TABLE} -{$define FF_API_CRC_BIG_TABLE := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_PKT_PTS} -{$define FF_API_PKT_PTS := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_LAVF_BITEXACT} -{$define FF_API_LAVF_BITEXACT := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_FRAC} -{$define FF_API_LAVF_FRAC := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_CODEC_TB} -{$define FF_API_LAVF_CODEC_TB := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_URL_FEOF} -{$define FF_API_URL_FEOF := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_FMT_RAWPICTURE} -{$define FF_API_LAVF_FMT_RAWPICTURE := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_COMPUTE_PKT_FIELDS2} -{$define FF_API_COMPUTE_PKT_FIELDS2 := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_OLD_OPEN_CALLBACKS} -{$define FF_API_OLD_OPEN_CALLBACKS := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_AVCTX} -{$define FF_API_LAVF_AVCTX := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NOCONST_GET_SIDE_DATA} -{$define FF_API_NOCONST_GET_SIDE_DATA := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_HTTP_USER_AGENT} -{$define FF_API_HTTP_USER_AGENT := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} - -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** swscale FF_API defines *) -{$ifndef FF_API_SWS_VECTOR} -{$define FF_API_SWS_VECTOR := (LIBSWSCALE_VERSION_MAJOR < 6)} -{$endif} - -{$ENDIF PASDOC} diff --git a/src/lib/ffmpeg-3.2/libavcodec/audioconvert.pas b/src/lib/ffmpeg-3.2/libavcodec/audioconvert.pas deleted file mode 100644 index cf6c96bb..00000000 --- a/src/lib/ffmpeg-3.2/libavcodec/audioconvert.pas +++ /dev/null @@ -1,294 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_HEXADECAGONAL = (AV_CH_LAYOUT_OCTAGONAL or AV_CH_WIDE_LEFT or AV_CH_WIDE_RIGHT or AV_CH_TOP_BACK_LEFT or - AV_CH_TOP_BACK_RIGHT or AV_CH_TOP_BACK_CENTER or AV_CH_TOP_FRONT_CENTER or - AV_CH_TOP_FRONT_LEFT or AV_CH_TOP_FRONT_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - TAVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} diff --git a/src/lib/ffmpeg-3.2/libavutil/buffer.pas b/src/lib/ffmpeg-3.2/libavutil/buffer.pas deleted file mode 100644 index 0cf47b05..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/buffer.pas +++ /dev/null @@ -1,309 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 54.7.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - TAlloc2 = function(opaque: pointer; size: cint): PAVBufferRef; - TPoolFree = procedure(opaque: pointer); - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Same as av_buffer_alloc(), except the returned buffer will be initialized - * to zero. - *) -function av_buffer_allocz(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferPool; - cdecl; external av__util; - -(** - * Allocate and initialize a buffer pool with a more complex allocator. - * - * @param size size of each buffer in this pool - * @param opaque arbitrary user data used by the allocator - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. - * @param pool_free a function that will be called immediately before the pool - * is freed. I.e. after av_buffer_pool_can_uninit() is called - * by the pool and all the frames are returned to the pool and - * freed. It is intended to uninitialize the user opaque data. - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init2(size: cint; opaque: pointer; - alloc: TAlloc2; - pool_free: TPoolFree): PAVBufferPool; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.2/libavutil/cpu.pas b/src/lib/ffmpeg-3.2/libavutil/cpu.pas deleted file mode 100644 index 1e1e6777..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/cpu.pas +++ /dev/null @@ -1,124 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 54.7.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AESNI = $80000; ///< Advanced Encryption Standard functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_AVXSLOW = $8000000; ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer) - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - AV_CPU_FLAG_VSX = $0002; ///< ISA 2.06 - AV_CPU_FLAG_POWER8 = $0004; ///< ISA 2.07 - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - AV_CPU_FLAG_ARMV8 = (1 << 6); - AV_CPU_FLAG_VFP_VM = (1 << 7); ///< VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations - AV_CPU_FLAG_SETEND = (1 <<16); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in an application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - * - * @warning this function is not thread safe. - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.2/libavutil/dict.pas b/src/lib/ffmpeg-3.2/libavutil/dict.pas deleted file mode 100644 index ef54610c..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/dict.pas +++ /dev/null @@ -1,168 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 54.7.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - AV_DICT_MULTIKEY = 64; (**< Allow to store several equal keys in the dictionary *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get({const} m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, - * these arguments will be freed on error. - * - * Warning: Adding a new entry to a dictionary invalidates all existing entries - * previously returned with av_dict_get. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) - * @param value entry value to add to *pm (will be av_strduped or added as a new key depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Convenience wrapper for av_dict_set that converts the value to a string - * and stores it. - * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. - *) -function av_dict_set_int(var pm: PAVDictionary; {const} key: PAnsiChar; - value: cint64; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - * @return 0 on success, negative AVERROR code on failure. If dst was allocated - * by this function, callers should free the associated memory. - *) -function av_dict_copy(var dst: PAVDictionary; {const} src: PAVDictionary; flags: cint): cint; - cdecl; external av__util; - -(** - * Get dictionary entries as a string. - * - * Create a string containing dictionary's entries. - * Such string may be passed back to av_dict_parse_string(). - * @note String is escaped with backslashes ('\'). - * - * @param[in] m dictionary - * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. - * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other - * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. - *) -function av_dict_get_string({const} m: PAVDictionary; buffer: PPAnsiChar; - {const} key_val_sep: AnsiChar; {const} pairs_sep: AnsiChar): cint; - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.2/libavutil/error.pas b/src/lib/ffmpeg-3.2/libavutil/error.pas deleted file mode 100644 index f972aa7d..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/error.pas +++ /dev/null @@ -1,169 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; - EAGAIN = ESysEAGAIN; -{$ELSE} - ENOENT = 2; - EIO = 5; - EAGAIN = 11; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) -function AVERROR(e: integer): integer; - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) - AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) -(* HTTP & RTSP errors *) - AVERROR_HTTP_BAD_REQUEST = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('0') shl 24)); - AVERROR_HTTP_UNAUTHORIZED = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('1') shl 24)); - AVERROR_HTTP_FORBIDDEN = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('3') shl 24)); - AVERROR_HTTP_NOT_FOUND = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('4') shl 24)); - AVERROR_HTTP_OTHER_4XX = -(ord($F8) or (ord('4') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - AVERROR_HTTP_SERVER_ERROR = -(ord($F8) or (ord('5') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-3.2/libavutil/frame.pas b/src/lib/ffmpeg-3.2/libavutil/frame.pas deleted file mode 100644 index 8cd8a14e..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/frame.pas +++ /dev/null @@ -1,827 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 54.7.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - (** from the definitions of TAVFrame *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - AV_FRAME_FLAG_CORRUPT = (1 << 0); - (** - * A flag to mark the frames which need to be decoded, but shouldn't be output. - *) - AV_FRAME_FLAG_DISCARD = (1 << 2); - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type -(* is already in pixfmt.pas - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); -*) - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO, - (** - * ReplayGain information in the form of the AVReplayGain struct. - *) - AV_FRAME_DATA_REPLAYGAIN, - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the frame for correct - * presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_FRAME_DATA_DISPLAYMATRIX, - (** - * Active Format Description data consisting of a single byte as specified - * in ETSI TS 101 154 using AVActiveFormatDescription enum. - *) - AV_FRAME_DATA_AFD, - (** - * Motion vectors exported by some codecs (on demand through the export_mvs - * flag set in the libavcodec AVCodecContext flags2 option). - * The data is the AVMotionVector struct defined in - * libavutil/motion_vector.h. - *) - AV_FRAME_DATA_MOTION_VECTORS, - (** - * Recommmends skipping the specified number of samples. This is exported - * only if the "skip_manual" AVOption is set in libavcodec. - * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_FRAME_DATA_SKIP_SAMPLES, - (** - * This side data must be associated with an audio frame and corresponds to - * enum AVAudioServiceType defined in avcodec.h. - *) - AV_FRAME_DATA_AUDIO_SERVICE_TYPE, - (** - * Mastering display metadata associated with a video frame. The payload is - * an AVMasteringDisplayMetadata type and contains information about the - * mastering display color volume. - *) - AV_FRAME_DATA_MASTERING_DISPLAY_METADATA, - (** - * The GOP timecode in 25 bit timecode format. Data format is 64-bit integer. - * This is set on the first frame of a GOP that has a temporal reference of 0. - *) - AV_FRAME_DATA_GOP_TIMECODE - ); - - TAVActiveFormatDescription = ( - AV_AFD_SAME = 8, - AV_AFD_4_3 = 9, - AV_AFD_16_9 = 10, - AV_AFD_14_9 = 11, - AV_AFD_4_3_SP_14_9 = 13, - AV_AFD_16_9_SP_14_9 = 14, - AV_AFD_SP_4_3 = 15 - ); {TAVActiveFormatDescription} - - PAVFrameSideData = ^TAVFrameSideData; -(** - * Structure to hold side data for an AVFrame. - * - * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - *) - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - buf: PAVBufferRef; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - * - * Fields can be accessed through AVOptions, the name string used, matches the - * C structure field name for fields accessible through AVOptions. The AVClass - * for AVFrame can be obtained from avcodec_get_frame_class() - *) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - * - * NOTE: Except for hwaccel formats, pointers not needed by the format - * MUST be set to NULL. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used in order to access all channels. - *) - extended_data: ^pbyte; - - (** - * width and height of the video frame - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - *) - key_frame: cint; - - (** - * Picture type of the frame - *) - pict_type: TAVPictureType; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - *) - pts: cint64; - -{$IFDEF FF_API_PKT_PTS} - (** - * PTS copied from the AVPacket that was decoded to produce this frame. - *) - pkt_pts: cint64; {deprecated} -{$ENDIF} - - (** - * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) - * This is also the Presentation time of this AVFrame calculated from - * only AVPacket.dts values without pts values. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - *) - coded_picture_number: cint; - - (** - * picture number in display order - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - *) - quality: cint; - - (** - * for some private data of the user - *) - opaque: pointer; - -{$IFDEF FF_API_ERROR_FRAME} - (** - * @deprecated unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - *) - palette_has_changed: cint; - - (** - * reordered opaque 64 bits (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - *) - reordered_opaque: cint64; - - (** - * Sample rate of the audio data. - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. This array - * must be filled contiguously -- if buf[i] is non-NULL then buf[j] must - * also be non-NULL for all j < i. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * @ingroup lavu_frame - * Flags describing additional frame properties. - * - * @ - *) - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * MPEG vs JPEG YUV range. - * It must be accessed using av_frame_get_color_range() and - * av_frame_set_color_range(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - color_primaries: TAVColorPrimaries; - - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * It must be accessed using av_frame_get_colorspace() and - * av_frame_set_colorspace(). - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - chroma_location: TAVChromaLocation; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavutil should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavutil should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavutil should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavutil should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavutil should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavutil should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - -{$IFDEF FF_API_FRAME_QP} - (** - * QP table - * Not to be accessed directly from outside libavutil - *) - qscale_table: PByte; {deprecated} - (** - * QP store stride - * Not to be accessed directly from outside libavutil - *) - qstride: cint; {deprecated} - - qscale_type: cint; {deprecated} - (** - * Not to be accessed directly from outside libavutil - *) - qp_table_buf: PAVBufferRef; {deprecated} -{$ENDIF} - (** - * For hwaccel-format frames, this should be a reference to the - * AVHWFramesContext describing the frame. - *) - hw_frames_ctx: PAVBufferRef; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavutil. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -{$IFDEF FF_API_FRAME_QP} -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -{$ENDIF} -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__util; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @warning: dst MUST have been either unreferenced with av_frame_unref(dst), - * or newly allocated with av_frame_alloc() before calling this - * function, or undefined behavior will occur. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__util; - -(** - * Move everything contained in src to dst and reset src. - * - * @warning: dst is not unreferenced, but directly overwritten without reading - * or deallocating its contents. Call av_frame_unref(dst) manually - * before calling this function to ensure that no memory is leaked. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @warning: if frame already has been allocated, calling this function will - * leak memory. In addition, undefined behavior can occur in certain - * cases. - * - * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - -(** - * If side data of the supplied type exists in the frame, free it and remove it - * from the frame. - *) -procedure av_frame_remove_side_data(frame: PAVFrame; type_: TAVFrameSideDataType); - cdecl; external av__codec; - -(** - * @return a string identifying the side data type - *) -function av_frame_side_data_name(type_: TAVFrameSideDataType): PAnsiChar; - cdecl; external av__codec; - diff --git a/src/lib/ffmpeg-3.2/libavutil/log.pas b/src/lib/ffmpeg-3.2/libavutil/log.pas deleted file mode 100644 index c184047f..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/log.pas +++ /dev/null @@ -1,545 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * log - *) - -type - (* from opt.h *) - TAVOptionType = ( - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_DICT, - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_BOOL = $424F4F4C, ///< MKBETAG('B','O','O','L'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_PIXEL_FMlT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is intended for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, - AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, - AV_CLASS_CATEGORY_DEVICE_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_INPUT, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(* -#define AV_IS_INPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) - -#define AV_IS_OUTPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -*) - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - (** - * Value range. - * For string ranges this represents the min/max length. - * For dimensions this represents the min/max pixel count or width/height in multi-component case. - *) - value_min, value_max: cdouble; - (** - * Value's component range. - * For string this represents the unicode range for chars, 0-127 limits to ASCII. - *) - component_min, component_max: cdouble; - (** - * Range flag. - * If set to 1 the struct encodes a range, if set to 0 a single value. - *) - is_range: cint; - end; - - (** - * List of AVOptionRange structs. - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - (** - * Array of option ranges. - * - * Most of option types use just one component. - * Following describes multi-component option types: - * - * AV_OPT_TYPE_IMAGE_SIZE: - * component index 0: range of pixel count (width * height). - * component index 1: range of width. - * component index 2: range of height. - * - * @note To obtain multi-component version of this structure, user must - * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or - * av_opt_query_ranges_default function. - * - * Multi-component range can be read as in following example: - * - * @code - * int range_index, component_index; - * AVOptionRanges *ranges; - * AVOptionRange *range[3]; //may require more than 3 in the future. - * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); - * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { - * for (component_index = 0; component_index < ranges->nb_components; component_index++) - * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; - * //do something with range here. - * } - * av_opt_freep_ranges(&ranges); - * @endcode - *) - range: PPAVOptionRange; - (** - * Number of ranges per component. - *) - nb_ranges: cint; - (** - * Number of componentes. - *) - nb_components: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - -(** - * Extremely verbose debugging, useful for libav* development. - *) - AV_LOG_TRACE = 56; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Sets additional colors for extended debugging sessions. - * @code - av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); - @endcode - * Requires 256color terminal support. Uses outside debugging is not - * recommended. - *) -{** to be translated if needed - AV_LOG_C(x) (x << 8) -**} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct or NULL if general log. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formatted line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formatted line; - * may be NULL if line_size is 0 - * @param line_size size of the buffer; at most line_size-1 characters will - * be written to the buffer, plus one null terminator - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - * @return Returns a negative value if an error occurred, otherwise returns - * the number of characters that would have been written for a - * sufficiently large buffer, not including the terminating null - * character. If the return value is not less than line_size, it means - * that the log message was truncated to fit the buffer. - *) -function av_log_format_line2(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint): cint; - cdecl; external av__util; - -{$IFDEF FF_API_DLOG} -(** - * av_dlog macros - * @deprecated unused - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) -{$ENDIF} //FF_API_DLOG - -const -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) - AV_LOG_SKIP_REPEATED = 1; - -(** - * Include the log severity in messages originating from codecs. - * - * Results in messages such as: - * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts - *) - AV_LOG_PRINT_LEVEL = 2; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; - -function av_log_get_flags: cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.2/libavutil/mathematics.pas b/src/lib/ffmpeg-3.2/libavutil/mathematics.pas deleted file mode 100644 index f6df1368..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/mathematics.pas +++ /dev/null @@ -1,222 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * @addtogroup lavu_math - * Mathematical utilities for working with timestamp and time base. - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - (** - * Rounding methods. - *) - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - (** - * Flag telling rescaling functions to pass `INT64_MIN`/`MAX` through - * unchanged, avoiding special cases for #AV_NOPTS_VALUE. - * - * Unlike other values of the enumeration AVRounding, this value is a - * bitmask that must be used in conjunction with another value of the - * enumeration through a bitwise OR, in order to set behavior for normal - * cases. - * - * @code{.c} - * av_rescale_rnd(3, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); - * // Rescaling 3: - * // Calculating 3 * 1 / 2 - * // 3 / 2 is rounded up to 2 - * // => 2 - * - * av_rescale_rnd(AV_NOPTS_VALUE, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); - * // Rescaling AV_NOPTS_VALUE: - * // AV_NOPTS_VALUE == INT64_MIN - * // AV_NOPTS_VALUE is passed through - * // => AV_NOPTS_VALUE - * @endcode - *) - AV_ROUND_PASS_MINMAX = 8192 - ); - -(** - * Compute the greatest common divisor of two integer operands. - * - * @param a,b Operands - * @return GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; - * if a == 0 and b == 0, returns 0. - *) -function av_gcd(a, b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * - * The operation is mathematically equivalent to `a * b / c`, but writing that - * directly can overflow. - * - * This function is equivalent to av_rescale_rnd() with #AV_ROUND_NEAR_INF. - * - * @see av_rescale_rnd(), av_rescale_q(), av_rescale_q_rnd() - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * - * The operation is mathematically equivalent to `a * b / c`, but writing that - * directly can overflow, and does not support different rounding methods. - * - * @see av_rescale(), av_rescale_q(), av_rescale_q_rnd() - *) -function av_rescale_rnd (a, b, c: cint64; rnd: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - * - * The operation is mathematically equivalent to `a * bq / cq`. - * - * This function is equivalent to av_rescale_q_rnd() with #AV_ROUND_NEAR_INF. - * - * @see av_rescale(), av_rescale_rnd(), av_rescale_q_rnd() - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * The operation is mathematically equivalent to `a * bq / cq`. - * - * @see av_rescale(), av_rescale_rnd(), av_rescale_q() - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - rnd: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare two timestamps each in its own time base. - * - * @return One of the following values: - * - -1 if `ts_a` is before `ts_b` - * - 1 if `ts_a` is after `ts_b` - * - 0 if they represent the same position - * - * @warning - * The result of the function is undefined if one of the timestamps is outside - * the `int64_t` range when represented in the other's timebase. - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare the remainders of two integer operands divided by a common divisor. - * - * In other words, compare the least significant `log2(mod)` bits of integers - * `a` and `b`. - * - * @code{.c} - * av_compare_mod(0x11, 0x02, 0x10) < 0 // since 0x11 % 0x10 (0x1) < 0x02 % 0x10 (0x2) - * av_compare_mod(0x11, 0x02, 0x20) > 0 // since 0x11 % 0x20 (0x11) > 0x02 % 0x20 (0x02) - * @endcode - * - * @param a,b Operands - * @param mod Divisor; must be a power of 2 - * @return - * - a negative value if `a % mod < b % mod` - * - a positive value if `a % mod > b % mod` - * - zero if `a % mod == b % mod` - *) -function av_compare_mod(a, b, modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * This function is designed to be called per audio packet to scale the input - * timestamp to a different time base. Compared to a simple av_rescale_q() - * call, this function is robust against possible inconsistent frame durations. - * - * The `last` parameter is a state variable that must be preserved for all - * subsequent calls for the same stream. For the first call, `*last` should be - * initialized to #AV_NOPTS_VALUE. - * - * @param[in] in_tb Input time base - * @param[in] in_ts Input timestamp - * @param[in] fs_tb Duration time base; typically this is finer-grained - * (greater) than `in_tb` and `out_tb` - * @param[in] duration Duration till the next call to this function (i.e. - * duration of the current packet/frame) - * @param[in,out] last Pointer to a timestamp expressed in terms of - * `fs_tb`, acting as a state variable - * @param[in] out_tb Output timebase - * @return Timestamp expressed in terms of `out_tb` - * - * @note In the context of this function, "duration" is in term of samples, not - * seconds. - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function guarantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.2/libavutil/mem.pas b/src/lib/ffmpeg-3.2/libavutil/mem.pas deleted file mode 100644 index 6dfd7444..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/mem.pas +++ /dev/null @@ -1,578 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* Memory handling functions *) - -(** - * @defgroup lavu_mem_funcs Heap Management - * Functions responsible for allocating, freeing, and copying memory. - * - * All memory allocation functions have a built-in upper limit of `INT_MAX` - * bytes. This may be changed with av_max_alloc(), although exercise extreme - * caution when doing so. - * - * @{ - *) - -(** - * Allocate a memory block with alignment suitable for all memory accesses - * (including vectors if available on the CPU). - * - * @param size Size in bytes for the memory block to be allocated - * @return Pointer to the allocated block, or `NULL` if the block cannot - * be allocated - * @see av_mallocz() - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a memory block with alignment suitable for all memory accesses - * (including vectors if available on the CPU) and zero all the bytes of the - * block. - * - * @param size Size in bytes for the memory block to be allocated - * @return Pointer to the allocated block, or `NULL` if it cannot be allocated - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a memory block for an array with av_malloc(). - * - * The allocated memory will have size `size * nmemb` bytes. - * - * @param nmemb Number of element - * @param size Size of a single element - * @return Pointer to the allocated block, or `NULL` if the block cannot - * be allocated - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate a memory block for an array with av_mallocz(). - * - * The allocated memory will have size `size * nmemb` bytes. - * - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, or `NULL` if the block cannot - * be allocated - * - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate, reallocate, or free a block of memory. - * - * If `ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is - * zero, free the memory block pointed to by `ptr`. Otherwise, expand or - * shrink that block of memory according to `size`. - * - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or `NULL` - * @param size Size in bytes of the memory block to be allocated or - * reallocated - * - * @return Pointer to a newly-reallocated block or `NULL` if the block - * cannot be reallocated or the function is used to free the memory block - * - * @warning Unlike av_malloc(), the returned pointer is not guaranteed to be - * correctly aligned. - * @see av_fast_realloc() - * @see av_reallocp() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate, reallocate, or free a block of memory through a pointer to a - * pointer. - * - * If `*ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is - * zero, free the memory block pointed to by `*ptr`. Otherwise, expand or - * shrink that block of memory according to `size`. - * - * @param[in,out] ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or a pointer to `NULL`. The pointer - * is updated on success, or freed on failure. - * @param[in] size Size in bytes for the memory block to be allocated or - * reallocated - * - * @return Zero on success, an AVERROR error code on failure - * - * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be - * correctly aligned. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate, reallocate, or free a block of memory. - * - * This function does the same thing as av_realloc(), except: - * - It takes two size arguments and allocates `nelem * elsize` bytes, - * after checking the result of the multiplication for integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic - * @code{.c} - * buf = realloc(buf); - * if (!buf) - * return -1; - * @endcode - * pattern. - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate, reallocate, or free an array. - * - * If `ptr` is `NULL` and `nmemb` > 0, allocate a new block. If - * `nmemb` is zero, free the memory block pointed to by `ptr`. - * - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or `NULL` - * @param nmemb Number of elements in the array - * @param size Size of the single element of the array - * - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block - * - * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be - * correctly aligned. - * @see av_reallocp_array() - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate, reallocate, or free an array through a pointer to a pointer. - * - * If `*ptr` is `NULL` and `nmemb` > 0, allocate a new block. If `nmemb` is - * zero, free the memory block pointed to by `*ptr`. - * - * @param[in,out] ptr Pointer to a pointer to a memory block already - * allocated with av_realloc(), or a pointer to `NULL`. - * The pointer is updated on success, or freed on failure. - * @param[in] nmemb Number of elements - * @param[in] size Size of the single element - * - * @return Zero on success, an AVERROR error code on failure - * - * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be - * correctly aligned. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Reallocate the given buffer if it is not large enough, otherwise do nothing. - * - * If the given buffer is `NULL`, then a new uninitialized buffer is allocated. - * - * If the given buffer is not large enough, and reallocation fails, `NULL` is - * returned and `*size` is set to 0, but the original buffer is not changed or - * freed. - * - * A typical use pattern follows: - * - * @code{.c} - * uint8_t *buf = ...; - * uint8_t *new_buf = av_fast_realloc(buf, ¤t_size, size_needed); - * if (!new_buf) { - * // Allocation failed; clean up original buffer - * av_freep(&buf); - * return AVERROR(ENOMEM); - * } - * @endcode - * - * @param[in,out] ptr Already allocated buffer, or `NULL` - * @param[in,out] size Pointer to current size of buffer `ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `ptr` - * @return `ptr` if the buffer is large enough, a pointer to newly reallocated - * buffer if the buffer was not large enough, or `NULL` in case of - * error - * @see av_realloc() - * @see av_fast_malloc() - *) -function av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc(), the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special handling to - * avoid memleaks is necessary. - * - * `*ptr` is allowed to be `NULL`, in which case allocation always happens if - * `size_needed` is greater than 0. - * - * @code{.c} - * uint8_t *buf = ...; - * av_fast_malloc(&buf, ¤t_size, size_needed); - * if (!buf) { - * // Allocation failed; buf already freed - * return AVERROR(ENOMEM); - * } - * @endcode - * - * @param[in,out] ptr Pointer to pointer to an already allocated buffer. - * `*ptr` will be overwritten with pointer to new - * buffer on success or `NULL` on failure - * @param[in,out] size Pointer to current size of buffer `*ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `*ptr` - * @see av_realloc() - * @see av_fast_mallocz() - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate and clear a buffer, reusing the given one if large enough. - * - * Like av_fast_malloc(), but all newly allocated space is initially cleared. - * Reused buffer is not cleared. - * - * `*ptr` is allowed to be `NULL`, in which case allocation always happens if - * `size_needed` is greater than 0. - * - * @param[in,out] ptr Pointer to pointer to an already allocated buffer. - * `*ptr` will be overwritten with pointer to new - * buffer on success or `NULL` on failure - * @param[in,out] size Pointer to current size of buffer `*ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `*ptr` - * @see av_fast_malloc() - *) -procedure av_fast_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with a function of av_malloc() - * or av_realloc() family. - * - * @param ptr Pointer to the memory block which should be freed. - * - * @note `ptr = NULL` is explicitly allowed. - * @note It is recommended that you use av_freep() instead, to prevent leaving - * behind dangling pointers. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with a function of av_malloc() - * or av_realloc() family, and set the pointer pointing to it to `NULL`. - * - * @code{.c} - * uint8_t *buf = av_malloc(16); - * av_free(buf); - * // buf now contains a dangling pointer to freed memory, and accidental - * // dereference of buf will result in a use-after-free, which may be a - * // security risk. - * - * uint8_t *buf = av_malloc(16); - * av_freep(&buf); - * // buf is now NULL, and accidental dereference will only result in a - * // NULL-pointer dereference. - * @endcode - * - * @param ptr Pointer to the pointer to the memory block which should be freed - * @note `*ptr = NULL` is safe and leads to no action. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Duplicate a string. - * - * @param s String to be duplicated - * @return Pointer to a newly-allocated string containing a - * copy of `s` or `NULL` if the string cannot be allocated - * @see av_strndup() - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a substring of a string. - * - * @param s String to be duplicated - * @param len Maximum length of the resulting string (not counting the - * terminating byte) - * @return Pointer to a newly-allocated string containing a - * substring of `s` or `NULL` if the string cannot be allocated - *) -function av_strndup({const} s: PAnsiChar; len: size_t): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a buffer with av_malloc(). - * - * @param p Buffer to be duplicated - * @param size Size in bytes of the buffer copied - * @return Pointer to a newly allocated buffer containing a - * copy of `p` or `NULL` if the buffer cannot be allocated - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Overlapping memcpy() implementation. - * - * @param dst Destination buffer - * @param back Number of bytes back to start copying (i.e. the initial size of - * the overlapping window); must be > 0 - * @param cnt Number of bytes to copy; must be >= 0 - * - * @note `cnt > back` is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of `back`. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * @} - *) - -(** - * @defgroup lavu_mem_dynarray Dynamic Array - * - * Utilities to make an array grow when needed. - * - * Sometimes, the programmer would want to have an array that can grow when - * needed. The libavutil dynamic array utilities fill that need. - * - * libavutil supports two systems of appending elements onto a dynamically - * allocated array, the first one storing the pointer to the value in the - * array, and the second storing the value directly. In both systems, the - * caller is responsible for maintaining a variable containing the length of - * the array, as well as freeing of the array after use. - * - * The first system stores pointers to values in a block of dynamically - * allocated memory. Since only pointers are stored, the function does not need - * to know the size of the type. Both av_dynarray_add() and - * av_dynarray_add_nofree() implement this system. - * - * @code - * type **array = NULL; //< an array of pointers to values - * int nb = 0; //< a variable to keep track of the length of the array - * - * type to_be_added = ...; - * type to_be_added2 = ...; - * - * av_dynarray_add(&array, &nb, &to_be_added); - * if (nb == 0) - * return AVERROR(ENOMEM); - * - * av_dynarray_add(&array, &nb, &to_be_added2); - * if (nb == 0) - * return AVERROR(ENOMEM); - * - * // Now: - * // nb == 2 - * // &to_be_added == array[0] - * // &to_be_added2 == array[1] - * - * av_freep(&array); - * @endcode - * - * The second system stores the value directly in a block of memory. As a - * result, the function has to know the size of the type. av_dynarray2_add() - * implements this mechanism. - * - * @code - * type *array = NULL; //< an array of values - * int nb = 0; //< a variable to keep track of the length of the array - * - * type to_be_added = ...; - * type to_be_added2 = ...; - * - * type *addr = av_dynarray2_add((void ** )&array, &nb, sizeof(*array), NULL); - * if (!addr) - * return AVERROR(ENOMEM); - * memcpy(addr, &to_be_added, sizeof(to_be_added)); - * - * // Shortcut of the above. - * type *addr = av_dynarray2_add((void ** )&array, &nb, sizeof(*array), - * (const void * )&to_be_added2); - * if (!addr) - * return AVERROR(ENOMEM); - * - * // Now: - * // nb == 2 - * // to_be_added == array[0] - * // to_be_added2 == array[1] - * - * av_freep(&array); - * @endcode - * - * @{ - *) - - -(** - * Add the pointer to an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by `nb_ptr` - * is incremented. - * In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and - * `*nb_ptr` is set to 0. - * - * @param[in,out] tab_ptr Pointer to the array to grow - * @param[in,out] nb_ptr Pointer to the number of elements in the array - * @param[in] elem Element to add - * @see av_dynarray_add_nofree(), av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * Function has the same functionality as av_dynarray_add(), - * but it doesn't free memory on fails. It returns error code - * instead and leave current buffer untouched. - * - * @return >=0 on success, negative otherwise - * @see av_dynarray_add(), av_dynarray2_add() - *) -function av_dynarray_add_nofree(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer): cint; - cdecl; external av__util; - -(** - * Add an element of size `elem_size` to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by `nb_ptr` - * is incremented. - * In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and - * `*nb_ptr` is set to 0. - * - * @param[in,out] tab_ptr Pointer to the array to grow - * @param[in,out] nb_ptr Pointer to the number of elements in the array - * @param[in] elem_size Size in bytes of an element in the array - * @param[in] elem_data Pointer to the data of the element to add. If - * `NULL`, the space of the newly added element is - * allocated but left uninitialized. - * - * @return Pointer to the data of the element to copy in the newly allocated - * space - * @see av_dynarray_add(), av_dynarray_add_nofree() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * @} - *) - -(** - * @defgroup lavu_mem_misc Miscellaneous Functions - * - * Other functions related to memory allocation. - * - * @{ - *) - -(** - * Multiply two `size_t` values checking for overflow. - * - * @param[in] a,b Operands of multiplication - * @param[out] r Pointer to the result of the operation - * @return 0 on success, AVERROR(EINVAL) on overflow - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: don't try the division if nelem and elsize - * are both less than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may be allocated in one block. - * - * The value specified with this function is effective for all libavutil's @ref - * lavu_mem_funcs "heap management functions." - * - * By default, the max value is defined as `INT_MAX`. - * - * @param max Value to be set as the new maximum size - * - * @warning Exercise extreme caution when using this function. Don't touch - * this if you do not understand the full consequence of doing so. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.2/libavutil/opt.pas b/src/lib/ffmpeg-3.2/libavutil/opt.pas deleted file mode 100644 index 87ec68aa..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/opt.pas +++ /dev/null @@ -1,507 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 54.7.100 - * - *) - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. Only these - * AVOption fields for which (opt->flags & mask) == flags will have their - * default applied to s. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - * @param mask combination of AV_OPT_FLAG_* - * @param flags combination of AV_OPT_FLAG_* - *) -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all allocated objects in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict2(obj: pointer; var options: PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = (1 << 0); (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = (1 << 1); - -(** - * In av_opt_get, return NULL if the option has a pointer type and is set to NULL, - * rather than returning an empty string. - *) - AV_OPT_ALLOW_NULL = (1 << 2); -(** - * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than - * one component for certain option types. - * @see AVOptionRanges for details. - *) - AV_OPT_MULTI_COMPONENT_RANGE = (1 << 12); - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: {const} pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * @note Any old dictionary present is discarded and replaced with a copy of the new one. The - * caller still owns val is and responsible for freeing it. - *) -function av_opt_set_dict_val(obj: pointer; name: {const} PAnsiChar; val: {const} PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - * - * @note if AV_OPT_ALLOW_NULL is set in search_flags in av_opt_get, and the option has - * AV_OPT_TYPE_STRING or AV_OPT_TYPE_BINARY and is set to NULL, *out_val will be set - * to NULL instead of an allocated empty string. - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @param[out] out_val The returned dictionary is a copy of the actual value and must - * be freed with av_dict_free() by the caller - *) -function av_opt_get_dict_val (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: PAVDictionary): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -function av_opt_copy(dest: pointer;src: {const }pointer): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-3.2/libavutil/pixfmt.pas b/src/lib/ffmpeg-3.2/libavutil/pixfmt.pas deleted file mode 100644 index 0e9512ee..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/pixfmt.pas +++ /dev/null @@ -1,554 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB32 palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8 bits per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bits with AV_PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - AV_PIX_FMT_XVMC = AV_PIX_FMT_XVMC_MPEG2_IDCT, -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, most significant bit to 1 -{$IFDEF FF_API_VAAPI} - (** Deprecated pixel formats *) - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a VASurfaceID - - AV_PIX_FMT_VAAPI = AV_PIX_FMT_VAAPI_VLD, -{$ELSE} - AV_PIX_FMT_VAAPI, -{$ENDIF} - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG-4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_YA8, ///< 8 bits gray, 8 bits alpha -(* see const declaration way down - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -*) - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP, // alias for #AV_PIX_FMT_GBRP - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - - AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb - - AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef - - AV_PIX_FMT_YA16BE, ///< 16 bits gray, 16 bits alpha (big-endian) - AV_PIX_FMT_YA16LE, ///< 16 bits gray, 16 bits alpha (little-endian) - - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - (** - * HW acceleration through QSV, data[3] contains a pointer to the - * mfxFrameSurface1 structure. - *) - AV_PIX_FMT_QSV, - (** - * HW acceleration though MMAL, data[3] contains a pointer to the - * MMAL_BUFFER_HEADER_T structure. - *) - AV_PIX_FMT_MMAL, - - AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer - - (** - * HW acceleration through CUDA. data[i] contain CUdeviceptr pointers - * exactly as for system memory frames. - *) - AV_PIX_FMT_CUDA, - - AV_PIX_FMT_0RGB = $123 + 4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_AYUV64LE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_AYUV64BE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - - AV_PIX_FMT_VIDEOTOOLBOX, ///< hardware decoding through Videotoolbox - - AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian - AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian - - AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian - - AV_PIX_FMT_GBRAP10BE, ///< planar GBR 4:4:4:4 40bpp, big-endian - AV_PIX_FMT_GBRAP10LE, ///< planar GBR 4:4:4:4 40bpp, little-endian - - AV_PIX_FMT_MEDIACODEC, ///< hardware decoding through MediaCodec - - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP10 = AV_PIX_FMT_GBRAP10BE; - AV_PIX_FMT_GBRAP12 = AV_PIX_FMT_GBRAP12BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64BE; - AV_PIX_FMT_P010 = AV_PIX_FMT_P010BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP10 = AV_PIX_FMT_GBRAP10LE; - AV_PIX_FMT_GBRAP12 = AV_PIX_FMT_GBRAP12LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64LE; - AV_PIX_FMT_P010 = AV_PIX_FMT_P010LE; -{$ENDIF} - -type -(** - * Chromaticity coordinates of the source primaries. - *) - TAVColorPrimaries = ( - AVCOL_PRI_RESERVED0 = 0, - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_RESERVED = 3, - AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_SMPTEST428_1 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ) - AVCOL_PRI_SMPTE431 = 11, ///< SMPTE ST 431-2 (2011) - AVCOL_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 D65 (2010) - AVCOL_PRI_NB ///< Not part of ABI - ); - -(** - * Color Transfer Characteristic. - *) - TAVColorTransferCharacteristic = ( - AVCOL_TRC_RESERVED0 = 0, - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_RESERVED = 3, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10-bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12-bit system - AVCOL_TRC_SMPTEST2084 = 16, ///< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems - AVCOL_TRC_SMPTEST428_1 = 17, ///< SMPTE ST 428-1 - AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma" - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * YUV colorspace type. - *) - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_RESERVED = 3, - AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_SPC_SMPTE240M = 7, ///< functionally identical to above - AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_SMPTE2085 = 11, ///< SMPTE 2085, Y'D'zD'x - AVCOL_SPC_NB ///< Not part of ABI - ); - -const - AVCOL_SPC_YCGCO = AVCOL_SPC_YCOCG; - -type -(** - * MPEG vs JPEG YUV range. - *) - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * Location of chroma samples. - * - * Illustration showing the location of the first (top left) chroma sample of the - * image, the left shows only luma, the right - * shows the location of the chroma sample, the 2 could be imagined to overlay - * each other but are drawn separately due to limitations of ASCII - * - * 1st 2nd 1st 2nd horizontal luma sample positions - * v v v v - * ______ ______ - *1st luma line > |X X ... |3 4 X ... X are luma samples, - * | |1 2 1-6 are possible chroma positions - *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< MPEG-2/4 4:2:0, H.264 default for 4:2:0 - AVCHROMA_LOC_CENTER = 2, ///< MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0 - AVCHROMA_LOC_TOPLEFT = 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); diff --git a/src/lib/ffmpeg-3.2/libavutil/samplefmt.pas b/src/lib/ffmpeg-3.2/libavutil/samplefmt.pas deleted file mode 100644 index 85b11305..00000000 --- a/src/lib/ffmpeg-3.2/libavutil/samplefmt.pas +++ /dev/null @@ -1,287 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 54.7.100 - * - *) - -type -(** - * @addtogroup lavu_audio - * @ - * - * @defgroup lavu_sampfmts Audio sample formats - * - * Audio sample format enumeration and related convenience functions. - * @ - *) - -(** - * Audio sample formats - * - * - The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * - The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * @par - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - * - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - AV_SAMPLE_FMT_S64, ///< signed 64 bits - AV_SAMPLE_FMT_S64P, ///< signed 64 bits, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * @ - * - * @defgroup lavu_sampmanip Samples manipulation - * - * Functions that manipulate audio samples - * @ - *) - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.2/rational.pas b/src/lib/ffmpeg-3.2/rational.pas deleted file mode 100644 index d7fcb5b2..00000000 --- a/src/lib/ffmpeg-3.2/rational.pas +++ /dev/null @@ -1,270 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 54.7.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * Rational number (pair of numerator and denominator). - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< Numerator - den: cint; ///< Denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create an AVRational. - * - * Useful for compilers that do not support compound literals. - * - * @note The return value is not reduced. - * @see av_reduce() - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create an AVRational. - * - * Useful for compilers that do not support compound literals. - * - * @note The return value is not reduced. - * @see av_reduce() - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * - * @param a First rational - * @param b Second rational - * - * @return One of the following values: - * - 0 if `a == b` - * - 1 if `a > b` - * - -1 if `a < b` - * - `INT_MIN` if one of the values is of the form `0 / 0` - *) -function av_cmp_q(a: TAVRational; b: TAVRational): cint; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Convert an AVRational to a `double`. - * @param a AVRational to convert - * @return `a` in floating-point form - * @see av_d2q() - *) -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Reduce a fraction. - * - * This is useful for framerate calculations. - * - * @param[out] dst_num Destination numerator - * @param[out] dst_den Destination denominator - * @param[in] num Source numerator - * @param[in] den Source denominator - * @param[in] max Maximum allowed values for `dst_num` & `dst_den` - * @return 1 if the operation is exact, 0 otherwise - *) -function av_reduce(dst_num: PCint; dst_den: PCint; num: cint64; den: cint64; max: cint64): cint; - cdecl; external av__util; - -(** - * Multiply two rationals. - * @param b First rational - * @param c Second rational - * @return b*c - *) -function av_mul_q(b: TAVRational; c: TAVRational): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Divide one rational by another. - * @param b First rational - * @param c Second rational - * @return b/c - *) -function av_div_q(b: TAVRational; c: TAVRational): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Add two rationals. - * @param b First rational - * @param c Second rational - * @return b+c - *) -function av_add_q(b: TAVRational; c: TAVRational): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Subtract one rational from another. - * @param b First rational - * @param c Second rational - * @return b-c - *) -function av_sub_q(b: TAVRational; c: TAVRational): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Invert a rational. - * @param q value - * @return 1 / q - *) -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Convert a double precision floating point number to a rational. - * - * In case of infinity, the returned value is expressed as `{1, 0}` or - * `{-1, 0}` depending on the sign. - * - * @param d `double` to convert - * @param max Maximum allowed numerator and denominator - * @return `d` in AVRational form - * @see av_q2d() - *) -function av_d2q(d: cdouble; max: cint): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Find which of the two rationals is closer to another rational. - * - * @param q Rational to be compared against - * @param q1,q2 Rationals to be tested - * @return One of the following values: - * - 1 if `q1` is nearer to `q` than `q2` - * - -1 if `q2` is nearer to `q` than `q1` - * - 0 if they have the same distance - *) -function av_nearer_q(q, q1, q2: TAVRational): cint; - cdecl; external av__util; - -(** - * Find the value in a list of rationals nearest a given reference rational. - * - * @param q Reference rational - * @param q_list Array of rationals terminated by `{0, 0}` - * @return Index of the nearest value found in the array - *) -function av_find_nearest_q_idx(q: TAVRational; q_list: {const} PAVRationalArray): cint; - cdecl; external av__util; - -(** - * Convert an AVRational to a IEEE 32-bit `float` expressed in fixed-point - * format. - * - * @param q Rational to be converted - * @return Equivalent floating-point value, expressed as an unsigned 32-bit - * integer. - * @note The returned value is platform-indepedant. - *) -function av_q2intfloat(q: TAVRational): cuint32; - cdecl; external av__util; - -implementation - -function av_cmp_q (a: TAVRational; b: TAVRational): cint; {$IFDEF HasInline}inline;{$ENDIF} -var - tmp: cint64; -begin - tmp := a.num * cint64(b.den) - b.num * cint64(a.den); - -{ old version - if (tmp <> 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-3.2/swresample.pas b/src/lib/ffmpeg-3.2/swresample.pas deleted file mode 100644 index c762361c..00000000 --- a/src/lib/ffmpeg-3.2/swresample.pas +++ /dev/null @@ -1,467 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 0.18.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 2; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 8; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 2; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 3; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type -(** Dithering algorithms *) - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - -(** Resampling Engines *) - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - -(** Resampling Filter Types *) - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall windowed sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser windowed sinc *) - ); - -(** - * The libswresample context. Unlike libavcodec and libavformat, this structure - * is opaque. This means that if you would like to set options, you must use - * the @ref avoptions API and cannot directly set values to members of the - * structure. - *) - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -{$INCLUDE libavcodec/audioconvert.pas} - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * - * @param[in,out] s Swr context to initialize - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @param[in] s Swr context to check - * @see swr_init() - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - * - * @param[in] s a pointer to a pointer to Swr context - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Closes the context so that swr_is_initialized() returns 0. - * - * The context can be brought back to life by running swr_init(), - * swr_init() can also be used without swr_close(). - * This function is mainly provided for simplifying the usecase - * where one tries to support libavresample and libswresample. - * - * @param[in,out] s Swr context to be closed - *) -procedure swr_close(s: PSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space, then the input will be buffered. - * You can avoid this buffering by using swr_get_out_samples() to retrieve an - * upper bound on the required number of output samples for the given number of - * input samples. Conversion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - var in_: {const} PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation ("soft" compensation). This function is - * internally called when needed in swr_next_pts(). - * - * @param[in,out] s allocated Swr context. If it is not initialized, - * or SWR_FLAG_RESAMPLE is not set, swr_init() is - * called with the flag set. - * @param[in] sample_delta delta in PTS per sample - * @param[in] compensation_distance number of samples to compensate for - * @return >= 0 on success, AVERROR error codes if: - * @li @c s is NULL, - * @li @c compensation_distance is less than 0, - * @li @c compensation_distance is 0 but sample_delta is not, - * @li compensation unsupported by resampler, or - * @li swr_init() fails when called. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param[in,out] s allocated Swr context, not yet initialized - * @param[in] channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Generate a channel mixing matrix. - * - * This function is the one used internally by libswresample for building the - * default mixing matrix. It is made public just as a utility function for - * building custom matrices. - * - * @param in_layout input channel layout - * @param out_layout output channel layout - * @param center_mix_level mix level for the center channel - * @param surround_mix_level mix level for the surround channel(s) - * @param lfe_mix_level mix level for the low-frequency effects channel - * @param rematrix_maxval if 1.0, coefficients will be normalized to prevent - * overflow. if INT_MAX, coefficients will not be - * normalized. - * @param[out] matrix mixing coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o. - * @param stride distance between adjacent input channels in the - * matrix array - * @param matrix_encoding matrixed stereo downmix mode (e.g. dplii) - * @param log_ctx parent logging context, can be NULL - * @return 0 on success, negative AVERROR code on failure - *) -function swr_build_matrix(in_layout: Pcuint64; out_layout: Pcuint64; - center_mix_level: cdouble; surround_mix_level: cdouble; - lfe_mix_level: cdouble; rematrix_maxval: cdouble; - rematrix_volume: cdouble; matrix: Pcdouble; - stride: cint; matrix_encoding: TAVMatrixEncoding; - log_ctx: pointer): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - * - * This function, along with swr_inject_silence(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - * - * This function, along with swr_drop_output(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be: - * @li if it's set to 1 the returned delay is in seconds - * @li if it's set to 1000 the returned delay is in milliseconds - * @li if it's set to the input sample rate then the returned - * delay is in input samples - * @li if it's set to the output sample rate then the returned - * delay is in output samples - * @li if it's the least common multiple of in_sample_rate and - * out_sample_rate then an exact rounding-free delay will be - * returned - * @returns the delay in 1 / @c base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Find an upper bound on the number of samples that the next swr_convert - * call will output, if called with in_samples of input samples. This - * depends on the internal state, and anything changing the internal state - * (like further swr_convert() calls) will may change the number of samples - * swr_get_out_samples() returns for the same number of input samples. - * - * @param in_samples number of input samples. - * @note any call to swr_inject_silence(), swr_convert(), swr_next_pts() - * or swr_set_compensation() invalidates this limit - * @note it is recommended to pass the correct available buffer size - * to all functions like swr_convert() even if swr_get_out_samples() - * indicates that less would be used. - * @returns an upper bound on the number of samples that the next swr_convert - * will output or a negative value to indicate an error - *) -function swr_get_out_samples(s: PSwrContext; in_samples: cint): cint; - cdecl; external sw__resample; - -(** - * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. - * - * This is useful to check if the build-time libswresample has the same version - * as the run-time one. - * - * @returns the unsigned int-typed version - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - * - * @returns the build-time @c ./configure flags - *) -function swresample_configuration(): PAnsiChar; - cdecl; external sw__resample; - -(** - * Return the swr license. - * - * @returns the license of libswresample, determined at build-time - *) -function swresample_license(): PAnsiChar; - cdecl; external sw__resample; - -implementation - -end. - diff --git a/src/lib/ffmpeg-3.2/swscale.pas b/src/lib/ffmpeg-3.2/swscale.pas deleted file mode 100644 index d4c2ec22..00000000 --- a/src/lib/ffmpeg-3.2/swscale.pas +++ /dev/null @@ -1,439 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 3.0.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 4; - LIBSWSCALE_MAX_VERSION_MINOR = 7; - LIBSWSCALE_MAX_VERSION_RELEASE = 101; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominance subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - SWS_CS_BT2020 = 9; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @param param extra parameters to tune the used scaler - * For SWS_BICUBIC param[0] and [1] tune the shape of the basis - * function, param[0] tunes f(1) and param[1] f??(1) - * For SWS_GAUSS param[0] tunes the exponent and thus cutoff - * frequency - * For SWS_LANCZOS param[0] tunes the width of the window function - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: {const} PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -{$IFDEF FF_API_SWS_VECTOR} -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; deprecated; -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; deprecated; -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; deprecated; -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; deprecated; -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; deprecated; -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; deprecated; -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; deprecated; -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; deprecated; -{$ENDIF} - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-3.4/How to update the ffmpeg files.txt b/src/lib/ffmpeg-3.4/How to update the ffmpeg files.txt deleted file mode 100644 index ae65d477..00000000 --- a/src/lib/ffmpeg-3.4/How to update the ffmpeg files.txt +++ /dev/null @@ -1,20 +0,0 @@ -how to update the ffmpeg files: - -1) buffer.pas - cpu.pas - dict.pas - error.pas - frame.pas - log.pas - mathematics.pas - mem.pas - opt.pas - pixfmt.pas - samplefmt.pas -2) rational.pas -3) avutil.pas -4) avcodec.pas -5) avio.pas - swscale.pas - swresample.pas -6) avformat.pas \ No newline at end of file diff --git a/src/lib/ffmpeg-3.4/ToDo.txt b/src/lib/ffmpeg-3.4/ToDo.txt deleted file mode 100644 index b0bd305e..00000000 --- a/src/lib/ffmpeg-3.4/ToDo.txt +++ /dev/null @@ -1,112 +0,0 @@ -1) avutil.pas - -from mem.pas: -inline function av_x_if_null -inline function av_size_mult - -from log.pas: -inline function av_log -inline function av_log_set_callback -inline function av_log_default_callback -inline function av_dlog - - -FFmpeg 3.0 changes: -2016-02-10 - bc9a596 / 9f61abc - lavf 57.25.100 / 57.3.0 - avformat.h - Add AVFormatContext.opaque, io_open and io_close, allowing custom IO - -2016-02-01 - 1dba837 - lavf 57.24.100 - avformat.h, avio.h - Add protocol_whitelist to AVFormatContext, AVIOContext - -2016-01-31 - 66e9d2f - lavu 55.17.100 - frame.h - Add AV_FRAME_DATA_GOP_TIMECODE for exporting MPEG1/2 GOP timecodes. - -2016-01-01 - 5e8b053 / 2c68113 - lavc 57.21.100 / 57.12.0 - avcodec.h - Add AVCodecDescriptor.profiles and avcodec_profile_name(). - -2015-12-28 - 1f9139b - lavf 57.21.100 - avformat.h - Add automatic bitstream filtering; add av_apply_bitstream_filters() - -2015-12-22 - 39a09e9 - lavfi 6.21.101 - avfilter.h - Deprecate avfilter_link_set_closed(). - Applications are not supposed to mess with links, - they should close the sinks. - -2015-12-17 - lavc 57.18.100 / 57.11.0 - avcodec.h dirac.h - xxxxxxx - Add av_packet_add_side_data(). - xxxxxxx - Add AVCodecContext.coded_side_data. - xxxxxxx - Add AVCPBProperties API. - xxxxxxx - Add a new public header dirac.h containing - av_dirac_parse_sequence_header() - -2015-12-11 - 676a93f - lavf 57.20.100 - avformat.h - Add av_program_add_stream_index() - -2015-11-29 - 93fb4a4 - lavc 57.16.101 - avcodec.h - Deprecate rtp_callback without replacement, i.e. it won't be possible to - get image slices before the full frame is encoded any more. The libavformat - rtpenc muxer can still be used for RFC-2190 packetization. - -2015-11-22 - fe20e34 - lavc 57.16.100 - avcodec.h - Add AV_PKT_DATA_FALLBACK_TRACK for making fallback associations between - streams. - -2015-11-22 - ad317c9 - lavf 57.19.100 - avformat.h - Add av_stream_new_side_data(). - -2015-11-22 - e12f403 - lavu 55.8.100 - xtea.h - Add av_xtea_le_init and av_xtea_le_crypt - -2015-11-18 - lavu 55.7.100 - mem.h - Add av_fast_mallocz() - -2015-10-29 - lavc 57.12.100 / 57.8.0 - avcodec.h - xxxxxx - Deprecate av_free_packet(). Use av_packet_unref() as replacement, - it resets the packet in a more consistent way. - xxxxxx - Deprecate av_dup_packet(), it is a no-op for most cases. - Use av_packet_ref() to make a non-refcounted AVPacket refcounted. - xxxxxx - Add av_packet_alloc(), av_packet_clone(), av_packet_free(). - They match the AVFrame functions with the same name. - -2015-10-27 - 1e477a9 - lavu 55.5.100 - cpu.h - Add AV_CPU_FLAG_AESNI. - -2015-10-22 - ee573b4 / a17a766 - lavc 57.9.100 / 57.5.0 - avcodec.h - Add data and linesize array to AVSubtitleRect, to be used instead of - the ones from the embedded AVPicture. - -2015-10-22 - 866a417 / dc923bc - lavc 57.8.100 / 57.0.0 - qsv.h - Add an API for allocating opaque surfaces. - -2015-10-15 - 2c2d162 - lavf 57.4.100 - Remove the latm demuxer that was a duplicate of the loas demuxer. - -2015-10-14 - b994788 / 11c5f43 - lavu 55.4.100 / 55.2.0 - dict.h - Change return type of av_dict_copy() from void to int, so that a proper - error code can be reported. - -2015-09-29 - b01891a / 948f3c1 - lavc 57.3.100 / 57.2.0 - avcodec.h - Change type of AVPacket.duration from int to int64_t. - -2015-09-17 - 7c46f24 / e3d4784 - lavc 57.3.100 / 57.2.0 - d3d11va.h - Add av_d3d11va_alloc_context(). This function must from now on be used for - allocating AVD3D11VAContext. - -2015-09-15 - lavf 57.2.100 - avformat.h - probesize and max_analyze_duration switched to 64bit, both - are only accessible through AVOptions - -2015-09-15 - lavf 57.1.100 - avformat.h - bit_rate was changed to 64bit, make sure you update any - printf() or other type sensitive code - -2015-09-15 - lavc 57.2.100 - avcodec.h - bit_rate/rc_max_rate/rc_min_rate were changed to 64bit, make sure you update - any printf() or other type sensitive code - -2015-09-07 - lavu 55.0.100 / 55.0.0 - c734b34 / b8b5d82 - Change type of AVPixFmtDescriptor.flags from uint8_t to uint64_t. - f53569a / 6b3ef7f - Change type of AVComponentDescriptor fields from uint16_t to int - and drop bit packing. - 151aa2e / 2268db2 - Add step, offset, and depth to AVComponentDescriptor to replace - the deprecated step_minus1, offset_plus1, and depth_minus1. \ No newline at end of file diff --git a/src/lib/ffmpeg-3.4/avcodec.pas b/src/lib/ffmpeg-3.4/avcodec.pas deleted file mode 100644 index 61e834a3..00000000 --- a/src/lib/ffmpeg-3.4/avcodec.pas +++ /dev/null @@ -1,7129 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * version: 56.1.100 - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 57; - LIBAVCODEC_MAX_VERSION_MINOR = 107; - LIBAVCODEC_MAX_VERSION_RELEASE = 100; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 57; - LIBAVCODEC_MIN_VERSION_MINOR = 107; - LIBAVCODEC_MIN_VERSION_RELEASE = 100; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -type - FF_INTERNALC_MEM_TYPE = cuint; - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @ingroup libavc - * @defgroup lavc_encdec send/receive encoding and decoding API overview - * @{ - * - * The avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/ - * avcodec_receive_packet() functions provide an encode/decode API, which - * decouples input and output. - * - * The API is very similar for encoding/decoding and audio/video, and works as - * follows: - * - Set up and open the AVCodecContext as usual. - * - Send valid input: - * - For decoding, call avcodec_send_packet() to give the decoder raw - * compressed data in an AVPacket. - * - For encoding, call avcodec_send_frame() to give the encoder an AVFrame - * containing uncompressed audio or video. - * In both cases, it is recommended that AVPackets and AVFrames are - * refcounted, or libavcodec might have to copy the input data. (libavformat - * always returns refcounted AVPackets, and av_frame_get_buffer() allocates - * refcounted AVFrames.) - * - Receive output in a loop. Periodically call one of the avcodec_receive_*() - * functions and process their output: - * - For decoding, call avcodec_receive_frame(). On success, it will return - * an AVFrame containing uncompressed audio or video data. - * - For encoding, call avcodec_receive_packet(). On success, it will return - * an AVPacket with a compressed frame. - * Repeat this call until it returns AVERROR(EAGAIN) or an error. The - * AVERROR(EAGAIN) return value means that new input data is required to - * return new output. In this case, continue with sending input. For each - * input frame/packet, the codec will typically return 1 output frame/packet, - * but it can also be 0 or more than 1. - * - * At the beginning of decoding or encoding, the codec might accept multiple - * input frames/packets without returning a frame, until its internal buffers - * are filled. This situation is handled transparently if you follow the steps - * outlined above. - * - * In theory, sending input can result in EAGAIN - this should happen only if - * not all output was received. You can use this to structure alternative decode - * or encode loops other than the one suggested above. For example, you could - * try sending new input on each iteration, and try to receive output if that - * returns EAGAIN. - * - * End of stream situations. These require "flushing" (aka draining) the codec, - * as the codec might buffer multiple frames or packets internally for - * performance or out of necessity (consider B-frames). - * This is handled as follows: - * - Instead of valid input, send NULL to the avcodec_send_packet() (decoding) - * or avcodec_send_frame() (encoding) functions. This will enter draining - * mode. - * - Call avcodec_receive_frame() (decoding) or avcodec_receive_packet() - * (encoding) in a loop until AVERROR_EOF is returned. The functions will - * not return AVERROR(EAGAIN), unless you forgot to enter draining mode. - * - Before decoding can be resumed again, the codec has to be reset with - * avcodec_flush_buffers(). - * - * Using the API as outlined above is highly recommended. But it is also - * possible to call functions outside of this rigid schema. For example, you can - * call avcodec_send_packet() repeatedly without calling - * avcodec_receive_frame(). In this case, avcodec_send_packet() will succeed - * until the codec's internal buffer has been filled up (which is typically of - * size 1 per output frame, after initial input), and then reject input with - * AVERROR(EAGAIN). Once it starts rejecting input, you have no choice but to - * read at least some output. - * - * Not all codecs will follow a rigid and predictable dataflow; the only - * guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on - * one end implies that a receive/send call on the other end will succeed, or - * at least will not fail with AVERROR(EAGAIN). In general, no codec will - * permit unlimited buffering of input or output. - * - * This API replaces the following legacy functions: - * - avcodec_decode_video2() and avcodec_decode_audio4(): - * Use avcodec_send_packet() to feed input to the decoder, then use - * avcodec_receive_frame() to receive decoded frames after each packet. - * Unlike with the old video decoding API, multiple frames might result from - * a packet. For audio, splitting the input packet into frames by partially - * decoding packets becomes transparent to the API user. You never need to - * feed an AVPacket to the API twice (unless it is rejected with AVERROR(EAGAIN) - then - * no data was read from the packet). - * Additionally, sending a flush/draining packet is required only once. - * - avcodec_encode_video2()/avcodec_encode_audio2(): - * Use avcodec_send_frame() to feed input to the encoder, then use - * avcodec_receive_packet() to receive encoded packets. - * Providing user-allocated buffers for avcodec_receive_packet() is not - * possible. - * - The new API does not handle subtitles yet. - * - * Mixing new and old function calls on the same AVCodecContext is not allowed, - * and will result in undefined behavior. - * - * Some codecs might require using the new API; using the old API will return - * an error when calling it. All codecs support the new API. - * - * A codec is not allowed to return AVERROR(EAGAIN) for both sending and receiving. This - * would be an invalid state, which could put the codec user into an endless - * loop. The API has no concept of time either: it cannot happen that trying to - * do avcodec_send_packet() results in AVERROR(EAGAIN), but a repeated call 1 second - * later accepts the packet (with no other receive/flush API calls involved). - * The API is a strict state machine, and the passage of time is not supposed - * to influence it. Some timing-dependent behavior might still be deemed - * acceptable in certain cases. But it must never result in both send/receive - * returning EAGAIN at the same time at any point. It must also absolutely be - * avoided that the current state is "unstable" and can "flip-flop" between - * the send/receive APIs allowing progress. For example, it's not allowed that - * the codec randomly decides that it actually wants to consume a packet now - * instead of returning a frame, after it just returned AVERROR(EAGAIN) on an - * avcodec_send_packet() call. - * @} - *) - -(** - * @defgroup lavc_core Core functions/structures. - * @ingroup libavc - * - * Basic definitions, functions for querying libavcodec capabilities, - * allocating core structures, etc. - * @ - *) - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of an existing codec ID changes (that would break ABI), - * 2. it is as close as possible to similar codecs - * - * After adding new codec IDs, do not forget to add an entry to the codec - * descriptor list and bump libavcodec minor version. - *) -type - PAVCodecID = ^TAVCodecID; - TAVCodecID = ( - AV_CODEC_ID_NONE, - - //* video codecs */ - AV_CODEC_ID_MPEG1VIDEO, - AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -{$IFDEF FF_API_XVMC} - AV_CODEC_ID_MPEG2VIDEO_XVMC, -{$IFEND} - AV_CODEC_ID_H261, - AV_CODEC_ID_H263, - AV_CODEC_ID_RV10, - AV_CODEC_ID_RV20, - AV_CODEC_ID_MJPEG, - AV_CODEC_ID_MJPEGB, - AV_CODEC_ID_LJPEG, - AV_CODEC_ID_SP5X, - AV_CODEC_ID_JPEGLS, - AV_CODEC_ID_MPEG4, - AV_CODEC_ID_RAWVIDEO, - AV_CODEC_ID_MSMPEG4V1, - AV_CODEC_ID_MSMPEG4V2, - AV_CODEC_ID_MSMPEG4V3, - AV_CODEC_ID_WMV1, - AV_CODEC_ID_WMV2, - AV_CODEC_ID_H263P, - AV_CODEC_ID_H263I, - AV_CODEC_ID_FLV1, - AV_CODEC_ID_SVQ1, - AV_CODEC_ID_SVQ3, - AV_CODEC_ID_DVVIDEO, - AV_CODEC_ID_HUFFYUV, - AV_CODEC_ID_CYUV, - AV_CODEC_ID_H264, - AV_CODEC_ID_INDEO3, - AV_CODEC_ID_VP3, - AV_CODEC_ID_THEORA, - AV_CODEC_ID_ASV1, - AV_CODEC_ID_ASV2, - AV_CODEC_ID_FFV1, - AV_CODEC_ID_4XM, - AV_CODEC_ID_VCR1, - AV_CODEC_ID_CLJR, - AV_CODEC_ID_MDEC, - AV_CODEC_ID_ROQ, - AV_CODEC_ID_INTERPLAY_VIDEO, - AV_CODEC_ID_XAN_WC3, - AV_CODEC_ID_XAN_WC4, - AV_CODEC_ID_RPZA, - AV_CODEC_ID_CINEPAK, - AV_CODEC_ID_WS_VQA, - AV_CODEC_ID_MSRLE, - AV_CODEC_ID_MSVIDEO1, - AV_CODEC_ID_IDCIN, - AV_CODEC_ID_8BPS, - AV_CODEC_ID_SMC, - AV_CODEC_ID_FLIC, - AV_CODEC_ID_TRUEMOTION1, - AV_CODEC_ID_VMDVIDEO, - AV_CODEC_ID_MSZH, - AV_CODEC_ID_ZLIB, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_TSCC, - AV_CODEC_ID_ULTI, - AV_CODEC_ID_QDRAW, - AV_CODEC_ID_VIXL, - AV_CODEC_ID_QPEG, - AV_CODEC_ID_PNG, - AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, - AV_CODEC_ID_PGM, - AV_CODEC_ID_PGMYUV, - AV_CODEC_ID_PAM, - AV_CODEC_ID_FFVHUFF, - AV_CODEC_ID_RV30, - AV_CODEC_ID_RV40, - AV_CODEC_ID_VC1, - AV_CODEC_ID_WMV3, - AV_CODEC_ID_LOCO, - AV_CODEC_ID_WNV1, - AV_CODEC_ID_AASC, - AV_CODEC_ID_INDEO2, - AV_CODEC_ID_FRAPS, - AV_CODEC_ID_TRUEMOTION2, - AV_CODEC_ID_BMP, - AV_CODEC_ID_CSCD, - AV_CODEC_ID_MMVIDEO, - AV_CODEC_ID_ZMBV, - AV_CODEC_ID_AVS, - AV_CODEC_ID_SMACKVIDEO, - AV_CODEC_ID_NUV, - AV_CODEC_ID_KMVC, - AV_CODEC_ID_FLASHSV, - AV_CODEC_ID_CAVS, - AV_CODEC_ID_JPEG2000, - AV_CODEC_ID_VMNC, - AV_CODEC_ID_VP5, - AV_CODEC_ID_VP6, - AV_CODEC_ID_VP6F, - AV_CODEC_ID_TARGA, - AV_CODEC_ID_DSICINVIDEO, - AV_CODEC_ID_TIERTEXSEQVIDEO, - AV_CODEC_ID_TIFF, - AV_CODEC_ID_GIF, - AV_CODEC_ID_DXA, - AV_CODEC_ID_DNXHD, - AV_CODEC_ID_THP, - AV_CODEC_ID_SGI, - AV_CODEC_ID_C93, - AV_CODEC_ID_BETHSOFTVID, - AV_CODEC_ID_PTX, - AV_CODEC_ID_TXD, - AV_CODEC_ID_VP6A, - AV_CODEC_ID_AMV, - AV_CODEC_ID_VB, - AV_CODEC_ID_PCX, - AV_CODEC_ID_SUNRAST, - AV_CODEC_ID_INDEO4, - AV_CODEC_ID_INDEO5, - AV_CODEC_ID_MIMIC, - AV_CODEC_ID_RL2, - AV_CODEC_ID_ESCAPE124, - AV_CODEC_ID_DIRAC, - AV_CODEC_ID_BFI, - AV_CODEC_ID_CMV, - AV_CODEC_ID_MOTIONPIXELS, - AV_CODEC_ID_TGV, - AV_CODEC_ID_TGQ, - AV_CODEC_ID_TQI, - AV_CODEC_ID_AURA, - AV_CODEC_ID_AURA2, - AV_CODEC_ID_V210X, - AV_CODEC_ID_TMV, - AV_CODEC_ID_V210, - AV_CODEC_ID_DPX, - AV_CODEC_ID_MAD, - AV_CODEC_ID_FRWU, - AV_CODEC_ID_FLASHSV2, - AV_CODEC_ID_CDGRAPHICS, - AV_CODEC_ID_R210, - AV_CODEC_ID_ANM, - AV_CODEC_ID_BINKVIDEO, - AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_IFF_BYTERUN1 = AV_CODEC_ID_IFF_ILBM, - AV_CODEC_ID_KGV1, - AV_CODEC_ID_YOP, - AV_CODEC_ID_VP8, - AV_CODEC_ID_PICTOR, - AV_CODEC_ID_ANSI, - AV_CODEC_ID_A64_MULTI, - AV_CODEC_ID_A64_MULTI5, - AV_CODEC_ID_R10K, - AV_CODEC_ID_MXPEG, - AV_CODEC_ID_LAGARITH, - AV_CODEC_ID_PRORES, - AV_CODEC_ID_JV, - AV_CODEC_ID_DFA, - AV_CODEC_ID_WMV3IMAGE, - AV_CODEC_ID_VC1IMAGE, - AV_CODEC_ID_UTVIDEO, - AV_CODEC_ID_BMV_VIDEO, - AV_CODEC_ID_VBLE, - AV_CODEC_ID_DXTORY, - AV_CODEC_ID_V410, - AV_CODEC_ID_XWD, - AV_CODEC_ID_CDXL, - AV_CODEC_ID_XBM, - AV_CODEC_ID_ZEROCODEC, - AV_CODEC_ID_MSS1, - AV_CODEC_ID_MSA1, - AV_CODEC_ID_TSCC2, - AV_CODEC_ID_MTS2, - AV_CODEC_ID_CLLC, - AV_CODEC_ID_MSS2, - AV_CODEC_ID_VP9, - AV_CODEC_ID_AIC, - AV_CODEC_ID_ESCAPE130, - AV_CODEC_ID_G2M, - AV_CODEC_ID_WEBP, - AV_CODEC_ID_HNM4_VIDEO, - AV_CODEC_ID_HEVC, - AV_CODEC_ID_FIC, - AV_CODEC_ID_ALIAS_PIX, - AV_CODEC_ID_BRENDER_PIX, - AV_CODEC_ID_PAF_VIDEO, - AV_CODEC_ID_EXR, - AV_CODEC_ID_VP7, - AV_CODEC_ID_SANM, - AV_CODEC_ID_SGIRLE, - AV_CODEC_ID_MVC1, - AV_CODEC_ID_MVC2, - AV_CODEC_ID_HQX, - AV_CODEC_ID_TDSC, - AV_CODEC_ID_HQ_HQA, - AV_CODEC_ID_HAP, - AV_CODEC_ID_DDS, - AV_CODEC_ID_DXV, - AV_CODEC_ID_SCREENPRESSO, - AV_CODEC_ID_RSCC, - - AV_CODEC_ID_Y41P = $8000, - AV_CODEC_ID_AVRP, - AV_CODEC_ID_012V, - AV_CODEC_ID_AVUI, - AV_CODEC_ID_AYUV, - AV_CODEC_ID_TARGA_Y216, - AV_CODEC_ID_V308, - AV_CODEC_ID_V408, - AV_CODEC_ID_YUV4, - AV_CODEC_ID_AVRN, - AV_CODEC_ID_CPIA, - AV_CODEC_ID_XFACE, - AV_CODEC_ID_SNOW, - AV_CODEC_ID_SMVJPEG, - AV_CODEC_ID_APNG, - AV_CODEC_ID_DAALA, - AV_CODEC_ID_CFHD, - AV_CODEC_ID_TRUEMOTION2RT, - AV_CODEC_ID_M101, - AV_CODEC_ID_MAGICYUV, - AV_CODEC_ID_SHEERVIDEO, - AV_CODEC_ID_YLC, - AV_CODEC_ID_PSD, - AV_CODEC_ID_PIXLET, - AV_CODEC_ID_SPEEDHQ, - AV_CODEC_ID_FMVC, - AV_CODEC_ID_SCPR, - AV_CODEC_ID_CLEARVIDEO, - AV_CODEC_ID_XPM, - AV_CODEC_ID_AV1, - AV_CODEC_ID_BITPACKED, - AV_CODEC_ID_MSCC, - AV_CODEC_ID_SRGC, - AV_CODEC_ID_SVG, - AV_CODEC_ID_GDV, - AV_CODEC_ID_FITS, - - //* various PCM "codecs" */ - AV_CODEC_ID_FIRST_AUDIO = $10000, ///< A dummy id pointing at the start of audio codecs - AV_CODEC_ID_PCM_S16LE = $10000, - AV_CODEC_ID_PCM_S16BE, - AV_CODEC_ID_PCM_U16LE, - AV_CODEC_ID_PCM_U16BE, - AV_CODEC_ID_PCM_S8, - AV_CODEC_ID_PCM_U8, - AV_CODEC_ID_PCM_MULAW, - AV_CODEC_ID_PCM_ALAW, - AV_CODEC_ID_PCM_S32LE, - AV_CODEC_ID_PCM_S32BE, - AV_CODEC_ID_PCM_U32LE, - AV_CODEC_ID_PCM_U32BE, - AV_CODEC_ID_PCM_S24LE, - AV_CODEC_ID_PCM_S24BE, - AV_CODEC_ID_PCM_U24LE, - AV_CODEC_ID_PCM_U24BE, - AV_CODEC_ID_PCM_S24DAUD, - AV_CODEC_ID_PCM_ZORK, - AV_CODEC_ID_PCM_S16LE_PLANAR, - AV_CODEC_ID_PCM_DVD, - AV_CODEC_ID_PCM_F32BE, - AV_CODEC_ID_PCM_F32LE, - AV_CODEC_ID_PCM_F64BE, - AV_CODEC_ID_PCM_F64LE, - AV_CODEC_ID_PCM_BLURAY, - AV_CODEC_ID_PCM_LXF, - AV_CODEC_ID_S302M, - AV_CODEC_ID_PCM_S8_PLANAR, - AV_CODEC_ID_PCM_S24LE_PLANAR, - AV_CODEC_ID_PCM_S32LE_PLANAR, - AV_CODEC_ID_PCM_S16BE_PLANAR, - - AV_CODEC_ID_PCM_S64LE = $10800, - AV_CODEC_ID_PCM_S64BE, - AV_CODEC_ID_PCM_F16LE, - AV_CODEC_ID_PCM_F24LE, - - //* various ADPCM codecs */ - AV_CODEC_ID_ADPCM_IMA_QT = $11000, - AV_CODEC_ID_ADPCM_IMA_WAV, - AV_CODEC_ID_ADPCM_IMA_DK3, - AV_CODEC_ID_ADPCM_IMA_DK4, - AV_CODEC_ID_ADPCM_IMA_WS, - AV_CODEC_ID_ADPCM_IMA_SMJPEG, - AV_CODEC_ID_ADPCM_MS, - AV_CODEC_ID_ADPCM_4XM, - AV_CODEC_ID_ADPCM_XA, - AV_CODEC_ID_ADPCM_ADX, - AV_CODEC_ID_ADPCM_EA, - AV_CODEC_ID_ADPCM_G726, - AV_CODEC_ID_ADPCM_CT, - AV_CODEC_ID_ADPCM_SWF, - AV_CODEC_ID_ADPCM_YAMAHA, - AV_CODEC_ID_ADPCM_SBPRO_4, - AV_CODEC_ID_ADPCM_SBPRO_3, - AV_CODEC_ID_ADPCM_SBPRO_2, - AV_CODEC_ID_ADPCM_THP, - AV_CODEC_ID_ADPCM_IMA_AMV, - AV_CODEC_ID_ADPCM_EA_R1, - AV_CODEC_ID_ADPCM_EA_R3, - AV_CODEC_ID_ADPCM_EA_R2, - AV_CODEC_ID_ADPCM_IMA_EA_SEAD, - AV_CODEC_ID_ADPCM_IMA_EA_EACS, - AV_CODEC_ID_ADPCM_EA_XAS, - AV_CODEC_ID_ADPCM_EA_MAXIS_XA, - AV_CODEC_ID_ADPCM_IMA_ISS, - AV_CODEC_ID_ADPCM_G722, - AV_CODEC_ID_ADPCM_IMA_APC, - AV_CODEC_ID_ADPCM_VIMA, -{$IFDEF FF_API_VIMA_DECODER} - AV_CODEC_ID_VIMA = AV_CODEC_ID_ADPCM_VIMA, -{$IFEND} - AV_CODEC_ID_ADPCM_AFC = $11800, - AV_CODEC_ID_ADPCM_IMA_OKI, - AV_CODEC_ID_ADPCM_DTK, - AV_CODEC_ID_ADPCM_IMA_RAD, - AV_CODEC_ID_ADPCM_G726LE, - AV_CODEC_ID_ADPCM_THP_LE, - AV_CODEC_ID_ADPCM_PSX, - AV_CODEC_ID_ADPCM_AICA, - AV_CODEC_ID_ADPCM_IMA_DAT4, - AV_CODEC_ID_ADPCM_MTAF, - - //* AMR */ - AV_CODEC_ID_AMR_NB = $12000, - AV_CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - AV_CODEC_ID_RA_144 = $13000, - AV_CODEC_ID_RA_288, - - //* various DPCM codecs */ - AV_CODEC_ID_ROQ_DPCM = $14000, - AV_CODEC_ID_INTERPLAY_DPCM, - AV_CODEC_ID_XAN_DPCM, - AV_CODEC_ID_SOL_DPCM, - - AV_CODEC_ID_SDX2_DPCM = $14800, - AV_CODEC_ID_GREMLIN_DPCM, - - //* audio codecs */ - AV_CODEC_ID_MP2 = $15000, - AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - AV_CODEC_ID_AAC, - AV_CODEC_ID_AC3, - AV_CODEC_ID_DTS, - AV_CODEC_ID_VORBIS, - AV_CODEC_ID_DVAUDIO, - AV_CODEC_ID_WMAV1, - AV_CODEC_ID_WMAV2, - AV_CODEC_ID_MACE3, - AV_CODEC_ID_MACE6, - AV_CODEC_ID_VMDAUDIO, - AV_CODEC_ID_FLAC, - AV_CODEC_ID_MP3ADU, - AV_CODEC_ID_MP3ON4, - AV_CODEC_ID_SHORTEN, - AV_CODEC_ID_ALAC, - AV_CODEC_ID_WESTWOOD_SND1, - AV_CODEC_ID_GSM, ///< as in Berlin toast format - AV_CODEC_ID_QDM2, - AV_CODEC_ID_COOK, - AV_CODEC_ID_TRUESPEECH, - AV_CODEC_ID_TTA, - AV_CODEC_ID_SMACKAUDIO, - AV_CODEC_ID_QCELP, - AV_CODEC_ID_WAVPACK, - AV_CODEC_ID_DSICINAUDIO, - AV_CODEC_ID_IMC, - AV_CODEC_ID_MUSEPACK7, - AV_CODEC_ID_MLP, - AV_CODEC_ID_GSM_MS, { as found in WAV } - AV_CODEC_ID_ATRAC3, -{$IFDEF FF_API_VOXWARE} - AV_CODEC_ID_VOXWARE, -{$IFEND} - AV_CODEC_ID_APE, - AV_CODEC_ID_NELLYMOSER, - AV_CODEC_ID_MUSEPACK8, - AV_CODEC_ID_SPEEX, - AV_CODEC_ID_WMAVOICE, - AV_CODEC_ID_WMAPRO, - AV_CODEC_ID_WMALOSSLESS, - AV_CODEC_ID_ATRAC3P, - AV_CODEC_ID_EAC3, - AV_CODEC_ID_SIPR, - AV_CODEC_ID_MP1, - AV_CODEC_ID_TWINVQ, - AV_CODEC_ID_TRUEHD, - AV_CODEC_ID_MP4ALS, - AV_CODEC_ID_ATRAC1, - AV_CODEC_ID_BINKAUDIO_RDFT, - AV_CODEC_ID_BINKAUDIO_DCT, - AV_CODEC_ID_AAC_LATM, - AV_CODEC_ID_QDMC, - AV_CODEC_ID_CELT, - AV_CODEC_ID_G723_1, - AV_CODEC_ID_G729, - AV_CODEC_ID_8SVX_EXP, - AV_CODEC_ID_8SVX_FIB, - AV_CODEC_ID_BMV_AUDIO, - AV_CODEC_ID_RALF, - AV_CODEC_ID_IAC, - AV_CODEC_ID_ILBC, - AV_CODEC_ID_OPUS, - AV_CODEC_ID_COMFORT_NOISE, - AV_CODEC_ID_TAK, - AV_CODEC_ID_PAF_AUDIO, - AV_CODEC_ID_ON2AVC, - AV_CODEC_ID_DSS_SP, - - AV_CODEC_ID_FFWAVESYNTH = $15800, - AV_CODEC_ID_SONIC, - AV_CODEC_ID_SONIC_LS, - AV_CODEC_ID_EVRC, - AV_CODEC_ID_SMV, - AV_CODEC_ID_DSD_LSBF, - AV_CODEC_ID_DSD_MSBF, - AV_CODEC_ID_DSD_LSBF_PLANAR, - AV_CODEC_ID_DSD_MSBF_PLANAR, - AV_CODEC_ID_4GV, - AV_CODEC_ID_INTERPLAY_ACM, - AV_CODEC_ID_XMA1, - AV_CODEC_ID_XMA2, - AV_CODEC_ID_DST, - AV_CODEC_ID_ATRAC3AL, - AV_CODEC_ID_ATRAC3PAL, - AV_CODEC_ID_DOLBY_E, - - //* subtitle codecs */ - AV_CODEC_ID_FIRST_SUBTITLE = $17000, ///< A dummy ID pointing at the start of subtitle codecs. - AV_CODEC_ID_DVD_SUBTITLE = $17000, - AV_CODEC_ID_DVB_SUBTITLE, - AV_CODEC_ID_TEXT, ///< raw UTF-8 text - AV_CODEC_ID_XSUB, - AV_CODEC_ID_SSA, - AV_CODEC_ID_MOV_TEXT, - AV_CODEC_ID_HDMV_PGS_SUBTITLE, - AV_CODEC_ID_DVB_TELETEXT, - AV_CODEC_ID_SRT, - AV_CODEC_ID_MICRODVD = $17800, - AV_CODEC_ID_EIA_608, - AV_CODEC_ID_JACOSUB, - AV_CODEC_ID_SAMI, - AV_CODEC_ID_REALTEXT, - AV_CODEC_ID_STL, - AV_CODEC_ID_SUBVIEWER1, - AV_CODEC_ID_SUBVIEWER, - AV_CODEC_ID_SUBRIP, - AV_CODEC_ID_WEBVTT, - AV_CODEC_ID_MPL2, - AV_CODEC_ID_VPLAYER, - AV_CODEC_ID_PJS, - AV_CODEC_ID_ASS, - AV_CODEC_ID_HDMV_TEXT_SUBTITLE, - - //* other specific kind of codecs (generally used for attachments) */ - AV_CODEC_ID_FIRST_UNKNOWN = $18000, ///< A dummy ID pointing at the start of various fake codecs. - AV_CODEC_ID_TTF = $18000, - - AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program stream. - AV_CODEC_ID_BINTEXT = $18800, - AV_CODEC_ID_XBIN, - AV_CODEC_ID_IDF, - AV_CODEC_ID_OTF, - AV_CODEC_ID_SMPTE_KLV, - AV_CODEC_ID_DVD_NAV, - AV_CODEC_ID_TIMED_ID3, - AV_CODEC_ID_BIN_DATA, - - AV_CODEC_ID_PROBE = $19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it - - AV_CODEC_ID_MPEG2TS = $20000, (**< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *) - AV_CODEC_ID_MPEG4SYSTEMS = $20001, (**< _FAKE_ codec to indicate a MPEG-4 Systems - * stream (only used by libavformat) *) - AV_CODEC_ID_FFMETADATA = $21000, ///< Dummy codec for streams containing only metadata information. - AV_CODEC_ID_WRAPPED_AVFRAME = $21001 ///< Passthrough codec, AVFrames wrapped in AVPacket - ); - -type - TCodecType = TAVMediaType; - -const - CODEC_TYPE_UNKNOWN = AVMEDIA_TYPE_UNKNOWN; - CODEC_TYPE_VIDEO = AVMEDIA_TYPE_VIDEO; - CODEC_TYPE_AUDIO = AVMEDIA_TYPE_AUDIO; - CODEC_TYPE_DATA = AVMEDIA_TYPE_DATA; - CODEC_TYPE_SUBTITLE = AVMEDIA_TYPE_SUBTITLE; - CODEC_TYPE_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT; - CODEC_TYPE_NB = AVMEDIA_TYPE_NB; - -(** - * This struct describes the properties of a single codec described by an - * AVCodecID. - * @see avcodec_descriptor_get() - *) -type - - (** - * AVProfile. - *) - PAVProfile = ^TAVProfile; - TAVProfile = record - profile: cint; - name: {const} PAnsiChar; ///< short name for the profile - end; {TAVProfile} - - PAVCodecDescriptor = ^TAVCodecDescriptor; - TAVCodecDescriptor = record - id: TAVCodecID; - type_: TAVMediaType; - (** - * Name of the codec described by this descriptor. It is non-empty and - * unique for each codec descriptor. It should contain alphanumeric - * characters and '_' only. - *) - name: PAnsiChar; - (** - * A more descriptive name for this codec. May be NULL. - *) - long_name: PAnsiChar; - (** - * Codec properties, a combination of AV_CODEC_PROP_* flags. - *) - props: cint; - - (** - * MIME type(s) associated with the codec. - * May be NULL; if not, a NULL-terminated array of MIME types. - * The first item is always non-NULL and is the preferred MIME type. - *) - mime_types: PAnsiChar; - - (** - * If non-NULL, an array of profiles recognized for this codec. - * Terminated with FF_PROFILE_UNKNOWN. - *) - profiles: PAVProfile; - end; - -const -(** - * Codec uses only intra compression. - * Video and audio codecs only. - *) - AV_CODEC_PROP_INTRA_ONLY = 1 << 0; -(** - * Codec supports lossy compression. Audio and video codecs only. - * @note a codec may support both lossy and lossless - * compression modes - *) - AV_CODEC_PROP_LOSSY = 1 << 1; -(** - * Codec supports lossless compression. Audio and video codecs only. - *) - AV_CODEC_PROP_LOSSLESS = 1 << 2; -(** - * Codec supports frame reordering. That is, the coded order (the order in which - * the encoded packets are output by the encoders / stored / input to the - * decoders) may be different from the presentation order of the corresponding - * frames. - * - * For codecs that do not have this property set, PTS and DTS should always be - * equal. - *) - AV_CODEC_PROP_REORDER = 1 << 3; -(** - * Subtitle codec is bitmap based - * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. - *) - AV_CODEC_PROP_BITMAP_SUB = 1 << 16; -(** - * Subtitle codec is text based. - * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. - *) - AV_CODEC_PROP_TEXT_SUB = 1 << 17; - -(** - * @ingroup lavc_decoding - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *) - AV_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @ingroup lavc_decoding - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *) - AV_INPUT_BUFFER_MIN_SIZE = 16384; - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead - *) - FF_INPUT_BUFFER_PADDING_SIZE = 32; - -(** - * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead - *) - FF_MIN_BUFFER_SIZE = 16384; -{$ENDIF} - -type -(* - * @ingroup lavc_decoding - * motion estimation type. - * @deprecated use codec private option instead - *) -{$IFDEF FF_API_MOTION_EST} - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER = 50, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); -{$ENDIF} - -(** - * @ingroup lavc_decoding - *) - TAVDiscard = ( - (* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *) - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONINTRA= 24, ///< discard all non intra frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{ removed, kept for the moment - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -} - TAVAudioServiceType =( - AV_AUDIO_SERVICE_TYPE_MAIN = 0, - AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, - AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, - AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, - AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, - AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, - AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, - AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, - AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, - AV_AUDIO_SERVICE_TYPE_NB ///< Not part of ABI - ); - -(** - * @ingroup lavc_decoding - *) - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -{$IFDEF FF_API_MAX_BFRAMES} - -(** - * @deprecated there is no libavcodec-wide limit on the number of B-frames - *) -const - FF_MAX_B_FRAMES = 16; - -{$IFEND} - -(* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*) - -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - AV_CODEC_FLAG_UNALIGNED = $0001; // (1 << 0) -(** - * Use fixed qscale. - *) - AV_CODEC_FLAG_QSCALE = $0002; // (1 << 1) -(** - * 4 MV per MB allowed / advanced prediction for H.263. - *) - AV_CODEC_FLAG_4MV = $0004; // (1 << 2) -(** - * Output even those frames that might be corrupted. - *) - AV_CODEC_FLAG_OUTPUT_CORRUPT = $0008; // (1 << 3) -(** - * Use qpel MC. - *) - AV_CODEC_FLAG_QPEL = $0010; // (1 << 4) -(** - * Use internal 2pass ratecontrol in first pass mode. - *) - AV_CODEC_FLAG_PASS1 = $0200; // (1 << 9) -(** - * Use internal 2pass ratecontrol in second pass mode. - *) - AV_CODEC_FLAG_PASS2 = $0400; // (1 << 10) -(** - * loop filter. - *) - AV_CODEC_FLAG_LOOP_FILTER = $0800; // (1 << 11) -(** - * Only decode/encode grayscale. - *) - AV_CODEC_FLAG_GRAY = $2000; // (1 << 13) -(** - * error[?] variables will be set during encoding. - *) - AV_CODEC_FLAG_PSNR = $8000; // (1 << 15) -(** - * Input bitstream might be truncated at a random location - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG_TRUNCATED = $10000; // (1 << 16) -(** - * Use interlaced DCT. - *) - AV_CODEC_FLAG_INTERLACED_DCT = $40000; // (1 << 18) -(** - * Force low delay. - *) - AV_CODEC_FLAG_LOW_DELAY = $80000; // (1 << 19) -(** - * Place global headers in extradata instead of every keyframe. - *) - AV_CODEC_FLAG_GLOBAL_HEADER = $400000; // (1 << 22) -(** - * Use only bitexact stuff (except (I)DCT). - *) - AV_CODEC_FLAG_BITEXACT = $800000; // (1 << 23) -(* Fx : Flag for H.263+ extra options *) -(** - * H.263 advanced intra coding / MPEG-4 AC prediction - *) - AV_CODEC_FLAG_AC_PRED = $1000000; // (1 << 24) -(** - * interlaced motion estimation - *) - AV_CODEC_FLAG_INTERLACED_ME = $20000000; // (1 << 29) - AV_CODEC_FLAG_CLOSED_GOP = $80000000; // (1U << 31) - -(** - * Allow non spec compliant speedup tricks. - *) - AV_CODEC_FLAG2_FAST = $0001; // (1 << 0) -(** - * Skip bitstream encoding. - *) - AV_CODEC_FLAG2_NO_OUTPUT = $0004; // (1 << 2) -(** - * Place global headers at every keyframe instead of in extradata. - *) - AV_CODEC_FLAG2_LOCAL_HEADER = $0008; // (1 << 3) - -(** - * timecode is in drop frame format. DEPRECATED!!!! - *) - AV_CODEC_FLAG2_DROP_FRAME_TIMECODE = $2000; // (1 << 13) - -(** - * Input bitstream might be truncated at a packet boundaries - * instead of only at frame boundaries. - *) - AV_CODEC_FLAG2_CHUNKS = $8000; // (1 << 15) -(** - * Discard cropping information from SPS. - *) - AV_CODEC_FLAG2_IGNORE_CROP = $10000; // (1 << 16) - -(** - * Show all frames before the first keyframe - *) - AV_CODEC_FLAG2_SHOW_ALL = $400000; // (1 << 22) -(** - * Export motion vectors through frame side data - *) - AV_CODEC_FLAG2_EXPORT_MVS = $10000000; // (1 << 28) -(** - * Do not skip samples and export skip information as frame side data - *) - AV_CODEC_FLAG2_SKIP_MANUAL = $20000000; // (1 << 29) -(** - * Do not reset ASS ReadOrder field on flush (subtitles decoding) - *) - AV_CODEC_FLAG2_RO_FLUSH_NOOP = $40000000; - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independent Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - -(** - * Decoder can use draw_horiz_band callback. - *) - AV_CODEC_CAP_DRAW_HORIZ_BAND = $0001; // (1 << 0) -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - AV_CODEC_CAP_DR1 = $0002; // (1 << 1) - AV_CODEC_CAP_TRUNCATED = $0008; // (1 << 3) -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - AV_CODEC_CAP_DELAY = $0020; // (1 << 5) -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - AV_CODEC_CAP_SMALL_LAST_FRAME = $0040; // (1 << 6) - -{$IFDEF FF_API_CAP_VDPAU} -(** - * Codec can export data for HW decoding (VDPAU). - *) - AV_CODEC_CAP_HWACCEL_VDPAU = $0080; // (1 << 7) -{$ENDIF} - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carrying such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - AV_CODEC_CAP_SUBFRAMES = $0100; // (1 << 8) -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - AV_CODEC_CAP_EXPERIMENTAL = $0200; // (1 << 9) -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - AV_CODEC_CAP_CHANNEL_CONF = $0400; // (1 << 10) -(** - * Codec supports frame-level multithreading. - *) - AV_CODEC_CAP_FRAME_THREADS = $1000; // (1 << 12) -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - AV_CODEC_CAP_SLICE_THREADS = $2000; // (1 << 13) -(** - * Codec supports changed parameters at any point. - *) - AV_CODEC_CAP_PARAM_CHANGE = $4000; // (1 << 14) -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - AV_CODEC_CAP_AUTO_THREADS = $8000; // (1 << 15) -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - AV_CODEC_CAP_VARIABLE_FRAME_SIZE = $10000; // (1 << 16) -(** - * Decoder is not a preferred choice for probing. - * This indicates that the decoder is not a good choice for probing. - * It could for example be an expensive to spin up hardware decoder, - * or it could simply not provide a lot of useful information about - * the stream. - * A decoder marked with this flag should only be used as last resort - * choice for probing. - *) - AV_CODEC_CAP_AVOID_PROBING = $20000; // (1 << 17) - -(** - * Codec is intra only. - *) - AV_CODEC_CAP_INTRA_ONLY = $40000000; -(** - * Codec is lossless. - *) - AV_CODEC_CAP_LOSSLESS = $80000000; - - -{$IFDEF FF_API_WITHOUT_PREFIX} -(** - * Allow decoders to produce frames with data planes that are not aligned - * to CPU requirements (e.g. due to cropping). - *) - CODEC_FLAG_UNALIGNED = AV_CODEC_FLAG_UNALIGNED; - CODEC_FLAG_QSCALE = AV_CODEC_FLAG_QSCALE; - CODEC_FLAG_4MV = AV_CODEC_FLAG_4MV; - CODEC_FLAG_OUTPUT_CORRUPT = AV_CODEC_FLAG_OUTPUT_CORRUPT; - CODEC_FLAG_QPEL = AV_CODEC_FLAG_QPEL; -{$IFDEF FF_API_GMC} -(** - * @deprecated use the "gmc" private option of the libxvid encoder - *) - CODEC_FLAG_GMC = $0020; ///< use GMC. -{$IFEND} -{$IFDEF FF_API_MV0} -(** - * @deprecated use the flag "mv0" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. -{$IFEND} -{$IFDEF FF_API_INPUT_PRESERVED} -(** - * @deprecated passing reference-counted frames to the encoders replaces this - * flag - *) - CODEC_FLAG_INPUT_PRESERVED = $0100; -{$IFEND} - CODEC_FLAG_PASS1 = AV_CODEC_FLAG_PASS1; - CODEC_FLAG_PASS2 = AV_CODEC_FLAG_PASS2; - CODEC_FLAG_GRAY = AV_CODEC_FLAG_GRAY; -{$IFDEF FF_API_EMU_EDGE} - (** - * @deprecated edges are not used/required anymore. I.e. this flag is now always - * set. - *) - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges -{$IFEND} - CODEC_FLAG_PSNR = AV_CODEC_FLAG_PSNR; - CODEC_FLAG_TRUNCATED = AV_CODEC_FLAG_TRUNCATED; - -{$IFDEF FF_API_NORMALIZE_AQP} -(** - * @deprecated use the flag "naq" in the "mpv_flags" private option of the - * mpegvideo encoders - *) - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization -{$IFEND} - CODEC_FLAG_INTERLACED_DCT = AV_CODEC_FLAG_INTERLACED_DCT; - CODEC_FLAG_LOW_DELAY = AV_CODEC_FLAG_LOW_DELAY; - CODEC_FLAG_GLOBAL_HEADER = AV_CODEC_FLAG_GLOBAL_HEADER; - CODEC_FLAG_BITEXACT = AV_CODEC_FLAG_BITEXACT; - CODEC_FLAG_AC_PRED = AV_CODEC_FLAG_AC_PRED; - CODEC_FLAG_LOOP_FILTER = AV_CODEC_FLAG_LOOP_FILTER; - CODEC_FLAG_INTERLACED_ME = AV_CODEC_FLAG_INTERLACED_ME; - CODEC_FLAG_CLOSED_GOP = AV_CODEC_FLAG_CLOSED_GOP; - CODEC_FLAG2_FAST = AV_CODEC_FLAG2_FAST; - CODEC_FLAG2_NO_OUTPUT = AV_CODEC_FLAG2_NO_OUTPUT; - CODEC_FLAG2_LOCAL_HEADER = AV_CODEC_FLAG2_LOCAL_HEADER; - CODEC_FLAG2_DROP_FRAME_TIMECODE = AV_CODEC_FLAG2_DROP_FRAME_TIMECODE; - CODEC_FLAG2_IGNORE_CROP = AV_CODEC_FLAG2_IGNORE_CROP; - - CODEC_FLAG2_CHUNKS = AV_CODEC_FLAG2_CHUNKS; - CODEC_FLAG2_SHOW_ALL = AV_CODEC_FLAG2_SHOW_ALL; - CODEC_FLAG2_EXPORT_MVS = AV_CODEC_FLAG2_EXPORT_MVS; - CODEC_FLAG2_SKIP_MANUAL = AV_CODEC_FLAG2_SKIP_MANUAL; - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = AV_CODEC_CAP_DRAW_HORIZ_BAND; ///< decoder can use draw_horiz_band callback - -(** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = AV_CODEC_CAP_DR1; - CODEC_CAP_TRUNCATED = AV_CODEC_CAP_TRUNCATED; -{$IFDEF FF_API_XVMC} -(* Codec can export data for HW decoding. This flag indicates that - * the codec would call get_format() with list that might contain HW accelerated - * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them - * including raw image format. - * The application can use the passed context to determine bitstream version, - * chroma format, resolution etc. - *) - CODEC_CAP_HWACCEL = $0010; -{$IFEND} - -(** - * Encoder or decoder requires flushing with NULL input at the end in order to - * give the complete and correct output. - * - * NOTE: If this flag is not set, the codec is guaranteed to never be fed with - * with NULL data. The user can still send NULL data to the public encode - * or decode function, but libavcodec will not pass it along to the codec - * unless this flag is set. - * - * Decoders: - * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to get the delayed data until the decoder no longer - * returns frames. - * - * Encoders: - * The encoder needs to be fed with NULL data at the end of encoding until the - * encoder no longer returns data. - * - * NOTE: For encoders implementing the AVCodec.encode2() function, setting this - * flag also means that the encoder must set the pts and duration for - * each output packet. If this flag is not set, the pts and duration will - * be determined by libavcodec from the input frame. - *) - CODEC_CAP_DELAY = AV_CODEC_CAP_DELAY; - -(** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = AV_CODEC_CAP_SMALL_LAST_FRAME; - -(** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = AV_CODEC_CAP_HWACCEL_VDPAU; - -(** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carrying such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = AV_CODEC_CAP_SUBFRAMES; - -(** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = AV_CODEC_CAP_EXPERIMENTAL; - -(** - * Codec should fill in channel configuration and samplerate instead of container - *) - CODEC_CAP_CHANNEL_CONF = AV_CODEC_CAP_CHANNEL_CONF; - -{$IFDEF FF_API_NEG_LINESIZES} -(** - * @deprecated no codecs use this capability - *) - CODEC_CAP_NEG_LINESIZES = $0800; -{$IFEND} - -(** - * Codec supports frame-level multithreading. - *) - CODEC_CAP_FRAME_THREADS = AV_CODEC_CAP_FRAME_THREADS; - -(** - * Codec supports slice-based (or partition-based) multithreading. - *) - CODEC_CAP_SLICE_THREADS = AV_CODEC_CAP_SLICE_THREADS; - -(** - * Codec supports changed parameters at any point. - *) - CODEC_CAP_PARAM_CHANGE = AV_CODEC_CAP_PARAM_CHANGE; - -(** - * Codec supports avctx->thread_count == 0 (auto). - *) - CODEC_CAP_AUTO_THREADS = AV_CODEC_CAP_AUTO_THREADS; - -(** - * Audio encoder supports receiving a different number of samples in each call. - *) - CODEC_CAP_VARIABLE_FRAME_SIZE = AV_CODEC_CAP_VARIABLE_FRAME_SIZE; - -(** - * Codec is intra only. - *) - CODEC_CAP_INTRA_ONLY = AV_CODEC_CAP_INTRA_ONLY; - -(** - * Codec is lossless. - *) - CODEC_CAP_LOSSLESS = AV_CODEC_CAP_LOSSLESS; -{$ENDIF} (* FF_API_WITHOUT_PREFIX *) - -{$IFDEF FF_API_MB_TYPE} - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - // Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) -{$IFEND} - -(** Note bits 24-31 are reserved for codec specific use (H.264 ref0, MPEG-1 0mv, ...) *) - -{$IFDEF FF_API_QSCALE_TYPE} - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - FF_QSCALE_TYPE_VP56 = 3; -{$ENDIF} - -(** - * The decoder will keep a reference to the frame and may reuse it later. - *) - AV_GET_BUFFER_FLAG_REF = 1 << 0; - - FF_COMPRESSION_DEFAULT = -1; -{$IFDEF FF_API_ASPECT_EXTENDED} - FF_ASPECT_EXTENDED = 15; -{$ENDIF} - -{$IFDEF FF_API_RC_STRATEGY} - FF_RC_STRATEGY_XVID = 1; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; -{$ENDIF} - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_MEDIAN_SAD = 15; - FF_CMP_CHROMA = 256; - -{$IFDEF FF_API_AFD} - {attribute_deprecated} - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; -{$IFEND} - -{$IFDEF FF_API_QUANT_BIAS} - FF_DEFAULT_QUANT_BIAS = 999999; -{$ENDIF} - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG-2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - -{$IFDEF FF_API_CODER_TYPE} - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_CODER_TYPE_DEFLATE = 4; -{$ENDIF} {FF_API_UNUSED_MEMBERS} -{$ENDIF} {FF_API_CODER_TYPE} - FF_BUG_AUTODETECT = 1; ///< autodetection -{$IFDEF FF_API_OLD_MSMPEG4} - FF_BUG_OLD_MSMPEG4 = 2; -{$ENDIF} - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; -{$IFDEF FF_API_AC_VLC} - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default -{$ENDIF} - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - FF_BUG_TRUNCATED = 16384; - FF_BUG_IEDGE = 32768; - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< Allow nonstandardized experimental things. - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - FF_EC_FAVOR_INTER = 256; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; -{$IFDEF FF_API_DEBUG_MV} -(** - * @deprecated this option does nothing - *) - FF_DEBUG_MV = 32; -{$ENDIF} - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_DEBUG_PTS = $00000200; -{$ENDIF} - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; -{$IFDEF FF_API_DEBUG_MV} - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; -{$ENDIF} - FF_DEBUG_BUFFERS = $00008000; - FF_DEBUG_THREADS = $00010000; - FF_DEBUG_GREEN_MD = $00800000; - FF_DEBUG_NOMC = $01000000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; // visualize forward predicted MVs of P-frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; // visualize forward predicted MVs of B-frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; // visualize backward predicted MVs of B-frames - -(** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - *) - AV_EF_CRCCHECK = 1; - AV_EF_BITSTREAM = 2; ///< detect bitstream specification deviations - AV_EF_BUFFER = 4; ///< detect improper bitstream length - AV_EF_EXPLODE = 8; ///< abort decoding on minor error detection - - AV_EF_IGNORE_ERR = 32768; ///< ignore errors and continue - AV_EF_CAREFUL = 65536; ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors - AV_EF_COMPLIANT = 131072; ///< consider all spec non compliances as errors - AV_EF_AGGRESSIVE = 262144; ///< consider things that a sane encoder should not do as an error - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; -{$IFDEF FF_API_ARCH_SH4} - FF_IDCT_SH4 = 9; -{$ENDIF} - FF_IDCT_SIMPLEARM = 10; -{$IFDEF FF_API_UNUSED_MEMBERS} - FF_IDCT_IPP = 13; -{$ENDIF} - FF_IDCT_XVID = 14; -{$IFDEF FF_API_IDCT_XVIDMMX} - FF_IDCT_XVIDMMX = 14; -{$ENDIF} - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; -{$IFDEF FF_API_ARCH_SPARC} - FF_IDCT_SIMPLEVIS = 18; -{$ENDIF} - FF_IDCT_FAAN = 20; - FF_IDCT_SIMPLENEON = 22; -{$IFDEF FF_API_ARCH_ALPHA} - FF_IDCT_SIMPLEALPHA = 23; -{$ENDIF} - FF_IDCT_NONE = 24; (* Used by XvMC to extract IDCT coefficients with FF_IDCT_PERM_NONE *) - FF_IDCT_SIMPLEAUTO = 128; - - FF_THREAD_FRAME = 1; ///< Decode more than one frame at once - FF_THREAD_SLICE = 2; ///< Decode more than one part of a single frame at once - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_RESERVED = -100; - - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - FF_PROFILE_AAC_HE = 4; - FF_PROFILE_AAC_HE_V2 = 28; - FF_PROFILE_AAC_LD = 22; - FF_PROFILE_AAC_ELD = 38; - FF_PROFILE_MPEG2_AAC_LOW = 128; - FF_PROFILE_MPEG2_AAC_HE = 131; - - FF_PROFILE_DNXHD = 0; - FF_PROFILE_DNXHR_LB = 1; - FF_PROFILE_DNXHR_SQ = 2; - FF_PROFILE_DNXHR_HQ = 3; - FF_PROFILE_DNXHR_HQX = 4; - FF_PROFILE_DNXHR_444 = 5; - - FF_PROFILE_DTS = 20; - FF_PROFILE_DTS_ES = 30; - FF_PROFILE_DTS_96_24 = 40; - FF_PROFILE_DTS_HD_HRA = 50; - FF_PROFILE_DTS_HD_MA = 60; - FF_PROFILE_DTS_EXPRESS = 70; - - FF_PROFILE_MPEG2_422 = 0; - FF_PROFILE_MPEG2_HIGH = 1; - FF_PROFILE_MPEG2_SS = 2; - FF_PROFILE_MPEG2_SNR_SCALABLE = 3; - FF_PROFILE_MPEG2_MAIN = 4; - FF_PROFILE_MPEG2_SIMPLE= 5; - - FF_PROFILE_H264_CONSTRAINED = (1 shl 9); // 8+1; constraint_set1_flag - FF_PROFILE_H264_INTRA = (1 shl 11); // 8+3; constraint_set3_flag - - FF_PROFILE_H264_BASELINE = 66; - FF_PROFILE_H264_CONSTRAINED_BASELINE = (66 or FF_PROFILE_H264_CONSTRAINED); - FF_PROFILE_H264_MAIN = 77; - FF_PROFILE_H264_EXTENDED = 88; - FF_PROFILE_H264_HIGH = 100; - FF_PROFILE_H264_HIGH_10 = 110; - FF_PROFILE_H264_HIGH_10_INTRA = (110 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_MULTIVIEW_HIGH = 118; - FF_PROFILE_H264_HIGH_422 = 122; - FF_PROFILE_H264_HIGH_422_INTRA = (122 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_STEREO_HIGH = 128; - FF_PROFILE_H264_HIGH_444 = 144; - FF_PROFILE_H264_HIGH_444_PREDICTIVE = 244; - FF_PROFILE_H264_HIGH_444_INTRA = (244 or FF_PROFILE_H264_INTRA); - FF_PROFILE_H264_CAVLC_444 = 44; - - FF_PROFILE_VC1_SIMPLE = 0; - FF_PROFILE_VC1_MAIN = 1; - FF_PROFILE_VC1_COMPLEX = 2; - FF_PROFILE_VC1_ADVANCED = 3; - - FF_PROFILE_MPEG4_SIMPLE = 0; - FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 1; - FF_PROFILE_MPEG4_CORE = 2; - FF_PROFILE_MPEG4_MAIN = 3; - FF_PROFILE_MPEG4_N_BIT = 4; - FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 5; - FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6; - FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7; - FF_PROFILE_MPEG4_HYBRID = 8; - FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9; - FF_PROFILE_MPEG4_CORE_SCALABLE = 10; - FF_PROFILE_MPEG4_ADVANCED_CODING = 11; - FF_PROFILE_MPEG4_ADVANCED_CORE = 12; - FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13; - FF_PROFILE_MPEG4_SIMPLE_STUDIO = 14; - FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 15; - - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 1; - FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 2; - FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 32768; - FF_PROFILE_JPEG2000_DCINEMA_2K = 3; - FF_PROFILE_JPEG2000_DCINEMA_4K = 4; - - FF_PROFILE_VP9_0 = 0; - FF_PROFILE_VP9_1 = 1; - FF_PROFILE_VP9_2 = 2; - FF_PROFILE_VP9_3 = 3; - - FF_PROFILE_HEVC_MAIN = 1; - FF_PROFILE_HEVC_MAIN_10 = 2; - FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; - FF_PROFILE_HEVC_REXT = 4; - - - FF_LEVEL_UNKNOWN = -99; - -type - - (** - * This structure describes the bitrate properties of an encoded bitstream. It - * roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD - * parameters for H.264/HEVC. - *) - PAVCPBProperties = ^TAVCPBProperties; - TAVCPBProperties = record - (** - * Maximum bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - max_bitrate: cint; - (** - * Minimum bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - min_bitrate: cint; - (** - * Average bitrate of the stream, in bits per second. - * Zero if unknown or unspecified. - *) - avg_bitrate: cint; - - (** - * The size of the buffer to which the ratecontrol is applied, in bits. - * Zero if unknown or unspecified. - *) - buffer_size: cint; - - (** - * The delay between the time the packet this structure is associated with - * is received and the time when it should be decoded, in periods of a 27MHz - * clock. - * - * UINT64_MAX when unknown or unspecified. - *) - vbv_delay: cuint64; - end; {TAVCPBProperties} - - TAVPacketSideDataType = ( - (** - * An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE - * bytes worth of palette. This side data signals that a new palette is - * present. - *) - AV_PKT_DATA_PALETTE, - - (** - * The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format - * that the extradata buffer was changed and the receiving side should - * act upon it appropriately. The new extradata is embedded in the side - * data buffer and should be immediately used for processing the current - * frame or packet. - *) - AV_PKT_DATA_NEW_EXTRADATA, - - (** - * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: - * @code - * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) - * s32le sample_rate - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) - * s32le width - * s32le height - * @endcode - *) - AV_PKT_DATA_PARAM_CHANGE, - - (** - * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of - * structures with info about macroblocks relevant to splitting the - * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). - * That is, it does not necessarily contain info about all macroblocks, - * as long as the distance between macroblocks in the info is smaller - * than the target payload size. - * Each MB info structure is 12 bytes, and is laid out as follows: - * @code - * u32le bit offset from the start of the packet - * u8 current quantizer at the start of the macroblock - * u8 GOB number - * u16le macroblock address within the GOB - * u8 horizontal MV predictor - * u8 vertical MV predictor - * u8 horizontal MV predictor for block number 3 - * u8 vertical MV predictor for block number 3 - * @endcode - *) - AV_PKT_DATA_H263_MB_INFO, - - (** - * This side data should be associated with an audio stream and contains - * ReplayGain information in form of the AVReplayGain struct. - *) - AV_PKT_DATA_REPLAYGAIN, - - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the decoded video frames for - * correct presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_PKT_DATA_DISPLAYMATRIX, - - (** - * This side data should be associated with a video stream and contains - * Stereoscopic 3D information in form of the AVStereo3D struct. - *) - AV_PKT_DATA_STEREO3D, - - (** - * This side data should be associated with an audio stream and corresponds - * to enum AVAudioServiceType. - *) - AV_PKT_DATA_AUDIO_SERVICE_TYPE, - - (** - * This side data contains quality related information from the encoder. - * @code - * u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad). - * u8 picture type - * u8 error count - * u16 reserved - * u64le[error count] sum of squared differences between encoder in and output - * @endcode - *) - AV_PKT_DATA_QUALITY_STATS, - - (** - * This side data contains an integer value representing the stream index - * of a "fallback" track. A fallback track indicates an alternate - * track to use when the current track can not be decoded for some reason. - * e.g. no decoder available for codec. - *) - AV_PKT_DATA_FALLBACK_TRACK, - - (** - * This side data corresponds to the AVCPBProperties struct. - *) - AV_PKT_DATA_CPB_PROPERTIES, - - (** - * Recommmends skipping the specified number of samples - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_PKT_DATA_SKIP_SAMPLES=70, - - (** - * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that - * the packet may contain "dual mono" audio specific to Japanese DTV - * and if it is true, recommends only the selected channel to be used. - * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) - * @endcode - *) - AV_PKT_DATA_JP_DUALMONO, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. - *) - AV_PKT_DATA_STRINGS_METADATA, - - (** - * Subtitle event position - * @code - * u32le x1 - * u32le y1 - * u32le x2 - * u32le y2 - * @endcode - *) - AV_PKT_DATA_SUBTITLE_POSITION, - - (** - * Data found in BlockAdditional element of matroska container. There is - * no end marker for the data, so it is required to rely on the side data - * size to recognize the end. 8 byte id (as found in BlockAddId) followed - * by data. - *) - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - - (** - * The optional first identifier line of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_IDENTIFIER, - - (** - * The optional settings (rendering instructions) that immediately - * follow the timestamp specifier of a WebVTT cue. - *) - AV_PKT_DATA_WEBVTT_SETTINGS, - - (** - * A list of zero terminated key/value strings. There is no end marker for - * the list, so it is required to rely on the side data size to stop. This - * side data includes updated metadata which appeared in the stream. - *) - AV_PKT_DATA_METADATA_UPDATE, - - (** - * MPEGTS stream ID, this is required to pass the stream ID - * information from the demuxer to the corresponding muxer. - *) - AV_PKT_DATA_MPEGTS_STREAM_ID, - - (** - * Mastering display metadata (based on SMPTE-2086:2014). This metadata - * should be associated with a video stream and contains data in the form - * of the AVMasteringDisplayMetadata struct. - *) - AV_PKT_DATA_MASTERING_DISPLAY_METADATA, - - (** - * This side data should be associated with a video stream and corresponds - * to the AVSphericalMapping structure. - *) - AV_PKT_DATA_SPHERICAL, - - (** - * Content light level (based on CTA-861.3). This metadata should be - * associated with a video stream and contains data in the form of the - * AVContentLightMetadata struct. - *) - AV_PKT_DATA_CONTENT_LIGHT_LEVEL, - - (** - * ATSC A53 Part 4 Closed Captions. This metadata should be associated with - * a video stream. A53 CC bitstream is stored as uint8_t in AVPacketSideData.data. - * The number of bytes of CC data is AVPacketSideData.size. - *) - AV_PKT_DATA_A53_CC, - - (** - * The number of side data elements (in fact a bit more than it). - * This is not part of the public API/ABI in the sense that it may - * change when new side data types are added. - * This must stay the last enum value. - * If its value becomes huge, some code using it - * needs to be updated as it assumes it to be smaller than other limits. - *) - AV_PKT_DATA_NB - ); - - PAVPacketSideData = ^TAVPacketSideData; - TAVPacketSideData = record - data: PByte; - size: cint; - type_: TAVPacketSideDataType; - end; - -(** - * This structure stores compressed data. It is typically exported by demuxers - * and then passed as input to decoders, or received as output from encoders and - * then passed to muxers. - * - * For video, it should typically contain one compressed frame. For audio it may - * contain several compressed frames. Encoders are allowed to output empty - * packets, with no compressed data, containing only side data - * (e.g. to update some stream parameters at the end of encoding). - * - * AVPacket is one of the few structs in FFmpeg, whose size is a part of public - * ABI. Thus it may be allocated on stack and no new fields can be added to it - * without libavcodec and libavformat major bump. - * - * The semantics of data ownership depends on the buf field. - * If it is set, the packet data is dynamically allocated and is - * valid indefinitely until a call to av_packet_unref() reduces the - * reference count to 0. - * - * If the buf field is not set av_packet_ref() would make a copy instead - * of increasing the reference count. - * - * The side data is always allocated with av_malloc(), copied by - * av_packet_ref() and freed by av_packet_unref(). - * - * @see av_packet_ref - * @see av_packet_unref - *) - PPAVPacket= ^PAVPacket; - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * A reference to the reference-counted buffer where the packet data is - * stored. - * May be NULL, then the packet data is not reference-counted. - *) - buf: PAVBufferRef; - (* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - (** - * A combination of AV_PKT_FLAG values - *) - flags: cint; - (** - * Additional packet data that can be provided by the container. - * Packet can contain several types of side information. - *) - side_data: PAVPacketSideData; - side_data_elems: cint; - - (* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint64; - - pos: cint64; // byte position in stream, -1 if unknown - -{$IFDEF FF_API_CONVERGENCE_DURATION} - (* - * @deprecated Same as the duration field, but as int64_t. This was required - * for Matroska subtitles, whose duration values could overflow when the - * duration field was still an int. - *) - convergence_duration: cint64; {deprecated} -{$ENDIF} - end; {TAVPacket} - -const - AV_PKT_FLAG_KEY = $0001; ///< The packet contains a keyframe - AV_PKT_FLAG_CORRUPT = $0002; ///< The packet content is corrupted - (** - * Flag is used to discard packets which are required to maintain valid - * decoder state but are not required for output and should be dropped - * after decoding. - **) - AV_PKT_FLAG_DISCARD = $0004; - (** - * The packet comes from a trusted source. - * - * Otherwise-unsafe constructs such as arbitrary pointers to data - * outside the packet may be followed. - *) - AV_PKT_FLAG_TRUSTED = $0008; - - AV_NUM_DATA_POINTERS = 8; - - AV_PKT_DATA_QUALITY_FACTOR = AV_PKT_DATA_QUALITY_STATS; //DEPRECATED - -type - AVSideDataParamChangeFlags = ( - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = $0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = $0002, - AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = $0004, - AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = $0008 - ); - -{ This is removed in avcodec.h. For the time being (2013) only commented -const - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; -} - - -{ This is removed in avcodec.h. For the time being (2013) only commented -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using avcodec_alloc_frame() and freed with - * avcodec_free_frame(). Note that this allocates only the AVFrame itself. The - * buffers for the data must be managed through other means. - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, avcodec_get_frame_defaults() should be used to - * reset the frame to its original clean state before it is reused again. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * Similarly fields that are marked as to be only accessed by - * av_opt_ptr() can be reordered. This allows 2 forks to add fields - * without breaking compatibility with each other. - *) - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * Size, in bytes, of the data for each picture/channel plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * - encoding: Set by user - * - decoding: set by AVCodecContext.get_buffer() - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used by the decoder in order to access all - * channels. - * - * encoding: set by user - * decoding: set by AVCodecContext.get_buffer() - *) - extended_data: pointer of pbyte; - - (** - * width and height of the video frame - * - encoding: unused - * - decoding: Read by user. - *) - width, height: cint; - - (** - * number of audio samples (per channel) described by this frame - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - * - encoding: unused - * - decoding: Read by user. - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: TAVPictureType; - - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - * - encoding: unused - * - decoding: Read by user. - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - - (** - * pts copied from the AVPacket that was decoded to produce this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pts: cint64; - - (** - * dts copied from the AVPacket that triggered returning this frame - * - encoding: unused - * - decoding: Read by user. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - - (** - * - *) - qscale_type: cint; - - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_picture_private: pointer; - - (** - * the AVCodecContext which ff_thread_get_buffer() was last called on - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - owner: PAVCodecContext; - - (** - * used by multithreading to store frame-specific info - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - thread_opaque: pointer; - - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: cuint8; - - (** - * Sample rate of the audio data. - * - * - encoding: unused - * - decoding: read by user - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - * - * - encoding: unused - * - decoding: read by user. - *) - channel_layout: cuint64; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * Code outside libavcodec should access this field using: - * av_frame_get_best_effort_timestamp(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_pos(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * Code outside libavcodec should access this field using: - * av_frame_get_pkt_duration(frame) - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * Code outside libavcodec should access this field using: - * av_frame_get_metadata(frame) - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * Code outside libavcodec should access this field using: - * av_frame_get_decode_error_flags(frame) - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * Code outside libavcodec should access this field using: - * av_frame_get_channels(frame) - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. It must be accessed using av_frame_get_pkt_size() and - * av_frame_set_pkt_size(). - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - end; (** TAVFrame **) - -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; -} - -type - TAVCodecInternal = record - end; - - PAVCodecInternal = ^TAVCodecInternal; - PAVCodecContext = ^TAVCodecContext; - - PAVClass = ^TAVClass; - - PPAVCodec = ^PAVCodec; - PAVCodec = ^TAVCodec; - - PAVHWAccel = ^TAVHWAccel; - - // int[4] - PAVNDPArray = ^TAVNDPArray; - TAVNDPArray = array [0..AV_NUM_DATA_POINTERS - 1] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; - - TAVFieldOrder = ( - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT //< Bottom coded first, top displayed first - ); - -(** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * You can use AVOptions (av_opt* / av_set/get*()) to access these fields from user - * applications. - * The name string for AVOptions options matches the associated command line - * parameter name and can be found in libavcodec/options_table.h - * The AVOption/command line parameter names differ in some cases from the C - * structure field names for historic reasons or brevity. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context3 - *) - av_class: PAVClass; - log_level_offset: cint; - - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) - codec: PAVCodec; -{$IFDEF FF_API_CODEC_NAME} - (** - * @deprecated this field is not used for anything in libavcodec - *) - {attribute_deprecated} - codec_name: array [0..31] of AnsiChar; -{$IFEND} - codec_id: TAVCodecID; (* see AV_CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger than 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - -{$IFDEF FF_API_STREAM_CODEC_TAG} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - stream_codec_tag: cuint; -{$IFEND} - - priv_data: pointer; - - (** - * Private context used for internal data. - * - * Unlike priv_data, this is not codec-specific. It is used in general - * libavcodec functions. - *) - internal: PAVCodecInternal; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by user, may be overwritten by libavcodec - * if this info is available in the stream - *) - bit_rate: cint64; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - (** - * AV_CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * AV_CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * MJPEG: Huffman tables - * rv10: additional flags - * MPEG-4: global headers (they can be in the bitstream or here) - * The allocated memory should be AV_FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid problems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * This often, but not always is the inverse of the frame rate or field rate - * for video. 1/time_base is not the average frame rate if the frame rate is not - * constant. - * - * Like containers, elementary streams also can store timestamps, 1/time_base - * is the unit in which these timestamps are specified. - * As example of such codec time base see ISO/IEC 14496-2:2001(E) - * vop_time_increment_resolution and fixed_vop_rate - * (fixed_vop_rate == 0 implies that it is different from the framerate) - * - * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. - *) - time_base: TAVRational; - - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - - (** - * Codec delay. - * - * Encoding: Number of frames delay there will be from the encoder input to - * the decoder output. (we assume the decoder matches the spec) - * Decoding: Number of frames delay in addition to what a standard decoder - * as specified in the spec would produce. - * - * Video: - * Number of frames the decoded output will be delayed relative to the - * encoded input. - * - * Audio: - * For encoding, this field is unused (see initial_padding). - * - * For decoding, this is the number of samples the decoder needs to - * output before the decoder's output is valid. When seeking, you should - * start decoding this many samples prior to your desired seek point. - * - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - delay: cint; - - (* video only *) - (** - * picture width / height. - * - * @note Those fields may not match the values of the last - * AVFrame output by avcodec_decode_video2 due frame - * reordering. - * - * - encoding: MUST be set by user. - * - decoding: May be set by the user before opening the decoder if known e.g. - * from the container. Some decoders will require the dimensions - * to be set by the caller. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - width, height: cint; - - (** - * Bitstream width / height, may be different from width/height e.g. when - * the decoded frame is cropped before being output or lowres is enabled. - * - * @note Those field may not match the value of the last - * AVFrame output by avcodec_receive_frame() due frame - * reordering. - * - * - encoding: unused - * - decoding: May be set by the user before opening the decoder if known - * e.g. from the container. During decoding, the decoder may - * overwrite those values as required while parsing the data. - *) - coded_width, coded_height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see AV_PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overridden by the decoder if it knows better. - * - * @note This field may not match the value of the last - * AVFrame output by avcodec_receive_frame() due frame - * reordering. - * - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec while - * parsing the data. - *) - pix_fmt: TAVPixelFormat; - -{$IFDEF FF_API_MOTION_EST} - (** - * This option does nothing - *@deprecated use codec private options instead - *) - {attribute_deprecated} - me_method: cint; -{$ENDIF} - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PAVNDPArray; - y: cint; type_: cint; height: cint); cdecl; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @note The callback may be called again immediately if initialization for - * the selected (hardware-accelerated) pixel format failed. - * @warning Behavior is undefined if the callback returns a value not - * in the fmt list of formats. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - -{$IFDEF FF_API_RC_STRATEGY} - (** @deprecated use codec private option instead *) - {attribute_deprecated} - rc_strategy: cint; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - b_frame_strategy: cint; {deprecated} -{$ENDIF} - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - mpeg_quant: cint; {deprecated} -{$ENDIF} - - (** - * qscale factor between P- and I-frames - * If > 0 then the last P- frame quantizer will be used (q = lastp_q * factor + offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - prediction_method: cint; {deprecated} -{$ENDIF} - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - pre_me: cint; {deprecated} -{$ENDIF} - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - -{$IFDEF FF_API_AFD} - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - * @deprecated Deprecated in favor of AVSideData - *) - {attribute_deprecated} - dtg_active_format: cint; -{$IFEND} - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - -{$IFDEF FF_API_QUANT_BIAS} - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - intra_quant_bias: cint; - - (** - * @deprecated use encoder private option instead - *) - {attribute_deprecated} - inter_quant_bias: cint; -{$ENDIF} - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - -{$IFDEF FF_API_XVMC} - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - * @deprecated XvMC doesn't need it anymore. - *) - xvmc_acceleration: cint; -{$ENDIF} - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - scenechange_threshold: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - noise_reduction: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - me_threshold: cint; - - (** - * @deprecated this field is unused - *) - {attribute_deprecated} - mb_threshold: cint; -{$ENDIF} - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: Set by libavcodec - *) - intra_dc_precision: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - border_masking: cfloat; -{$ENDIF} - (** - * minimum MB Lagrange multiplier - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB Lagrange multiplier - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** - * @deprecated use encoder private options instead - *) - me_penalty_compensation: cint; {deprecated} -{$ENDIF} - - (** - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - brd_scale: cint; {deprecated} -{$ENDIF} - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - chromaoffset: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_UNUSED_MEMBERS} - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; {attribute_deprecated} -{$IFEND} - - (** - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - b_sensitivity: cint; {deprecated} -{$ENDIF} - - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - - (** - * Number of slices. - * Indicates number of picture subdivisions. Used for parallelized - * decoding. - * - encoding: Set by user - * - decoding: unused - *) - slices: cint; - - (** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - *) - field_order: TAVFieldOrder; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Number of samples per channel in an audio frame. - * - * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame - * except the last must contain exactly frame_size samples per channel. - * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then the - * frame size is not restricted. - * - decoding: may be set by some decoders to indicate constant frame size - *) - frame_size: cint; - - (** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - *) - frame_number: cint; ///< audio or video frame number - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - *) - channel_layout: cuint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cuint64; - - (** - * Type of service that the audio stream conveys. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - audio_service_type: TAVAudioServiceType; - - (** - * desired sample format - * - encoding: Not used. - * - decoding: Set by user. - * Decoder will decode to this format if it can. - *) - request_sample_fmt: TAVSampleFormat; - - (** - * This callback is called at the beginning of each frame to get data - * buffer(s) for it. There may be one contiguous buffer for all the data or - * there may be a buffer per each data plane or anything in between. What - * this means is, you may set however many entries in buf[] you feel necessary. - * Each buffer must be reference-counted using the AVBuffer API (see description - * of buf[] below). - * - * The following fields will be set in the frame before this callback is - * called: - * - format - * - width, height (video only) - * - sample_rate, channel_layout, nb_samples (audio only) - * Their values may differ from the corresponding values in - * AVCodecContext. This callback must use the frame values, not the codec - * context values, to calculate the required buffer size. - * - * This callback must fill the following fields in the frame: - * - data[] - * - linesize[] - * - extended_data: - * * if the data is planar audio with more than 8 channels, then this - * callback must allocate and fill extended_data to contain all pointers - * to all data planes. data[] must hold as many pointers as it can. - * extended_data must be allocated with av_malloc() and will be freed in - * av_frame_unref(). - * * otherwise extended_data must point to data - * - buf[] must contain one or more pointers to AVBufferRef structures. Each of - * the frame's data and extended_data pointers must be contained in these. That - * is, one AVBufferRef for each allocated chunk of memory, not necessarily one - * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), - * and av_buffer_ref(). - * - extended_buf and nb_extended_buf must be allocated with av_malloc() by - * this callback and filled with the extra buffers if there are more - * buffers than buf[] can hold. extended_buf will be freed in - * av_frame_unref(). - * - * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call - * avcodec_default_get_buffer2() instead of providing buffers allocated by - * some other means. - * - * Each data plane must be aligned to the maximum required by the target - * CPU. - * - * @see avcodec_default_get_buffer2() - * - * Video: - * - * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused - * (read and/or written to if it is writable) later by libavcodec. - * - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * - * Some decoders do not support linesizes changing between frames. - * - * If frame multithreading is used and thread_safe_callbacks is set, - * this callback may be called from a different thread, but not from more - * than one at once. Does not need to be reentrant. - * - * @see avcodec_align_dimensions2() - * - * Audio: - * - * Decoders request a buffer of a particular size by setting - * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, - * however, utilize only part of the buffer by setting AVFrame.nb_samples - * to a smaller value in the output frame. - * - * As a convenience, av_samples_get_buffer_size() and - * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() - * functions to find the required data size and to fill data pointers and - * linesize. In AVFrame.linesize, only linesize[0] may be set for audio - * since all planes must be the same size. - * - * @see av_samples_get_buffer_size(), av_samples_fill_arrays() - * - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer2: function (s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; cdecl; - - (** - * If non-zero, the decoded audio and video frames returned from - * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted - * and are valid indefinitely. The caller must free them with - * av_frame_unref() when they are not needed anymore. - * Otherwise, the decoded frames must not be freed by the caller and are - * only valid until the next decode call. - * - * This is always automatically enabled if avcodec_receive_frame() is used. - * - * - encoding: unused - * - decoding: set by the caller before avcodec_open2(). - *) - {attribute_deprecated} - refcounted_frames: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_qsquish: cfloat; - - {attribute_deprecated} - rc_qmod_amp: cfloat; - {attribute_deprecated} - rc_qmod_freq: cint; -{$ENDIF} - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override_count: cint; - rc_override: PRcOverride; -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_eq: {const} PAnsiChar; -{$ENDIF} - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: Set by user, may be overwritten by libavcodec. - *) - rc_max_rate: cint64; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint64; - -{$IFDEF FF_API_MPV_OPT} - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - rc_buffer_aggressivity: cfloat; - - {attribute_deprecated} - rc_initial_cplx: cfloat; -{$ENDIF} - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - -{$IFDEF FF_API_CODER_TYPE} - (** - * @deprecated use encoder private options instead - *) - coder_type: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - context_model: cint; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_MPV_OPT} - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmin: cint; - - (** - * @deprecated use encoder private options instead - *) - {attribute_deprecated} - lmax: cint; -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - frame_skip_threshold: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_factor: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_exp: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - frame_skip_cmp: cint; {deprecated} -{$ENDIF} - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - -{$IFDEF FF_API_PRIVATE_OPT} - (** @deprecated use encoder private options instead *) - min_prediction_order: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - max_prediction_order: cint; {deprecated} - - (** @deprecated use encoder private options instead *) - timecode_frame_start: cint64; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_RTP_CALLBACK} - (** - * @deprecated unused - *) - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_PRIVATE_OPT} - rtp_payload_size: cint; {deprecated} (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) -{$ENDIF} - -{$IFDEF FF_API_STAT_BITS} - (* statistics, used for 2-pass encoding *) - mv_bits: cint; {deprecated} - header_bits: cint; {deprecated} - i_tex_bits: cint; {deprecated} - p_tex_bits: cint; {deprecated} - i_count: cint; {deprecated} - p_count: cint; {deprecated} - skip_count: cint; {deprecated} - misc_bits: cint; {deprecated} - - (** @deprecated this field is unused *) - frame_bits: cint; {deprecated} -{$ENDIF} - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PAnsiChar; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PAnsiChar; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * strictly follow the standard (MPEG-4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * debug - * Code outside libavcodec should access this field using AVOptions - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - -{$IFDEF FF_API_DEBUG_MV} - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * Error recognition; may misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - err_recognition: cint; - - (** - * opaque 64-bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - - (** - * error - * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - -{$IFDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; -{$ENDIF} - -{$IFDEF FF_API_CODED_FRAME} - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: unused - * - * @deprecated use the quality factor packet side data instead - *) - {attribute_deprecated} - coded_frame: PAVFrame; -{$ENDIF} - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * Which multithreading methods to use. - * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, - * so clients which cannot provide future frames should not use it. - * - * - encoding: Set by user, otherwise the default is used. - * - decoding: Set by user, otherwise the default is used. - *) - thread_type: cint; - - (** - * Which multithreading methods are in use by the codec. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - active_thread_type: cint; - - (** - * Set by the client if its custom get_buffer() callback can be called - * from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_safe_callbacks: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - - (** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * Skip loop filtering for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * Skip IDCT/dequantization for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * Skip decoding for selected frames. - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - *) - subtitle_header: Pcuint8; - subtitle_header_size: cint; - -{$IFDEF FF_API_ERROR_RATE} - (** - * @deprecated use the 'error_rate' private AVOption of the mpegvideo - * encoders - *) - error_rate: cint; -{$ENDIF} - -{$IFDEF FF_API_VBV_DELAY} - (** - * VBV delay coded in the last frame (in periods of a 27 MHz clock). - * Used for compliant TS muxing. - * - encoding: Set by libavcodec. - * - decoding: unused. - * @deprecated this value is now exported as a part of - * AV_PKT_DATA_CPB_PROPERTIES packet side data - *) - vbv_delay: cuint64; {deprecated} -{$ENDIF} - -{$IFDEF FF_API_SIDEDATA_ONLY_PKT} - (** - * Encoding only and set by default. Allow encoders to output packets - * that do not contain any encoded data, only side data. - * - * Some encoders need to output such packets, e.g. to update some stream - * parameters at the end of encoding. - * - * @deprecated this field disables the default behaviour and - * it is kept only for compatibility. - *) - side_data_only_packets: cint; {deprecated} -{$ENDIF} - - (** - * Audio only. The number of "priming" samples (padding) inserted by the - * encoder at the beginning of the audio. I.e. this number of leading - * decoded samples must be discarded by the caller to get the original audio - * without leading padding. - * - * - decoding: unused - * - encoding: Set by libavcodec. The timestamps on the output packets are - * adjusted by the encoder so that they always refer to the - * first sample of the data actually contained in the packet, - * including any added padding. E.g. if the timebase is - * 1/samplerate and the timestamp of the first input sample is - * 0, the timestamp of the first output packet will be - * -initial_padding. - *) - initial_padding: cint; - - (** - * - decoding: For codecs that store a framerate value in the compressed - * bitstream, the decoder may export it here. { 0, 1} when - * unknown. - * - encoding: May be used to signal the framerate of CFR content to an - * encoder. - *) - framerate: TAVRational; - - (** - * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - * - encoding: unused. - * - decoding: Set by libavcodec before calling get_format() - *) - sw_pix_fmt: TAVPixelFormat; - - (** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * - encoding unused. - * - decoding set by user - *) - pkt_timebase: TAVRational; - - (** - * AVCodecDescriptor - * - encoding: unused. - * - decoding: set by libavcodec. - *) - codec_descriptor: PAVCodecDescriptor; - -{$IFNDEF FF_API_LOWRES} - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; -{$ENDIF} - - (** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - *) - pts_correction_num_faulty_pts: cint64; /// Number of incorrect PTS values so far - pts_correction_num_faulty_dts: cint64; /// Number of incorrect DTS values so far - pts_correction_last_pts: cint64; /// PTS of the last frame - pts_correction_last_dts: cint64; /// DTS of the last frame - - (** - * Character encoding of the input subtitles file. - * - decoding: set by user - * - encoding: unused - *) - sub_charenc: PAnsiChar; - - (** - * Subtitles character encoding mode. Formats or codecs might be adjusting - * this setting (if they are doing the conversion themselves for instance). - * - decoding: set by libavcodec - * - encoding: unused - *) - sub_charenc_mode: cint; - - (** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * - * - decoding: set by user - * - encoding: unused - *) - skip_alpha: cint; - - (** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - *) - seek_preroll: cint; - -{$IFNDEF FF_API_DEBUG_MV} - (** - * debug motion vectors - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; -{$ENDIF} - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: unused. - *) - chroma_intra_matrix: PWord; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * - encoding: Set by user. - * - decoding: Set by user. - *) - dump_separator: Pcuint8; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user - *) - codec_whitelist: PAnsiChar; - - (** - * Properties of the stream that gets decoded - * - encoding: unused - * - decoding: set by libavcodec - *) - properties: cuint; - - (** - * Additional data associated with the entire coded stream. - * - * - decoding: unused - * - encoding: may be set by libavcodec after avcodec_open2(). - *) - coded_side_data: PAVPacketSideData; - nb_coded_side_data: cint; - - (** - * A reference to the AVHWFramesContext describing the input (for encoding) - * or output (decoding) frames. The reference is set by the caller and - * afterwards owned (and freed) by libavcodec - it should never be read by - * the caller after being set. - * - * - decoding: This field should be set by the caller from the get_format() - * callback. The previous reference (if any) will always be - * unreffed by libavcodec before the get_format() call. - * - * If the default get_buffer2() is used with a hwaccel pixel - * format, then this AVHWFramesContext will be used for - * allocating the frame buffers. - * - * - encoding: For hardware encoders configured to use a hwaccel pixel - * format, this field should be set by the caller to a reference - * to the AVHWFramesContext describing input frames. - * AVHWFramesContext.format must be equal to - * AVCodecContext.pix_fmt. - * - * This field should be set before avcodec_open2() is called. - *) - hw_frames_ctx: PAVBufferRef; - - (** - * Control the form of AVSubtitle.rects[N]->ass - * - decoding: set by user - * - encoding: unused - *) - sub_text_format: cint; - - (** - * Audio only. The amount of padding (in samples) appended by the encoder to - * the end of the audio. I.e. this number of decoded samples must be - * discarded by the caller from the end of the stream to get the original - * audio without any trailing padding. - * - * - decoding: unused - * - encoding: unused - *) - trailing_padding: cint; - - (** - * The number of pixels per image to maximally accept. - * - * - decoding: set by user - * - encoding: set by user - *) - max_pixels: cint64; - - (** - * A reference to the AVHWDeviceContext describing the device which will - * be used by a hardware encoder/decoder. The reference is set by the - * caller and afterwards owned (and freed) by libavcodec. - * - * This should be used if either the codec device does not require - * hardware frames or any that are used are to be allocated internally by - * libavcodec. If the user wishes to supply any of the frames used as - * encoder input or decoder output then hw_frames_ctx should be used - * instead. When hw_frames_ctx is set in get_format() for a decoder, this - * field will be ignored while decoding the associated stream segment, but - * may again be used on a following one after another get_format() call. - * - * For both encoders and decoders this field should be set before - * avcodec_open2() is called and must not be written to thereafter. - * - * Note that some decoders may require this field to be set initially in - * order to support hw_frames_ctx at all - in that case, all frames - * contexts used must be created on the same device. - *) - hw_device_ctx: PAVBufferRef; - - (** - * Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated - * decoding (if active). - * - encoding: unused - * - decoding: Set by user (either before avcodec_open2(), or in the - * AVCodecContext.get_format callback) - *) - hwaccel_flags: cint; - - (** - * Video decoding only. Certain video codecs support cropping, meaning that - * only a sub-rectangle of the decoded frame is intended for display. This - * option controls how cropping is handled by libavcodec. - * - * When set to 1 (the default), libavcodec will apply cropping internally. - * I.e. it will modify the output frame width/height fields and offset the - * data pointers (only by as much as possible while preserving alignment, or - * by the full amount if the AV_CODEC_FLAG_UNALIGNED flag is set) so that - * the frames output by the decoder refer only to the cropped area. The - * crop_* fields of the output frames will be zero. - * - * When set to 0, the width/height fields of the output frames will be set - * to the coded dimensions and the crop_* fields will describe the cropping - * rectangle. Applying the cropping is left to the caller. - * - * @warning When hardware acceleration with opaque output frames is used, - * libavcodec is unable to apply cropping from the top/left border. - * - * @note when this option is set to zero, the width/height fields of the - * AVCodecContext and output AVFrames have different meanings. The codec - * context fields store display dimensions (with the coded dimensions in - * coded_width/height), while the frame fields store the coded dimensions - * (with the display dimensions being determined by the crop_* fields). - *) - apply_cropping: cint; - end; {TAVCodecContext} - - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - -{$IFDEF FF_API_AVPICTURE} - (** - * @defgroup lavc_picture AVPicture - * - * Functions for working with AVPicture - * @{ - *) - - (** - * Picture data structure. - * - * Up to four components can be stored into it, the last component is - * alpha. - * @deprecated use AVFrame or imgutils functions instead - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; {deprecated} - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; {deprecated} ///< number of bytes per line - end; {TAVPicture} -{$ENDIF} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - -{$IFDEF FF_API_AVPICTURE} - (** - * @deprecated unused - *) - pict: TAVPicture; {deprecated} -{$ENDIF} - (** - * data+linesize for the bitmap of this subtitle. - * Can be set for text/ass as well once they are rendered. - *) - data: Array [0..4] of PByte; - linesize: Array [0..4] of cint; - - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - - (** - * This struct describes the properties of an encoded stream. - * - * sizeof(AVCodecParameters) is not a part of the public ABI, this struct must - * be allocated with avcodec_parameters_alloc() and freed with - * avcodec_parameters_free(). - *) - PPAVCodecParameters = ^PAVCodecParameters; - PAVCodecParameters = ^TAVCodecParameters; - TAVCodecParameters = record - (** - * General type of the encoded data. - *) - codec_type: TAVMediaType; - (** - * Specific type of the encoded data (the codec used). - *) - codec_id: TAVCodecID; - (** - * Additional information about the codec (corresponds to the AVI FOURCC). - *) - codec_tag: cuint32; - - (** - * Extra binary data needed for initializing the decoder, codec-dependent. - * - * Must be allocated with av_malloc() and will be freed by - * avcodec_parameters_free(). The allocated size of extradata must be at - * least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding - * bytes zeroed. - *) - extradata: Pcuint8; - (** - * Size of the extradata content in bytes. - *) - extradata_size: cint; - - (** - * - video: the pixel format, the value corresponds to enum AVPixelFormat. - * - audio: the sample format, the value corresponds to enum AVSampleFormat. - *) - format: cint; - - (** - * The average bitrate of the encoded data (in bits per second). - *) - bit_rate: cint64; - - (** - * The number of bits per sample in the codedwords. - * - * This is basically the bitrate per sample. It is mandatory for a bunch of - * formats to actually decode them. It's the number of bits for one sample in - * the actual coded bitstream. - * - * This could be for example 4 for ADPCM - * For PCM formats this matches bits_per_raw_sample - * Can be 0 - *) - bits_per_coded_sample: cint; - - (** - * This is the number of valid bits in each output sample. If the - * sample format has more bits, the least significant bits are additional - * padding bits, which are always 0. Use right shifts to reduce the sample - * to its actual size. For example, audio formats with 24 bit samples will - * have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. - * To get the original sample use "(int32_t)sample >> 8"." - * - * For ADPCM this might be 12 or 16 or similar - * Can be 0 - *) - bits_per_raw_sample: cint; - - (** - * Codec-specific bitstream restrictions that the stream conforms to. - *) - profile: cint; - level: cint; - - (** - * Video only. The dimensions of the video frame in pixels. - *) - width: cint; - height: cint; - - (** - * Video only. The aspect ratio (width / height) which a single pixel - * should have when displayed. - * - * When the aspect ratio is unknown / undefined, the numerator should be - * set to 0 (the denominator may have any value). - *) - sample_aspect_ratio: TAVRational; - - (** - * Video only. The order of the fields in interlaced video. - *) - field_order: TAVFieldOrder; - - (** - * Video only. Additional colorspace characteristics. - *) - color_range: TAVColorRange; - color_primaries: TAVColorPrimaries; - color_trc: TAVColorTransferCharacteristic; - color_space: TAVColorSpace; - chroma_location: TAVChromaLocation; - - (** - * Video only. Number of delayed frames. - *) - video_delay: cint; - - (** - * Audio only. The channel layout bitmask. May be 0 if the channel layout is - * unknown or unspecified, otherwise the number of bits set must be equal to - * the channels field. - *) - channel_layout: cuint64; - (** - * Audio only. The number of audio channels. - *) - channels: cint; - (** - * Audio only. The number of audio samples per second. - *) - sample_rate: cint; - (** - * Audio only. The number of bytes per coded audio frame, required by some - * formats. - * - * Corresponds to nBlockAlign in WAVEFORMATEX. - *) - block_align: cint; - (** - * Audio only. Audio frame size, if known. Required by some formats to be static. - *) - frame_size: cint; - - (** - * Audio only. The amount of padding (in samples) inserted by the encoder at - * the beginning of the audio. I.e. this number of leading decoded samples - * must be discarded by the caller to get the original audio without leading - * padding. - *) - initial_padding: cint; - (** - * Audio only. The amount of padding (in samples) appended by the encoder to - * the end of the audio. I.e. this number of decoded samples must be - * discarded by the caller from the end of the stream to get the original - * audio without any trailing padding. - *) - trailing_padding: cint; - (** - * Audio only. Number of samples to skip after a discontinuity. - *) - seek_preroll: cint; - end; {TAVCodecParameters} - -(** - * AVCodec. - *) - TAVCodec = record - (** - * Name of the codec implementation. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - * This is the primary way to find a codec from the user perspective. - *) - name: PAnsiChar; - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - type_: TAVMediaType; - id: TAVCodecID; - (** - * Codec capabilities. - * see AV_CODEC_CAP_* - *) - capabilities: cint; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - channel_layouts: {const} PCuint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - max_lowres: byte; ///< maximum value for lowres supported by the decoder - priv_class: {const} PAVClass; ///< AVClass for the private context - profiles: {const} PAVProfile; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - priv_data_size: cint; - next: PAVCodec; - (** - * @name Frame-level threading support functions - * @{ - *) - (** - * If defined, called on thread contexts when they are created. - * If the codec allocates writable tables in init(), re-allocate them here. - * priv_data will be set to a copy of the original. - *) - init_thread_copy: function (avctx: PAVCodecContext): Pcint; cdecl; - (** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - *) - update_thread_context: function (dst: PAVCodecContext; src: {const} PAVCodecContext): cint; cdecl; - (** @} *) - - (** - * Private codec-specific defaults. - *) - defaults: {const} pointer; - - (** - * Initialize codec static data, called from avcodec_register(). - *) - init_static_data: procedure (codec: PAVCodec); cdecl; - - init: function (avctx: PAVCodecContext): cint; cdecl; - encode_sub: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; - sub: {const} PAVSubtitle): cint; cdecl; - (** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket (may contain a user-provided buffer) - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - *) - encode2: function (avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; - got_packet_ptr: Pcint): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; avpkt: PAVPacket): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - (** - * Encode API with decoupled packet/frame dataflow. The API is the - * same as the avcodec_ prefixed APIs (avcodec_send_frame() etc.), except - * that: - * - never called if the codec is closed or the wrong type, - * - if AV_CODEC_CAP_DELAY is not set, drain frames are never sent, - * - only one drain frame is ever passed down, - *) - send_frame: function(avctx: PAVCodecContext; frame: {const} PAVFrame): cint; cdecl; - receive_packet: function(avctx: PAVCodecContext; avpkt: PAVPacket): cint; cdecl; - - (** - * Decode API with decoupled packet/frame dataflow. This function is called - * to get one output frame. It should call ff_decode_get_packet() to obtain - * input data. - *) - receive_frame: function(avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - (** - * Internal codec capabilities. - * See FF_CODEC_CAP_* in internal.h - *) - caps_internal: cint; - - (** - * Decoding only, a comma-separated list of bitstream filters to apply to - * packets before decoding. - *) - bsfs: {const} PAnsiChar; - end; {TAVCodec} - - PMpegEncContext = ^TMpegEncContext; - // To be expanded if needed. - TMpegEncContext = record - end; - -(** - * @defgroup lavc_hwaccel AVHWAccel - * @{ - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; - - (** - * Codec implemented by the hardware accelerator. - * - * See AV_CODEC_ID_xxx - *) - id: TAVCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see AV_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVHWAccel; - - (** - * Allocate a custom buffer - *) - alloc_frame: function (avctx: PAVCodecContext; frame: PAVFrame): cint; cdecl; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * The only exception is XvMC, that works on MB level. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: {const} PByteArray; - buf_size: cuint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - frame_priv_data_size: cint; - - (** - * Called for every Macroblock in a slice. - * - * XvMC uses it to replace the mpv_reconstruct_mb(). - * Instead of decoding to raw picture, MB parameters are - * stored in an array provided by the video driver. - * - * @param s the mpeg context - *) - decode_mb: procedure(s: PMpegEncContext); cdecl; - - (** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - *) - init: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - *) - uninit: function (avctx: PAVCodecContext): cint; cdecl; - - (** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - *) - priv_data_size: cint; - - (** - * Internal hwaccel capabilities. - *) - caps_internal: cint; - end; {TAVHWAccel} - -const - (** - * HWAccel is experimental and is thus avoided in favor of non experimental - * codecs - *) - AV_HWACCEL_CODEC_CAP_EXPERIMENTAL = $0200; - - (** - * Hardware acceleration should be used for decoding even if the codec level - * used is unknown or higher than the maximum supported level reported by the - * hardware driver. - * - * It's generally a good idea to pass this flag unless you have a specific - * reason not to, as hardware tends to under-report supported levels. - *) - AV_HWACCEL_FLAG_IGNORE_LEVEL = (1 << 0); - - (** - * Hardware acceleration can output YUV pixel formats with a different chroma - * sampling than 4:2:0 and/or other than 8 bits per component. - *) - AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = (1 << 1); - - (** - * Hardware acceleration should still be attempted for decoding when the - * codec profile does not match the reported capabilities of the hardware. - * - * For example, this can be used to try to decode baseline profile H.264 - * streams in hardware - it will often succeed, because many streams marked - * as baseline profile actually conform to constrained baseline profile. - * - * @warning If the stream is actually not supported then the behaviour is - * undefined, and may include returning entirely incorrect output - * while indicating success. - *) - AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH = (1 << 2); - - FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) - FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself - FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv - - FF_CODEC_PROPERTY_LOSSLESS = $00000001; - FF_CODEC_PROPERTY_CLOSED_CAPTIONS = $00000002; - FF_SUB_TEXT_FMT_ASS = 0; -{$IFDEF FF_API_ASS_TIMING} - FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS = 1; -{$ENDIF} - - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - cdecl; external av__codec; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - cdecl; external av__codec; - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - cdecl; external av__codec; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - cdecl; external av__codec; - - function av_codec_get_codec_properties(avctx: {const} PAVCodecContext): cuint; - cdecl; external av__codec; - - function av_codec_get_lowres(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_lowres(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_seek_preroll(avctx: {const} PAVCodecContext): cint; - cdecl; external av__codec; - procedure av_codec_set_seek_preroll(avctx: PAVCodecContext; val: cint); - cdecl; external av__codec; - - function av_codec_get_max_lowres(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - - function av_codec_get_chroma_intra_matrix(avctx: {const} PAVCodecContext): PWord; - cdecl; external av__codec; - procedure av_codec_set_chroma_intra_matrix(avctx: PAVCodecContext; val: PWord); - cdecl; external av__codec; - -(** - * @ - *) - -const - AV_SUBTITLE_FLAG_FORCED = $00000001; - -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: {const} PAVCodec): PAVCodec; - cdecl; external av__codec; - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @warning either this function or avcodec_register_all() must be called - * before any other libavcodec functions. - * - * @see avcodec_register_all() - *) -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct should be freed with avcodec_free_context(). - * - * @param codec if non-NULL, allocate private data and initialize defaults - * for the given codec. It is illegal to then call avcodec_open2() - * with a different codec. - * - * @return An AVCodecContext filled with default values or NULL on failure. - *) -function avcodec_alloc_context3(codec: {const} PAVCodec): PAVCodecContext; - cdecl; external av__codec; - -(** - * Free the codec context and everything associated with it and write NULL to - * the provided pointer. - *) -procedure avcodec_free_context(var avctx: PAVCodecContext); - cdecl; external av__codec; - -{$IFDEF FF_API_GET_CONTEXT_DEFAULTS} -(** - * @deprecated This function should not be used, as closing and opening a codec - * context multiple time is not supported. A new codec context should be - * allocated for each new use. - *) -procedure avcodec_get_context_defaults3(s: PAVCodecContext; codec: {const} PAVCodec); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Get the AVClass for AVCodecContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_class(): {const} PAVClass; - cdecl; external av__codec; - -{$IFDEF FF_API_COPY_CONTEXT} -(** - * Get the AVClass for AVFrame. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_frame_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Get the AVClass for AVSubtitleRect. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avcodec_get_subtitle_rect_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open2() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context3(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - * - * @deprecated The semantics of this function are ill-defined and it should not - * be used. If you need to transfer the stream parameters from one codec context - * to another, use an intermediate AVCodecParameters instance and the - * avcodec_parameters_from_context() / avcodec_parameters_to_context() - * functions. - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Allocate a new AVCodecParameters and set its fields to default values - * (unknown/invalid/0). The returned struct must be freed with - * avcodec_parameters_free(). - *) -function avcodec_parameters_alloc(): PAVCodecParameters; - cdecl; external av__codec; - -(** - * Free an AVCodecParameters instance and everything associated with it and - * write NULL to the supplied pointer. - *) -procedure avcodec_parameters_free(par: PPAVCodecParameters); - cdecl; external av__codec; - -(** - * Copy the contents of src to dst. Any allocated fields in dst are freed and - * replaced with newly allocated duplicates of the corresponding fields in src. - * - * @return >= 0 on success, a negative AVERROR code on failure. - *) -function avcodec_parameters_copy(dst: PAVCodecParameters; src: {const} PAVCodecParameters): cint; - cdecl; external av__codec; - -(** - * Fill the parameters struct based on the values from the supplied codec - * context. Any allocated fields in par are freed and replaced with duplicates - * of the corresponding fields in codec. - * - * @return >= 0 on success, a negative AVERROR code on failure - *) -function avcodec_parameters_from_context(par: PAVCodecParameters; - codec: {const} PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Fill the codec context based on the values from the supplied codec - * parameters. Any allocated fields in codec that have a corresponding field in - * par are freed and replaced with duplicates of the corresponding field in par. - * Fields in codec that do not have a counterpart in par are not touched. - * - * @return >= 0 on success, a negative AVERROR code on failure. - *) -function avcodec_parameters_to_context(codec: PAVCodecContext; - par: {const} PAVCodecParameters): cint; - cdecl; external av__codec; - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated with avcodec_alloc_context3(). - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_receive_frame()). - * - * @code - * avcodec_register_all(); - * av_dict_set(&opts, "b", "2.5M", 0); - * codec = avcodec_find_decoder(AV_CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open2(context, codec, opts) < 0) - * exit(1); - * @endcode - * - * @param avctx The context to initialize. - * @param codec The codec to open this context for. If a non-NULL codec has been - * previously passed to avcodec_alloc_context3() or - * for this context, then this parameter MUST be either NULL or - * equal to the previously passed codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. - * - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). - *) -function avcodec_open2(avctx: PAVCodecContext; codec: {const} PAVCodec; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Close a given AVCodecContext and free all the data associated with it - * (but not the AVCodecContext itself). - * - * Calling this function on an AVCodecContext that hasn't been opened will free - * the codec-specific data allocated in avcodec_alloc_context3() with a non-NULL - * codec. Subsequent calls will do nothing. - * - * @note Do not use this function. Use avcodec_free_context() to destroy a - * codec context (either open or closed). Opening and closing a codec context - * multiple times is not supported anymore -- use multiple codec contexts - * instead. - *) -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Free all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; - -(** - * @} - *) - -(** - * @addtogroup lavc_packet - * @{ - *) - -(** - * Allocate an AVPacket and set its fields to default values. The resulting - * struct must be freed using av_packet_free(). - * - * @return An AVPacket filled with default values or NULL on failure. - * - * @note this only allocates the AVPacket itself, not the data buffers. Those - * must be allocated through other means such as av_new_packet. - * - * @see av_new_packet - *) -function av_packet_alloc(): PAVPacket; - cdecl; external av__codec; - -(** - * Create a new packet that references the same data as src. - * - * This is a shortcut for av_packet_alloc()+av_packet_ref(). - * - * @return newly created AVPacket on success, NULL on error. - * - * @see av_packet_alloc - * @see av_packet_ref - *) -function av_packet_clone(src: {const} PAVPacket): PAVPacket; - cdecl; external av__codec; - -(** - * Free the packet, if the packet is reference counted, it will be - * unreferenced first. - * - * @param pkt packet to be freed. The pointer will be set to NULL. - * @note passing NULL is a no-op. - *) -procedure av_packet_free(pkt: PPAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * Note, this does not touch the data and size members, which have to be - * initialized separately. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(** - * Increase packet size, correctly zeroing padding - * - * @param pkt packet - * @param grow_by number of bytes by which to increase the size of the packet - *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; - cdecl; external av__codec; - -(** - * Initialize a reference-counted packet from av_malloc()ed data. - * - * @param pkt packet to be initialized. This function will set the data, size, - * buf and destruct fields, all others are left untouched. - * @param data Data allocated by av_malloc() to be used as packet data. If this - * function returns successfully, the data is owned by the underlying AVBuffer. - * The caller may not access the data through other means. - * @param size size of data in bytes, without the padding. I.e. the full buffer - * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_packet_from_data(pkt: PAVPacket; data: PByte; size: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_AVPACKET_OLD_API} -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - * - * @deprecated Use av_packet_ref - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Copy packet, including contents - * - * @return 0 on success, negative AVERROR on fail - * - * @deprecated Use av_packet_ref - *) -function av_copy_packet(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; deprecated; - -(** - * Copy packet side data - * - * @return 0 on success, negative AVERROR on fail - * - * @deprecated Use av_packet_copy_props - *) -function av_copy_packet_side_data(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; deprecated; - -(* - * Free a packet. - * - * @deprecated Use av_packet_unref - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); - cdecl; external av__codec; deprecated; - -(** - * Allocate new information of a packet. - * - * @param pkt packet - * @param type side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): PByte; - cdecl; external av__codec; - -(** - * Wrap an existing array as a packet side data. - * - * @param pkt packet - * @param type side information type - * @param data the side data array. It must be allocated with the av_malloc() - * family of functions. The ownership of the data is transferred to - * pkt. - * @param size side information size - * @return a non-negative number on success, a negative AVERROR code on - * failure. On failure, the packet is unchanged and the data remains - * owned by the caller. - *) -function av_packet_add_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - data: Pcuint8; size: size_t): cint; - cdecl; external av__codec; - -(** - * Shrink the already allocated side data buffer - * - * @param pkt packet - * @param type side information type - * @param size new side information size - * @return 0 on success, < 0 on failure - *) -function av_packet_shrink_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType; - size: cint): cint; - cdecl; external av__codec; - -(** - * Get side information from packet. - * - * @param pkt packet - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -function av_packet_get_side_data(pkt: {const} PAVPacket; type_: TAVPacketSideDataType; - size: Pcint): PByte; - cdecl; external av__codec; - -{$IFDEF FF_API_MERGE_SD_API} -function av_packet_merge_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; - -function av_packet_split_side_data(pkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; -{$ENDIF} - -function av_packet_side_data_name(type_: TAVPacketSideDataType): PAnsiChar; - cdecl; external av__codec; - -(** - * Pack a dictionary for use in side_data. - * - * @param dict The dictionary to pack. - * @param size pointer to store the size of the returned data - * @return pointer to data if successful, NULL otherwise - *) -function av_packet_pack_dictionary(dict: PAVDictionary; size: PCuint): PByte; - cdecl; external av__codec; - -(** - * Unpack a dictionary from side_data. - * - * @param data data from side_data - * @param size size of the data - * @param dict the metadata storage dictionary - * @return 0 on success, < 0 on failure - *) -function av_packet_unpack_dictionary(data: {const} PByte; size: cint; dict: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Convenience function to free all the side data stored. - * All the other fields stay untouched. - * - * @param pkt packet - *) -procedure av_packet_free_side_data(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Setup a new reference to the data described by a given packet - * - * If src is reference-counted, setup dst as a new reference to the - * buffer in src. Otherwise allocate a new buffer in dst and copy the - * data from src into it. - * - * All the other fields are copied from src. - * - * @see av_packet_unref - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_packet_ref(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Wipe the packet. - * - * Unreference the buffer referenced by the packet and reset the - * remaining packet fields to their default values. - * - * @param pkt The packet to be unreferenced. - *) -procedure av_packet_unref(pkt: PAVPacket); - cdecl; external av__codec; - -(** - * Move every field in src to dst and reset src. - * - * @see av_packet_unref - * - * @param src Source packet, will be reset - * @param dst Destination packet - *) -procedure av_packet_move_ref(dst: PAVPacket; src: PAVPacket); - cdecl; external av__codec; - -(** - * Copy only "properties" fields from src to dst. - * - * Properties for the purpose of this function are all the fields - * beside those related to the packet data (buf, data, size) - * - * @param dst Destination packet - * @param src Source packet - * - * @return 0 on success AVERROR on failure. - * - *) -function av_packet_copy_props(dst: PAVPacket; src: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Convert valid timing fields (timestamps / durations) in a packet from one - * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be - * ignored. - * - * @param pkt packet on which the conversion will be performed - * @param tb_src source timebase, in which the timing fields in pkt are - * expressed - * @param tb_dst destination timebase, to which the timing fields will be - * converted - *) -procedure av_packet_rescale_ts(pkt: PAVPacket; tb_src, tb_dst: TAVRational); - cdecl; external av__codec; - -(** - * @ - *) - -(** - * @addtogroup lavc_decoding - * @ - *) - -(** - * Find a registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * The default callback for AVCodecContext.get_buffer2(). It is made public so - * it can be called by custom get_buffer2() implementations for decoders without - * AV_CODEC_CAP_DR1 set. - *) -function avcodec_default_get_buffer2(s: PAVCodecContext; frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -{$IFDEF FF_API_EMU_EDGE} -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - * - * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer - * needed - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$ENDIF} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -(** - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PAVNDPArray); - cdecl; external av__codec; - -(** - * Decode the audio frame of size avpkt->size from avpkt->data into frame. - * - * Some decoders may support multiple frames in a single AVPacket. Such - * decoders would then just decode the first frame and the return value would be - * less than the packet size. In this case, avcodec_decode_audio4 has to be - * called again with an AVPacket containing the remaining data in order to - * decode the second frame, etc... Even if no frames are returned, the packet - * needs to be fed to the decoder with remaining data until it is completely - * consumed or an error occurs. - * - * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning samples. It is safe to flush even those decoders that are not - * marked with AV_CODEC_CAP_DELAY, then no samples will be returned. - * - * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] frame The AVFrame in which to store decoded audio samples. - * The decoder will allocate a buffer for the decoded frame by - * calling the AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is - * non-zero. Note that this field being set to zero - * does not mean that an error has occurred. For - * decoders with AV_CODEC_CAP_DELAY set, no given decode - * call is guaranteed to produce a frame. - * @param[in] avpkt The input AVPacket containing the input buffer. - * At least avpkt->data and avpkt->size should be set. Some - * decoders might also require additional fields to be set. - * @return A negative error code is returned if an error occurred during - * decoding, otherwise the number of bytes consumed from the input - * AVPacket is returned. - * - * @deprecated Use avcodec_send_packet() and avcodec_receive_frame(). - *) -function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame; - got_frame_ptr: Pcint; avpkt: PAVPacket): cint; - cdecl; external av__codec; deprecated; - -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be AV_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note Codecs which have the AV_CODEC_CAP_DELAY capability set have a delay - * between input and output, these need to be fed with avpkt->data=NULL, - * avpkt->size=0 at the end to return the remaining frames. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use av_frame_alloc() to get an AVFrame. The codec will - * allocate memory for the actual bitmap by calling the - * AVCodecContext.get_buffer2() callback. - * When AVCodecContext.refcounted_frames is set to 1, the frame is - * reference counted and the returned reference belongs to the - * caller. The caller must release the frame using av_frame_unref() - * when the frame is no longer needed. The caller may safely write - * to the frame if av_frame_is_writable() returns 1. - * When AVCodecContext.refcounted_frames is set to 0, the returned - * reference belongs to the decoder and is valid only until the - * next call to this function or until closing or flushing the - * decoder. The caller may not write to it. - * - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - * - * @deprecated Use avcodec_send_packet() and avcodec_receive_frame(). - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; deprecated; - -(* - * Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input - * and output. This means that for some packets they will not immediately - * produce decoded output and need to be flushed at the end of decoding to get - * all the decoded data. Flushing is done by calling this function with packets - * with avpkt->data set to NULL and avpkt->size set to 0 until it stops - * returning subtitles. It is safe to flush even those decoders that are not - * marked with AV_CODEC_CAP_DELAY, then no subtitles will be returned. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx the codec context - * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, - * must be freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Supply raw packet data as input to a decoder. - * - * Internally, this call will copy relevant AVCodecContext fields, which can - * influence decoding per-packet, and apply them when the packet is actually - * decoded. (For example AVCodecContext.skip_frame, which might direct the - * decoder to drop the frame contained by the packet sent with this function.) - * - * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE - * larger than the actual read bytes because some optimized bitstream - * readers read 32 or 64 bits at once and could read over the end. - * - * @warning Do not mix this API with the legacy API (like avcodec_decode_video2()) - * on the same AVCodecContext. It will return unexpected results now - * or in future libavcodec versions. - * - * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() - * before packets may be fed to the decoder. - * - * @param avctx codec context - * @param[in] avpkt The input AVPacket. Usually, this will be a single video - * frame, or several complete audio frames. - * Ownership of the packet remains with the caller, and the - * decoder will not write to the packet. The decoder may create - * a reference to the packet data (or copy it if the packet is - * not reference-counted). - * Unlike with older APIs, the packet is always fully consumed, - * and if it contains multiple frames (e.g. some audio codecs), - * will require you to call avcodec_receive_frame() multiple - * times afterwards before you can send a new packet. - * It can be NULL (or an AVPacket with data set to NULL and - * size set to 0); in this case, it is considered a flush - * packet, which signals the end of the stream. Sending the - * first flush packet will return success. Subsequent ones are - * unnecessary and will return AVERROR_EOF. If the decoder - * still has frames buffered, it will return them after sending - * a flush packet. - * - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted in the current state - user - * must read output with avcodec_receive_frame() (once - * all output is read, the packet should be resent, and - * the call will not fail with EAGAIN). - * AVERROR_EOF: the decoder has been flushed, and no new packets can - * be sent to it (also returned if more than 1 flush - * packet is sent) - * AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate decoding errors - *) -function avcodec_send_packet(avctx: PAVCodecContext; avpkt: {const} PAVPacket): cint; - cdecl; external av__codec; - -(** - * Return decoded output data from a decoder. - * - * @param avctx codec context - * @param frame This will be set to a reference-counted video or audio - * frame (depending on the decoder type) allocated by the - * decoder. Note that the function will always call - * av_frame_unref(frame) before doing anything else. - * - * @return - * 0: success, a frame was returned - * AVERROR(EAGAIN): output is not available in this state - user must try - * to send new input - * AVERROR_EOF: the decoder has been fully flushed, and there will be - * no more output frames - * AVERROR(EINVAL): codec not opened, or it is an encoder - * other negative values: legitimate decoding errors - *) -function avcodec_receive_frame(avctx: PAVCodecContext; frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Supply a raw video or audio frame to the encoder. Use avcodec_receive_packet() - * to retrieve buffered output packets. - * - * @param avctx codec context - * @param[in] frame AVFrame containing the raw audio or video frame to be encoded. - * Ownership of the frame remains with the caller, and the - * encoder will not write to the frame. The encoder may create - * a reference to the frame data (or copy it if the frame is - * not reference-counted). - * It can be NULL, in which case it is considered a flush - * packet. This signals the end of the stream. If the encoder - * still has packets buffered, it will return them after this - * call. Once flushing mode has been entered, additional flush - * packets are ignored, and sending frames will return - * AVERROR_EOF. - * - * For audio: - * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted in the current state - user - * must read output with avcodec_receive_packet() (once - * all output is read, the packet should be resent, and - * the call will not fail with EAGAIN). - * AVERROR_EOF: the encoder has been flushed, and no new frames can - * be sent to it - * AVERROR(EINVAL): codec not opened, refcounted_frames not set, it is a - * decoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate decoding errors - *) -function avcodec_send_frame(avctx: PAVCodecContext; frame: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Read encoded data from the encoder. - * - * @param avctx codec context - * @param avpkt This will be set to a reference-counted packet allocated by the - * encoder. Note that the function will always call - * av_frame_unref(frame) before doing anything else. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): output is not available in the current state - user - * must try to send input - * AVERROR_EOF: the encoder has been fully flushed, and there will be - * no more output packets - * AVERROR(EINVAL): codec not opened, or it is an encoder - * other errors: legitimate decoding errors - *) -function avcodec_receive_packet(avctx: PAVCodecContext; avpkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * @defgroup lavc_parsing Frame parsing - * @ - *) - -type - TAVPictureStructure = ( - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME //< coded as frame - ); - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; - PARSER_FLAG_ONCE = $0002; -/// Set if the parser has a valid file offset - PARSER_FLAG_FETCHED_OFFSET = $0004; - PARSER_FLAG_USE_CODEC_TS = $1000; - -type - (* frame parsing *) - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - offset: cint64; ///< byte offset from starting packet start - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - -{$IFDEF FF_API_CONVERGENCE_DURATION} - (** - * @deprecated unused - *) - convergence_duration: cint64; {deprecated} -{$ENDIF} - - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - - (** - * Duration of the current frame. - * For audio, this is in units of 1 / AVCodecContext.sample_rate. - * For all other types, this is in units of AVCodecContext.time_base. - *) - duration: cint; - - field_order: TAVFieldOrder; - - (** - * Indicate whether a picture is coded as a frame, top field or bottom field. - * - * For example, H.264 field_pic_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag - * equal to 1 and bottom_field_flag equal to 0 corresponds to - * AV_PICTURE_STRUCTURE_TOP_FIELD. - *) - picture_structure: TAVPictureStructure; - - (** - * Picture number incremented in presentation or output order. - * This field may be reinitialized at the first picture of a new sequence. - * - * For example, this corresponds to H.264 PicOrderCnt. - *) - output_picture_number: cint; - - (** - * Dimensions of the decoded video intended for presentation. - *) - width: cint; - height: cint; - - (** - * Dimensions of the coded video. - *) - coded_width: cint; - coded_height: cint; - - (** - * The format of the coded data, corresponds to enum AVPixelFormat for video - * and for enum AVSampleFormat for audio. - * - * Note that a decoder can have considerable freedom in how exactly it - * decodes the data, so the format reported here might be different from the - * one returned by a decoder. - *) - format: cint; - end; {AVCodecParserContext} - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - (* This callback never returns an error, a negative value means that - * the frame start was in a previous packet. *) - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; {AVCodecParser} - -function av_parser_next(c: {const} PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size buffer size in bytes without the padding. I.e. the full buffer - size is assumed to be buf_size + AV_INPUT_BUFFER_PADDING_SIZE. - To signal EOF, this should be 0 (so that the last frame - can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; - -(** - * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed - * @deprecated use AVBitStreamFilter - *) -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -(** - * @} - * @} - *) - -(** - * @addtogroup lavc_encoding - * @{ - *) - -(** - * Find a registered encoder with a matching codec ID. - * - * @param id AVCodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TAVCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * Encode a frame of audio. - * - * Takes input samples from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay, split, and combine input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. If avpkt->data and - * avpkt->size are set, avpkt->destruct must also be set. All - * other AVPacket fields will be reset by the encoder using - * av_init_packet(). If avpkt->data is NULL, the encoder will - * allocate it. The encoder will set avpkt->size to the size - * of the output packet. - * - * If this function fails or produces no output, avpkt will be - * freed using av_packet_unref(). - * @param[in] frame AVFrame containing the raw audio data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame - * can have any number of samples. - * If it is not set, frame->nb_samples must be equal to - * avctx->frame_size for all frames except the last. - * The final frame may be smaller than avctx->frame_size. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - * - * @deprecated use avcodec_send_frame()/avcodec_receive_packet() instead - *) -function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; deprecated; - -(** - * Encode a frame of video. - * - * Takes input raw video data from frame and writes the next output packet, if - * available, to avpkt. The output packet does not necessarily contain data for - * the most recent frame, as encoders can delay and reorder input frames - * internally as needed. - * - * @param avctx codec context - * @param avpkt output AVPacket. - * The user can supply an output buffer by setting - * avpkt->data and avpkt->size prior to calling the - * function, but if the size of the user-provided data is not - * large enough, encoding will fail. All other AVPacket fields - * will be reset by the encoder using av_init_packet(). If - * avpkt->data is NULL, the encoder will allocate it. - * The encoder will set avpkt->size to the size of the - * output packet. The returned data (if any) belongs to the - * caller, he is responsible for freeing it. - * - * If this function fails or produces no output, avpkt will be - * freed using av_packet_unref(). - * @param[in] frame AVFrame containing the raw video data to be encoded. - * May be NULL when flushing an encoder that has the - * AV_CODEC_CAP_DELAY capability set. - * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the - * output packet is non-empty, and to 0 if it is - * empty. If the function returns an error, the - * packet can be assumed to be invalid, and the - * value of got_packet_ptr is undefined and should - * not be used. - * @return 0 on success, negative error code on failure - * - * @deprecated use avcodec_send_frame()/avcodec_receive_packet() instead - *) -function avcodec_encode_video2(avctx: PAVCodecContext; avpkt: PAVPacket; - frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; - cdecl; external av__codec; deprecated; - -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_AVCODEC_RESAMPLE} -(** - * @defgroup lavc_resample Audio resampling - * @ingroup libavc - * @deprecated use libswresample instead - * - * @{ - *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -(** - * Initialize audio resampling context. - * - * @param output_channels number of output channels - * @param input_channels number of input channels - * @param output_rate output sample rate - * @param input_rate input sample rate - * @param sample_fmt_out requested output sample format - * @param sample_fmt_in input sample format - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear if 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - * @return allocated ReSampleContext, NULL if error occurred - *) - function av_audio_resample_init(output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint; - sample_fmt_out: TAVSampleFormat; - sample_fmt_in: TAVSampleFormat; - filter_length: cint; log2_phase_count: cint; - linear: cint; cutoff: cdouble): PReSampleContext; - cdecl; external av__codec; deprecated; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Free resample context. - * - * @param s a non-NULL pointer to a resample context previously - * created with av_audio_resample_init() - *) -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; deprecated; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; deprecated; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; deprecated; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -{$IFDEF FF_API_AVPICTURE} -(** - * @addtogroup lavc_picture - * @{ - *) - -(** - * @deprecated unused - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_fill_arrays() instead. - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_copy_to_buffer() instead. - *) -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated use av_image_get_buffer_size() instead. - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated av_image_copy() instead. - *) -procedure av_picture_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -function av_picture_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band: cint; left_band: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated unused - *) -function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; - height: cint; width: cint; pix_fmt: TAVPixelFormat; - padtop: cint; padbottom: cint; padleft: cint; - padright: cint; color: PCint): cint; - cdecl; external av__codec; deprecated; - -(** - * @} - *) -{$ENDIF} - -(** - * @defgroup lavc_misc Utility functions - * @ingroup libavc - * - * Miscellaneous utility functions related to both encoding and decoding - * (or neither). - * @ - *) - -(** - * @defgroup lavc_misc_pixfmt Pixel formats - * - * Functions for working with pixel formats. - * @ - *) - -{$IFDEF FF_API_GETCHROMA} -(** - * @deprecated Use av_pix_fmt_get_chroma_sub_sample - *) - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -(** - * @deprecated see av_get_pix_fmt_loss() - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_list parameter. - * - * - * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; - src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @deprecated see av_find_best_pix_fmt_of_2() - *) -function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; - -function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; - cdecl; external av__codec; deprecated; - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -(** - * @} - *) - -{$IFDEF FF_API_SET_DIMENSIONS} -(** - * @deprecated this function is not supposed to be used from outside of lavc - *) -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; -{$ENDIF} - -{$IFDEF FF_API_TAG_STRING} -(* Put a string representing the codec tag codec_tag in buf. - * - * @param buf buffer to place codec tag in - * @param buf_size size in bytes of buf - * @param codec_tag codec tag to assign - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - * - * @deprecated see av_fourcc_make_string() and av_fourcc2str(). - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; deprecated; -{$ENDIF} - -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec the codec that is searched for the given profile - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - *) -function av_get_profile_name(codec: {const} PAVCodec; profile: cint): {const} PAnsiChar; - cdecl; external av__codec; - -(** - * Return a name for the specified profile, if available. - * - * @param codec_id the ID of the codec to which the requested profile belongs - * @param profile the profile value for which a name is requested - * @return A name for the profile if found, NULL otherwise. - * - * @note unlike av_get_profile_name(), which searches a list of profiles - * supported by a specific decoder or encoder implementation, this - * function searches the list of profiles from the AVCodecDescriptor - *) -function avcodec_profile_name(codec_id: TAVCodecID; profile: cint): {const} PChar; - cdecl; external av__codec; - -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; - -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -//FIXME func typedef - -(** - * Fill AVFrame audio data and linesize pointers. - * - * The buffer buf must be a preallocated buffer with a size big enough - * to contain the specified samples amount. The filled AVFrame data - * pointers will point to this buffer. - * - * AVFrame extended_data channel pointers are allocated if necessary for - * planar audio. - * - * @param frame the AVFrame - * frame->nb_samples must be set prior to calling the - * function. This function fills in frame->data, - * frame->extended_data, frame->linesize[0]. - * @param nb_channels channel count - * @param sample_fmt sample format - * @param buf buffer to use for frame data - * @param buf_size size of buffer - * @param align plane size sample alignment - * @return >=0 on success, negative error code on failure - * @todo return the size in bytes required to store the samples in - * case of success, at the next libavutil bump - *) -function avcodec_fill_audio_frame(frame: PAVFrame; nb_channels: cint; - sample_fmt: TAVSampleFormat; buf: {const} PByte; - buf_size: cint; align: cint): cint; - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return the PCM codec associated with a sample format. - * @param be endianness, 0 for little, 1 for big, - * -1 (or anything else) for native - * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE - *) -function av_get_pcm_codec(fmt: TAVSampleFormat; be: cint): TAVCodecID; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * Only return non-zero if the bits per sample is exactly correct, not an - * approximation. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; - cdecl; external av__codec; - -(** - * Return audio frame duration. - * - * @param avctx codec context - * @param frame_bytes size of the frame, or 0 if unknown - * @return frame duration, in samples, if known. 0 if not able to - * determine. - *) -function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; - cdecl; external av__codec; - -(** - * This function is the same as av_get_audio_frame_duration(), except it works - * with AVCodecParameters instead of an AVCodecContext. - *) -function av_get_audio_frame_duration2(par: PAVCodecParameters; frame_bytes: cint): cint; - cdecl; external av__codec; - -type -{$IFDEF FF_API_OLD_BSF} - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: {const} PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - (** - * Internal default arguments, used if NULL is passed to av_bitstream_filter_filter(). - * Not for access by library users. - *) - args: PChar; - end; -{$ENDIF} - - PAVBSFInternal = ^TAVBSFInternal; - TAVBSFInternal = record - end; - - (** - * The bitstream filter state. - * - * This struct must be allocated with av_bsf_alloc() and freed with - * av_bsf_free(). - * - * The fields in the struct will only be changed (by the caller or by the - * filter) as described in their documentation, and are to be considered - * immutable otherwise. - *) - PPAVBSFContext = ^PAVBSFContext; - PAVBSFContext = ^TAVBSFContext; - TAVBSFContext = record - (** - * A class for logging and AVOptions - *) - av_class: {const} PAVClass; - - (** - * The bitstream filter this context is an instance of. - *) - filter: {const} PAVBitStreamFilter; - - (** - * Opaque libavcodec internal data. Must not be touched by the caller in any - * way. - *) - internal: PAVBSFInternal; - - (** - * Opaque filter-specific private data. If filter->priv_class is non-NULL, - * this is an AVOptions-enabled struct. - *) - priv_data: pointer; - - (** - * Parameters of the input stream. This field is allocated in - * av_bsf_alloc(), it needs to be filled by the caller before - * av_bsf_init(). - *) - par_in: PAVCodecParameters; - - (** - * Parameters of the output stream. This field is allocated in - * av_bsf_alloc(), it is set by the filter in av_bsf_init(). - *) - par_out: PAVCodecParameters; - - (** - * The timebase used for the timestamps of the input packets. Set by the - * caller before av_bsf_init(). - *) - time_base_in: TAVRational; - - (** - * The timebase used for the timestamps of the output packets. Set by the - * filter in av_bsf_init(). - *) - time_base_out: TAVRational; - end; {TAVBSFContext} - - TAVBitStreamFilter = record - name: PAnsiChar; - - (** - * A list of codec ids supported by the filter, terminated by - * AV_CODEC_ID_NONE. - * May be NULL, in that case the bitstream filter works with any codec id. - *) - codec_ids: PAVCodecID; - - (** - * A class for the private data, used to declare bitstream filter private - * AVOptions. This field is NULL for bitstream filters that do not declare - * any options. - * - * If this field is non-NULL, the first member of the filter private data - * must be a pointer to AVClass, which will be set by libavcodec generic - * code to this class. - *) - priv_class: PAVClass; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - - priv_data_size: cint; - init: function(ctx: PAVBSFContext): cint; cdecl; - filter: function(ctx: PAVBSFContext; pkt: PAVPacket): cint; cdecl; - close: procedure(ctx: PAVBSFContext); cdecl; - end; - - PPAVBSFList = ^PAVBSFList; - PAVBSFList = ^TAVBSFList; - TAVBSFList = record - end; - -{$IFDEF FF_API_OLD_BSF} -(** - * Register a bitstream filter. - * - * The filter will be accessible to the application code through - * av_bitstream_filter_next() or can be directly initialized with - * av_bitstream_filter_init(). - * - * @see avcodec_register_all() - *) -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; deprecated; - -(** - * Create and initialize a bitstream filter context given a bitstream - * filter name. - * - * The returned context must be freed with av_bitstream_filter_close(). - * - * @param name the name of the bitstream filter - * @return a bitstream filter context if a matching filter was found - * and successfully initialized, NULL otherwise - *) -function av_bitstream_filter_init(name: {const} PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; deprecated; - -(** - * Filter bitstream. - * - * This function filters the buffer buf with size buf_size, and places the - * filtered buffer in the buffer pointed to by poutbuf. - * - * The output buffer must be freed by the caller. - * - * @param bsfc bitstream filter context created by av_bitstream_filter_init() - * @param avctx AVCodecContext accessed by the filter, may be NULL. - * If specified, this must point to the encoder context of the - * output stream the packet is sent to. - * @param args arguments which specify the filter configuration, may be NULL - * @param poutbuf pointer which is updated to point to the filtered buffer - * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes - * @param buf buffer containing the data to filter - * @param buf_size size in bytes of buf - * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data - * @return >= 0 in case of success, or a negative error code in case of failure - * - * If the return value is positive, an output buffer is allocated and - * is available in *poutbuf, and is distinct from the input buffer. - * - * If the return value is 0, the output buffer is not allocated and - * should be considered identical to the input buffer, or in case - * *poutbuf was set it points to the input buffer (not necessarily to - * its starting address). A special case is if *poutbuf was set to NULL and - * *poutbuf_size was set to 0, which indicates the packet should be dropped. - *) -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: {const} PAnsiChar; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * Release bitstream filter context. - * - * @param bsf the bitstream filter context created with - * av_bitstream_filter_init(), can be NULL - *) -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; deprecated; - -(** - * If f is NULL, return the first registered bitstream filter, - * if f is non-NULL, return the next registered bitstream filter - * after f, or NULL if f is the last one. - * - * This function can be used to iterate over all registered bitstream - * filters. - *) -function av_bitstream_filter_next(f: {const} PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * @return a bitstream filter with the specified name or NULL if no such - * bitstream filter exists. - *) -function av_bsf_get_by_name(name: {const} PAnsiChar): {const} PAVBitStreamFilter; - cdecl; external av__codec; - -(** - * Iterate over all registered bitstream filters. - * - * @param opaque a pointer where libavcodec will store the iteration state. Must - * point to NULL to start the iteration. - * - * @return the next registered bitstream filter or NULL when the iteration is - * finished - *) -function av_bsf_next(opaque: pointer): {const} PAVBitStreamFilter; - cdecl; external av__codec; - -(** - * Allocate a context for a given bitstream filter. The caller must fill in the - * context parameters as described in the documentation and then call - * av_bsf_init() before sending any data to the filter. - * - * @param filter the filter for which to allocate an instance. - * @param ctx a pointer into which the pointer to the newly-allocated context - * will be written. It must be freed with av_bsf_free() after the - * filtering is done. - * - * @return 0 on success, a negative AVERROR code on failure - *) -function av_bsf_alloc(filter: {const} PAVBitStreamFilter; ctx: PPAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Prepare the filter for use, after all the parameters and options have been - * set. - *) -function av_bsf_init(ctx: PAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Submit a packet for filtering. - * - * After sending each packet, the filter must be completely drained by calling - * av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or - * AVERROR_EOF. - * - * @param pkt the packet to filter. The bitstream filter will take ownership of - * the packet and reset the contents of pkt. pkt is not touched if an error occurs. - * This parameter may be NULL, which signals the end of the stream (i.e. no more - * packets will be sent). That will cause the filter to output any packets it - * may have buffered internally. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_bsf_send_packet(ctx: PAVBSFContext; pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Retrieve a filtered packet. - * - * @param[out] pkt this struct will be filled with the contents of the filtered - * packet. It is owned by the caller and must be freed using - * av_packet_unref() when it is no longer needed. - * This parameter should be "clean" (i.e. freshly allocated - * with av_packet_alloc() or unreffed with av_packet_unref()) - * when this function is called. If this function returns - * successfully, the contents of pkt will be completely - * overwritten by the returned data. On failure, pkt is not - * touched. - * - * @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the - * filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there - * will be no further output from the filter. Another negative AVERROR value if - * an error occurs. - * - * @note one input packet may result in several output packets, so after sending - * a packet with av_bsf_send_packet(), this function needs to be called - * repeatedly until it stops returning 0. It is also possible for a filter to - * output fewer packets than were sent to it, so this function may return - * AVERROR(EAGAIN) immediately after a successful av_bsf_send_packet() call. - *) -function av_bsf_receive_packet(ctx: PAVBSFContext; pkt: PAVPacket): cint; - cdecl; external av__codec; - -(** - * Free a bitstream filter context and everything associated with it; write NULL - * into the supplied pointer. - *) -procedure av_bsf_free(ctx: PPAVBSFContext); - cdecl; external av__codec; - -(** - * Get the AVClass for AVBSFContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function av_bsf_get_class(): {const} PAVClass; - cdecl; external av__codec; - -(** - * Allocate empty list of bitstream filters. - * The list must be later freed by av_bsf_list_free() - * or finalized by av_bsf_list_finalize(). - * - * @return Pointer to @ref AVBSFList on success, NULL in case of failure - *) -function av_bsf_list_alloc(): PAVBSFList; - cdecl; external av__codec; - -(** - * Free list of bitstream filters. - * - * @param lst Pointer to pointer returned by av_bsf_list_alloc() - *) -procedure av_bsf_list_free(lst: PPAVBSFList); - cdecl; external av__codec; - -(** - * Append bitstream filter to the list of bitstream filters. - * - * @param lst List to append to - * @param bsf Filter context to be appended - * - * @return >=0 on success, negative AVERROR in case of failure - *) -function av_bsf_list_append(lst: PAVBSFList; bsf: PAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Construct new bitstream filter context given it's name and options - * and append it to the list of bitstream filters. - * - * @param lst List to append to - * @param bsf_name Name of the bitstream filter - * @param options Options for the bitstream filter, can be set to NULL - * - * @return >=0 on success, negative AVERROR in case of failure - *) -function av_bsf_list_append2(lst: PAVBSFList; bsf_name: {const} Pcchar; options: PPAVDictionary): cint; - cdecl; external av__codec; - -(** - * Finalize list of bitstream filters. - * - * This function will transform @ref AVBSFList to single @ref AVBSFContext, - * so the whole chain of bitstream filters can be treated as single filter - * freshly allocated by av_bsf_alloc(). - * If the call is successful, @ref AVBSFList structure is freed and lst - * will be set to NULL. In case of failure, caller is responsible for - * freeing the structure by av_bsf_list_free() - * - * @param lst Filter list structure to be transformed - * @param[out] bsf Pointer to be set to newly created @ref AVBSFContext structure - * representing the chain of bitstream filters - * - * @return >=0 on success, negative AVERROR in case of failure - *) -function av_bsf_list_finalize(lst: PPAVBSFList; bsf: PPAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Parse string describing list of bitstream filters and create single - * @ref AVBSFContext describing the whole chain of bitstream filters. - * Resulting @ref AVBSFContext can be treated as any other @ref AVBSFContext freshly - * allocated by av_bsf_alloc(). - * - * @param str String describing chain of bitstream filters in format - * `bsf1[=opt1=val1:opt2=val2][,bsf2]` - * @param[out] bsf Pointer to be set to newly created @ref AVBSFContext structure - * representing the chain of bitstream filters - * - * @return >=0 on success, negative AVERROR in case of failure - *) -function av_bsf_list_parse_str(str: {const} Pcchar; bsf: PPAVBSFContext): cint; - cdecl; external av__codec; - -(** - * Get null/pass-through bitstream filter. - * - * @param[out] bsf Pointer to be set to new instance of pass-through bitstream filter - * - * @return - *) -function av_bsf_get_null_filter(bsf: PPAVBSFContext): cint; - cdecl; external av__codec; - -(* memory *) - -(** - * Same behaviour av_fast_malloc but the buffer has additional - * FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. - * - * In addition the whole buffer will initially and after resizes - * be 0-initialized so that no uninitialized data will ever appear. - *) -procedure av_fast_padded_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Same behaviour av_fast_padded_malloc except that buffer will always - * be 0-initialized after call. - *) -procedure av_fast_padded_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__codec; - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IFDEF FF_API_MISSING_SAMPLE} -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbiage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - * @deprecated Use avpriv_report_missing_feature() instead. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} PAnsiChar; want_sample: cint); - cdecl; external av__codec; deprecated; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - * @deprecated Use avpriv_request_sample() instead. - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} PAnsiChar); {todo: av_printf_format(2, 3);} - cdecl; external av__codec; deprecated; -{$ENDIF} - -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: {const} PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; - -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. The "mutex" argument to the function points - * to a (void * ) where the lockmgr should store/get a pointer to a user - * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the - * value left by the last call for all other ops. If the lock manager is - * unable to perform the op then it should leave the mutex in the same - * state as when it was called and return a non-zero value. However, - * when called with AV_LOCK_DESTROY the mutex will always be assumed to - * have been successfully destroyed. If av_lockmgr_register succeeds - * it will return a non-negative value, if it fails it will return a - * negative value and destroy all mutex and unregister all callbacks. - * av_lockmgr_register is not thread-safe, it must be called from a - * single thread before any calls which make use of locking are used. - * - * @param cb User defined callback. av_lockmgr_register invokes calls - * to this callback and the previously registered callback. - * The callback will be used to create more than one mutex - * each of which must be backed by its own underlying locking - * mechanism (i.e. do not use a single static object to - * implement your lock manager). If cb is set to NULL the - * lockmgr will be unregistered. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: Ppointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; - -(** - * Get the type of the given codec. - *) -function avcodec_get_type(codec_id: TAVCodecID): TAVMediaType; - cdecl; external av__codec; - -(** - * Get the name of a codec. - * @return a static string identifying the codec; never NULL - *) -function avcodec_get_name(id: TAVCodecID): PAnsiChar; - cdecl; external av__codec; - -(** - * @return a positive value if s is open (i.e. avcodec_open2() was called on it - * with no corresponding avcodec_close()), 0 otherwise. - *) -function avcodec_is_open(s: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is an encoder, zero otherwise - *) -function av_codec_is_encoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return a non-zero number if codec is a decoder, zero otherwise - *) -function av_codec_is_decoder(codec: {const} PAVCodec): cint; - cdecl; external av__codec; - -(** - * @return descriptor for given codec ID or NULL if no descriptor exists. - *) -function avcodec_descriptor_get(id: TAVCodecID): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Iterate over all codec descriptors known to libavcodec. - * - * @param prev previous descriptor. NULL to get the first descriptor. - * - * @return next descriptor or NULL after the last descriptor - *) -function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * @return codec descriptor with the given name or NULL if no such descriptor - * exists. - *) -function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; - cdecl; external av__codec; - -(** - * Allocate a CPB properties structure and initialize its fields to default - * values. - * - * @param size if non-NULL, the size of the allocated struct will be written - * here. This is useful for embedding it in side data. - * - * @return the newly allocated struct or NULL on failure - *) -function av_cpb_properties_alloc(size: Psize_t): PAVCPBProperties; - cdecl; external av__codec; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-3.4/avformat.pas b/src/lib/ffmpeg-3.4/avformat.pas deleted file mode 100644 index bee08144..00000000 --- a/src/lib/ffmpeg-3.4/avformat.pas +++ /dev/null @@ -1,3245 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of version 2.0 libavformat/avformat.h - * Version: 56.4.101 - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avio, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - SysUtils, - UConfig; - -const - (* - * IMPORTANT: This headers are valid for all minor revisions of ffmpeg - * version 2.4.* - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 57; - LIBAVFORMAT_MAX_VERSION_MINOR = 83; - LIBAVFORMAT_MAX_VERSION_RELEASE = 100; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 57; - LIBAVFORMAT_MIN_VERSION_MINOR = 83; - LIBAVFORMAT_MIN_VERSION_RELEASE = 100; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{ -const - LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; - LIBAVFORMAT_IDENT = 'Lavf' AV_STRINGIFY(LIBAVFORMAT_VERSION); -} - -(** - * @defgroup libavf libavformat - * I/O and Muxing/Demuxing Library - * - * Libavformat (lavf) is a library for dealing with various media container - * formats. Its main two purposes are demuxing - i.e. splitting a media file - * into component streams, and the reverse process of muxing - writing supplied - * data in a specified container format. It also has an @ref lavf_io - * "I/O module" which supports a number of protocols for accessing the data (e.g. - * file, tcp, http and others). Before using lavf, you need to call - * av_register_all() to register all compiled muxers, demuxers and protocols. - * Unless you are absolutely sure you won't use libavformat's network - * capabilities, you should also call avformat_network_init(). - * - * A supported input format is described by an AVInputFormat struct, conversely - * an output format is described by AVOutputFormat. You can iterate over all - * registered input/output formats using the av_iformat_next() / - * av_oformat_next() functions. The protocols layer is not part of the public - * API, so you can only get the names of supported protocols with the - * avio_enum_protocols() function. - * - * Main lavf structure used for both muxing and demuxing is AVFormatContext, - * which exports all information about the file being read or written. As with - * most Libavformat structures, its size is not part of public ABI, so it cannot be - * allocated on stack or directly with av_malloc(). To create an - * AVFormatContext, use avformat_alloc_context() (some functions, like - * avformat_open_input() might do that for you). - * - * Most importantly an AVFormatContext contains: - * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat - * "output" format. It is either autodetected or set by user for input; - * always set by user for output. - * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all - * elementary streams stored in the file. AVStreams are typically referred to - * using their index in this array. - * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or - * set by user for input, always set by user for output (unless you are dealing - * with an AVFMT_NOFILE format). - * - * @section lavf_options Passing options to (de)muxers - * It is possible to configure lavf muxers and demuxers using the @ref avoptions - * mechanism. Generic (format-independent) libavformat options are provided by - * AVFormatContext, they can be examined from a user program by calling - * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass - * from avformat_get_class()). Private (format-specific) options are provided by - * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / - * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. - * Further options may be provided by the @ref AVFormatContext.pb "I/O context", - * if its AVClass is non-NULL, and the protocols layer. See the discussion on - * nesting in @ref avoptions documentation to learn how to access those. - * - * @section urls - * URL strings in libavformat are made of a scheme/protocol, a ':', and a - * scheme specific string. URLs without a scheme and ':' used for local files - * are supported but deprecated. "file:" should be used for local files. - * - * It is important that the scheme string is not taken from untrusted - * sources without checks. - * - * Note that some schemes/protocols are quite powerful, allowing access to - * both local and remote files, parts of them, concatenations of them, local - * audio and video devices and so on. - * - * @{ - * - * @defgroup lavf_decoding Demuxing - * @defgroup lavf_decoding Demuxing - * @ - * Demuxers read a media file and split it into chunks of data (@em packets). A - * @ref AVPacket "packet" contains one or more encoded frames which belongs to a - * single elementary stream. In the lavf API this process is represented by the - * avformat_open_input() function for opening a file, av_read_frame() for - * reading a single packet and finally avformat_close_input(), which does the - * cleanup. - * - * @section lavf_decoding_open Opening a media file - * The minimum information required to open a file is its URL, which - * is passed to avformat_open_input(), as in the following code: - * @code - * const char *url = "file:in.mp3"; - * AVFormatContext *s = NULL; - * int ret = avformat_open_input(&s, url, NULL, NULL); - * if (ret < 0) - * abort(); - * @endcode - * The above code attempts to allocate an AVFormatContext, open the - * specified file (autodetecting the format) and read the header, exporting the - * information stored there into s. Some formats do not have a header or do not - * store enough information there, so it is recommended that you call the - * avformat_find_stream_info() function which tries to read and decode a few - * frames to find missing information. - * - * In some cases you might want to preallocate an AVFormatContext yourself with - * avformat_alloc_context() and do some tweaking on it before passing it to - * avformat_open_input(). One such case is when you want to use custom functions - * for reading input data instead of lavf internal I/O layer. - * To do that, create your own AVIOContext with avio_alloc_context(), passing - * your reading callbacks to it. Then set the @em pb field of your - * AVFormatContext to newly created AVIOContext. - * - * Since the format of the opened file is in general not known until after - * avformat_open_input() has returned, it is not possible to set demuxer private - * options on a preallocated context. Instead, the options should be passed to - * avformat_open_input() wrapped in an AVDictionary: - * @code - * AVDictionary *options = NULL; - * av_dict_set(&options, "video_size", "640x480", 0); - * av_dict_set(&options, "pixel_format", "rgb24", 0); - * - * if (avformat_open_input(&s, url, NULL, &options) < 0) - * abort(); - * av_dict_free(&options); - * @endcode - * This code passes the private options 'video_size' and 'pixel_format' to the - * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it - * cannot know how to interpret raw video data otherwise. If the format turns - * out to be something different than raw video, those options will not be - * recognized by the demuxer and therefore will not be applied. Such unrecognized - * options are then returned in the options dictionary (recognized options are - * consumed). The calling program can handle such unrecognized options as it - * wishes, e.g. - * @code - * AVDictionaryEntry *e; - * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { - * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); - * abort(); - * } - * @endcode - * - * After you have finished reading the file, you must close it with - * avformat_close_input(). It will free everything associated with the file. - * - * @section lavf_decoding_read Reading from an opened file - * Reading data from an opened AVFormatContext is done by repeatedly calling - * av_read_frame() on it. Each call, if successful, will return an AVPacket - * containing encoded data for one AVStream, identified by - * AVPacket.stream_index. This packet may be passed straight into the libavcodec - * decoding functions avcodec_send_packet() or avcodec_decode_subtitle2() if the - * caller wishes to decode the data. - * - * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be - * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for - * pts/dts, 0 for duration) if the stream does not provide them. The timing - * information will be in AVStream.time_base units, i.e. it has to be - * multiplied by the timebase to convert them to seconds. - * - * If AVPacket.buf is set on the returned packet, then the packet is - * allocated dynamically and the user may keep it indefinitely. - * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a - * static storage somewhere inside the demuxer and the packet is only valid - * until the next av_read_frame() call or closing the file. If the caller - * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy - * of it. - * In both cases, the packet must be freed with av_packet_unref() when it is no - * longer needed. - * - * @section lavf_decoding_seek Seeking - * @ - * - * @defgroup lavf_encoding Muxing - * @ - * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write - * it into files or other output bytestreams in the specified container format. - * - * The main API functions for muxing are avformat_write_header() for writing the - * file header, av_write_frame() / av_interleaved_write_frame() for writing the - * packets and av_write_trailer() for finalizing the file. - * - * At the beginning of the muxing process, the caller must first call - * avformat_alloc_context() to create a muxing context. The caller then sets up - * the muxer by filling the various fields in this context: - * - * - The @ref AVFormatContext.oformat "oformat" field must be set to select the - * muxer that will be used. - * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb - * "pb" field must be set to an opened IO context, either returned from - * avio_open2() or a custom one. - * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must - * be created with the avformat_new_stream() function. The caller should fill - * the @ref AVStream.codecpar "stream codec parameters" information, such as the - * codec @ref AVCodecParameters.codec_type "type", @ref AVCodecParameters.codec_id - * "id" and other parameters (e.g. width / height, the pixel or sample format, - * etc.) as known. The @ref AVStream.time_base "stream timebase" should - * be set to the timebase that the caller desires to use for this stream (note - * that the timebase actually used by the muxer can be different, as will be - * described later). - * - It is advised to manually initialize only the relevant fields in - * AVCodecParameters, rather than using @ref avcodec_parameters_copy() during - * remuxing: there is no guarantee that the codec context values remain valid - * for both input and output format contexts. - * - The caller may fill in additional information, such as @ref - * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" - * metadata, @ref AVFormatContext.chapters "chapters", @ref - * AVFormatContext.programs "programs", etc. as described in the - * AVFormatContext documentation. Whether such information will actually be - * stored in the output depends on what the container format and the muxer - * support. - * - * When the muxing context is fully set up, the caller must call - * avformat_write_header() to initialize the muxer internals and write the file - * header. Whether anything actually is written to the IO context at this step - * depends on the muxer, but this function must always be called. Any muxer - * private options must be passed in the options parameter to this function. - * - * The data is then sent to the muxer by repeatedly calling av_write_frame() or - * av_interleaved_write_frame() (consult those functions' documentation for - * discussion on the difference between them; only one of them may be used with - * a single muxing context, they should not be mixed). Do note that the timing - * information on the packets sent to the muxer must be in the corresponding - * AVStream's timebase. That timebase is set by the muxer (in the - * avformat_write_header() step) and may be different from the timebase - * requested by the caller. - * - * Once all the data has been written, the caller must call av_write_trailer() - * to flush any buffered packets and finalize the output file, then close the IO - * context (if any) and finally free the muxing context with - * avformat_free_context(). - * @} - * - * @defgroup lavf_io I/O Read/Write - * @{ - * @section lavf_io_dirlist Directory listing - * The directory listing API makes it possible to list files on remote servers. - * - * Some of possible use cases: - * - an "open file" dialog to choose files from a remote location, - * - a recursive media finder providing a player with an ability to play all - * files from a given directory. - * - * @subsection lavf_io_dirlist_open Opening a directory - * At first, a directory needs to be opened by calling avio_open_dir() - * supplied with a URL and, optionally, ::AVDictionary containing - * protocol-specific parameters. The function returns zero or positive - * integer and allocates AVIODirContext on success. - * - * @code - * AVIODirContext *ctx = NULL; - * if (avio_open_dir(&ctx, "smb://example.com/some_dir", NULL) < 0) { - * fprintf(stderr, "Cannot open directory.\n"); - * abort(); - * } - * @endcode - * - * This code tries to open a sample directory using smb protocol without - * any additional parameters. - * - * @subsection lavf_io_dirlist_read Reading entries - * Each directory's entry (i.e. file, another directory, anything else - * within ::AVIODirEntryType) is represented by AVIODirEntry. - * Reading consecutive entries from an opened AVIODirContext is done by - * repeatedly calling avio_read_dir() on it. Each call returns zero or - * positive integer if successful. Reading can be stopped right after the - * NULL entry has been read -- it means there are no entries left to be - * read. The following code reads all entries from a directory associated - * with ctx and prints their names to standard output. - * @code - * AVIODirEntry *entry = NULL; - * for (;;) { - * if (avio_read_dir(ctx, &entry) < 0) { - * fprintf(stderr, "Cannot list directory.\n"); - * abort(); - * } - * if (!entry) - * break; - * printf("%s\n", entry->name); - * avio_free_directory_entry(&entry); - * } - * @endcode - * @} - * - * @defgroup lavf_codec Demuxers - * @{ - * @defgroup lavf_codec_native Native Demuxers - * @{ - * @} - * @defgroup lavf_codec_wrappers External library wrappers - * @{ - * @} - * @} - * @defgroup lavf_protos I/O Protocols - * @{ - * @} - * @defgroup lavf_internal Internal - * @{ - * @} - * @} - *) - -//type - -(* - * @defgroup metadata_api Public Metadata API - * @ - * @ingroup libavf - * The metadata API allows libavformat to export metadata tags to a client - * application when demuxing. Conversely it allows a client application to - * set metadata when muxing. - * - * Metadata is exported or set as pairs of key/value strings in the 'metadata' - * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs - * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, - * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * - * Important concepts to keep in mind: - * - Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * - Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * - Several modifiers can be applied to the tag name. This is done by - * appending a dash character ('-') and the modifier name in the order - * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. - * - language -- a tag whose value is localized for a particular language - * is appended with the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - * - sorting -- a modified version of a tag that should be used for - * sorting will have '-sort' appended. E.g. artist="The Beatles", - * artist-sort="Beatles, The". - * - * - Demuxers attempt to export metadata in a generic format, however tags - * with no generic equivalents are left as they are stored in the container. - * Follows a list of generic tag names: - * - @verbatim - album -- name of the set this work belongs to - album_artist -- main creator of the set/album, if different from artist. - e.g. "Various Artists" for compilation albums. - artist -- main creator of the work - comment -- any additional description of the file. - composer -- who composed the work, if different from artist. - copyright -- name of copyright holder. - creation_time-- date when the file was created, preferably in ISO 8601. - date -- date when the work was created, preferably in ISO 8601. - disc -- number of a subset, e.g. disc in a multi-disc collection. - encoder -- name/settings of the software/hardware that produced the file. - encoded_by -- person/group who created the file. - filename -- original name of the file. - genre -- . - language -- main language in which the work is performed, preferably - in ISO 639-2 format. Multiple languages can be specified by - separating them with commas. - performer -- artist who performed the work, if different from artist. - E.g for "Also sprach Zarathustra", artist would be "Richard - Strauss" and performer "London Philharmonic Orchestra". - publisher -- name of the label/publisher. - service_name -- name of the service in broadcasting (channel name). - service_provider -- name of the service provider in broadcasting. - title -- name of the work. - track -- number of this work in the set, can be in form current/total. - variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of - @endverbatim - * - * Look in the examples section for an application example how to use the Metadata API. - * - * @ - *) - -(* packet functions *) - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param s associated IO context - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -(** - * Read data and append it to the current content of the AVPacket. - * If pkt->size is 0 this is identical to av_get_packet. - * Note that this uses av_grow_packet and thus involves a realloc - * which is inefficient. Thus this function should only be used - * when there is no reasonable way to know (an upper bound of) - * the final size. - * - * @param s associated IO context - * @param pkt packet - * @param size amount of data to read - * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data - * will not be lost even if an error occurs. - *) -function av_append_packet(s: PAVIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IFDEF FF_API_LAVF_FRAC} -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; -{$ENDIF} - -{$IFNDEF FPC} - //defines for delphi - size_t = cardinal; -{$ENDIF} - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - {const} mime_type: PAnsiChar; (**< mime_type, when known. *) - end; - -const - AVPROBE_SCORE_EXTENSION = 50; ///< score for file extension - AVPROBE_SCORE_MIME = 75; ///< score for file mime type - AVPROBE_SCORE_MAX = 100; ///< maximum score - - AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX DIV 4); - AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX DIV 4-1); - - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - -/// Demuxer will use avio_open, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) -{$IFDEF FF_API_LAVF_FMT_RAWPICTURE} - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. @deprecated Not used anymore *) -{$ENDIF} - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - AVFMT_NOSTREAMS = $1000; (**< Format does not require any streams *) - AVFMT_NOBINSEARCH = $2000; (**< Format does not allow to fall back to binary search via read_timestamp *) - AVFMT_NOGENSEARCH = $4000; (**< Format does not allow to fall back to generic search *) - AVFMT_NO_BYTE_SEEK = $8000; (**< Format does not allow seeking by bytes *) - AVFMT_ALLOW_FLUSH = $10000;(**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. *) - AVFMT_TS_NONSTRICT = $20000;(**< Format does not require strictly - increasing timestamps, but they must - still be monotonic *) - AVFMT_TS_NEGATIVE = $40000; (**< Format allows muxing negative - timestamps. If not set the timestamp - will be shifted in av_write_frame and - av_interleaved_write_frame so they - start from 0. - The user or muxer can override this through - AVFormatContext.avoid_negative_ts - *) - - AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - AVINDEX_DISCARD_FRAME = $0002; (** - * Flag is used to indicate which frame should be discarded after decoding. - *) - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - - MAX_STREAMS = 20; - - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled - AVFMT_FLAG_NOBUFFER = $0040; ///< Do not buffer frames when possible - AVFMT_FLAG_CUSTOM_IO = $0080; ///< The caller has supplied a custom AVIOContext, don't avio_close() it. - AVFMT_FLAG_DISCARD_CORRUPT = $0100; ///< Discard frames marked corrupted - AVFMT_FLAG_FLUSH_PACKETS = $0200; ///< Flush the AVIOContext every packet. -(** - * When muxing, try to avoid writing any random/volatile data to the output. - * This includes any random IDs, real-time timestamps/dates, muxer version, etc. - * - * This flag is mainly intended for testing. - *) - AVFMT_FLAG_BITEXACT = $0400; - AVFMT_FLAG_MP4A_LATM = $8000; ///< Enable RTP MP4A-LATM payload - AVFMT_FLAG_SORT_DTS = $10000; ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) - AVFMT_FLAG_PRIV_OPT = $20000; ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) - {$IFDEF FF_API_LAVF_KEEPSIDE_FLAG} - AVFMT_FLAG_KEEP_SIDE_DATA = $40000; ///< Don't merge side data but keep it separate. Deprecated, will be the default. - {$ENDIF} - AVFMT_FLAG_FAST_SEEK = $80000; ///< Enable fast, but inaccurate seeks for some formats - AVFMT_FLAG_SHORTEST = $100000; ///< Stop muxing when the shortest stream stops. - AVFMT_FLAG_AUTO_BSF = $200000; ///< Wait for packet data before writing a header, and add bitstream filters as requested by the muxer - - // used by AVStream - AVSTREAM_EVENT_FLAG_METADATA_UPDATED = $0001; ///< The call resulted in updated metadata. - MAX_STD_TIMEBASES = (30*12+30+3+6); - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) - AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) -(** - * The stream is stored in the file as an attached picture/"cover art" (e.g. - * APIC frame in ID3v2). The first (usually only) packet associated with it - * will be returned among the first few packets read from the file unless - * seeking takes place. It can also be accessed at any time in - * AVStream.attached_pic. - *) - AV_DISPOSITION_ATTACHED_PIC = $0400; - -(** - * The stream is sparse, and contains thumbnail images, often corresponding - * to chapter markers. Only ever used with AV_DISPOSITION_ATTACHED_PIC. - *) - AV_DISPOSITION_TIMED_THUMBNAILS = $0800; - -(** - * To specify text track kind (different from subtitles default). - *) - AV_DISPOSITION_CAPTIONS = $10000; - AV_DISPOSITION_DESCRIPTIONS = $20000; - AV_DISPOSITION_METADATA = $40000; - -(** - * Options for behavior on timestamp wrap detection. - *) - AV_PTS_WRAP_IGNORE = 0; ///< ignore the wrap - AV_PTS_WRAP_ADD_OFFSET = 1; ///< add the format specific offset on wrap detection - AV_PTS_WRAP_SUB_OFFSET = -1; ///< subtract the format specific offset on wrap detection - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - AVFMT_EVENT_FLAG_METADATA_UPDATED = 0001; ///< The call resulted in updated metadata. - - RAW_PACKET_BUFFER_SIZE = 2500000; - - AVFMT_AVOID_NEG_TS_AUTO = -1; ///< Enabled when required by target format - AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 1; ///< Shift timestamps so they are non negative - AVFMT_AVOID_NEG_TS_MAKE_ZERO = 2; ///< Shift timestamps so that they start at 0 - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PPAVStream = ^PAVStream; - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; - - (** From libavdevice/avdevice.h **) - PPAVDeviceInfo = ^PAVDeviceInfo; - PAVDeviceInfo = ^TAVDeviceInfo; - TAVDeviceInfo = record - device_name: PAnsiChar; (**< device name, format depends on device *) - device_description: PAnsiChar; (**< human friendly name *) - end; {TAVDeviceInfo} - - PAVDeviceInfoList = ^TAVDeviceInfoList; - TAVDeviceInfoList = record - devices: PPAVDeviceInfo; (**< list of autodetected devices *) - nb_devices: cint; (**< number of autodetected devices *) - default_device: cint; (**< index of default device or -1 if no default *) - end; {TAVDeviceInfoList} - - PAVDeviceCapabilitiesQuery = ^TAVDeviceCapabilitiesQuery; - TAVDeviceCapabilitiesQuery = record - end; - - PFFFrac = ^TFFFrac; - TFFFrac = record - val: cint64; - num: cint64; - den: cint64; - end; - -(** - * @addtogroup lavf_encoding - * @ - *) - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (* output support *) - audio_codec: TAVCodecID; (**< default audio codec *) - video_codec: TAVCodecID; (**< default video codec *) - subtitle_codec: TAVCodecID; (**< default subtitle codec *) - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, - * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, - * AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE - *) - flags: cint; - - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVOutputFormat; - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - - write_header: function (c: PAVFormatContext): cint; cdecl; - (** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - *) - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * Currently only used to set pixel format if not YUV420P. - *) - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - (** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - *) - query_codec: function (id: TAVCodecID; std_compliance: cint): cint; cdecl; - - get_output_timestamp: procedure (s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64); cdecl; - - (** - * Allows sending messages from application to device. - *) - control_message: function(s: PAVFormatContext; type_: cint; data: pointer; - data_size: size_t): cint; cdecl; - - (** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - *) - write_uncodec_frame: function(s: PAVFormatContext; stream_index: cint; - frame: PPAVFrame; flags: cuint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - data_codec: TAVCodecID; (**< default data codec *) - - (** - * Initialize format. May allocate data here, and set any AVFormatContext or - * AVStream parameters that need to be set before packets are sent. - * This method must not write output. - * - * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure - * - * Any allocations made here must be freed in deinit(). - *) - init: function(s: PAVFormatContext): cint; cdecl; - - (** - * Deinitialize format. If present, this is called whenever the muxer is being - * destroyed, regardless of whether or not the header has been written. - * - * If a trailer is being written, this is called after write_trailer(). - * - * This is called if init() fails as well. - *) - deinit: procedure(s: PAVFormatContext); - - (** - * Set up any necessary bitstream filtering and extract any extra data needed - * for the global header. - * Return 0 if more packets from this stream must be checked; 1 if not. - *) - check_bitstream: function(s: PAVFormatContext; pkt: {const} PAVPacket): cint; cdecl; - end; -(** - * @} - *) - -(** - * @addtogroup lavf_decoding - * @ - *) - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, - * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - codec_tag: {const} PPAVCodecTag; - - priv_class: {const} PAVClass; ///< AVClass for the private context - - (** - * Comma-separated list of mime types. - * It is used check for matching mime types while probing. - * @see av_probe_input_format2 - *) - mime_type: {const} PAnsiChar; - - (***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - next: PAVInputFormat; - - (** - * Raw demuxers store their codec ID here. - *) - raw_codec_id: cint; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. Only used in raw format right - * now. 'avformat_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; - - (** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - - (** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - *) - get_device_list: function(s: PAVFormatContext; device_list: PAVDeviceInfoList): cint; cdecl; - - (** - * Initialize device capabilities submodule. - * @see avdevice_capabilities_create() for more details. - *) - create_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - (** - * Free device capabilities submodule. - * @see avdevice_capabilities_free() for more details. - *) - free_device_capabilities: function(s: PAVFormatContext; caps: PAVDeviceCapabilitiesQuery): cint; cdecl; - - end; -(** - * @} - *) - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS, (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), - (**< full parsing and repack with timestamp and position generation by parser for raw - this assumes that each packet in the file contains no demuxer level headers and - just codec level data, otherwise position generation would fail *) - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; (**< - * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available - * when seeking to this entry. That means preferable PTS on keyframe based formats. - * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better - * is known - *) - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - Tduration_error = array[0..1] of array[0..MAX_STD_TIMEBASES - 1] of cdouble; - PStreamInfo = ^TStreamInfo; - TStreamInfo = record - last_dts: cint64; - duration_gcd: cint64; - duration_count: cint; - rfps_duration_sum: cint64; - duration_error: ^Tduration_error; - codec_info_duration: cint64; - codec_info_duration_fields: cint64; - (** - * 0 -> decoder has not been searched for yet. - * >0 -> decoder found - * <0 -> decoder with codec_id == -found_decoder has not been found - *) - found_decoder: cint; - - (** - * Those are used for average framerate estimation. - *) - fps_first_dts: cint64; - fps_first_dts_idx: cint; - fps_last_dts: cint64; - fps_last_dts_idx: cint; - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - (** - * Format-specific stream ID. - * decoding: set by libavformat - * encoding: set by the user, replaced by libavformat if left unset - *) - id: cint; (**< format-specific stream ID *) -{$IFDEF FF_API_LAVF_AVCTX} - (** - * @deprecated use the codecpar struct instead - *) - codec: PAVCodecContext; {deprecated} -{$ENDIF} - priv_data: pointer; - -{$IFDEF FF_API_LAVF_FRAC} - (** - * @deprecated this field is unused - *) - pts: TAVFrac; {attribute_deprecated} -{$ENDIF} - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. - * - * decoding: set by libavformat - * encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the desired timebase. In - * avformat_write_header(), the muxer will overwrite this field - * with the timebase that will actually be used for the timestamps - * written into the file (which may or may not be related to the - * user-provided one, depending on the format). - *) - time_base: TAVRational; - - (** - * Decoding: pts of the first frame of the stream in presentation order, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - * - * Encoding: May be set by the caller before avformat_write_header() to - * provide a hint to the muxer about the estimated duration. - *) - duration: cint64; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - - metadata: PAVDictionary; - - (** - * Average framerate - * - * - demuxing: May be set by libavformat when creating the stream or in - * avformat_find_stream_info(). - * - muxing: May be set by the caller before avformat_write_header(). - *) - avg_frame_rate: TAVRational; - - (** - * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet - * will contain the attached picture. - * - * decoding: set by libavformat, must not be modified by the caller. - * encoding: unused - *) - attached_pic: TAVPacket; - - (** - * An array of side data that applies to the whole stream (i.e. the - * container does not allow it to change between packets). - * - * There may be no overlap between the side data in this array and side data - * in the packets. I.e. a given side data is either exported by the muxer - * (demuxing) / set by the caller (muxing) in this array, then it never - * appears in the packets, or the side data is exported / sent through - * the packets (always in the first packet where the value becomes known or - * changes), then it does not appear in this array. - * - * - demuxing: Set by libavformat when the stream is created. - * - muxing: May be set by the caller before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - * - * @see av_format_inject_global_side_data() - *) - side_data: PAVPacketSideData; - - (** - * The number of elements in the AVStream.side_data array. - *) - nb_side_data: cint; - - (** - * Flags for the user to detect events happening on the stream. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVSTREAM_EVENT_FLAG_*. - *) - event_flags: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * Internal note: be aware that physically removing these fields - * will break ABI. Replace removed fields with dummy fields, and - * add new fields to AVStreamInternal. - ***************************************************************** - *) - - (** - * Stream information used internally by avformat_find_stream_info() - *) - info: PStreamInfo; - - pts_wrap_bits: cint; (**< number of bits in pts (used for wrapping control) *) - - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - first_dts: cint64; - cur_dts: cint64; - last_IP_pts: cint64; - last_IP_duration: cint; - - (** - * Number of packets to buffer for codec probing - *) - probe_packets: cint; - - (** - * Number of frames that have been demuxed during avformat_find_stream_info() - *) - codec_info_nb_frames: cint; - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - (** - * last packet in packet_buffer for this stream when muxing. - *) - last_in_packet_buffer: PAVPacketList; - probe_data: TAVProbeData; - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - * - * Code outside avformat should access this field using: - * av_stream_get/set_r_frame_rate(stream) - *) - r_frame_rate: TAVRational; - - (** - * Stream Identifier - * This is the MPEG-TS stream identifier +1 - * 0 means unknown - *) - stream_identifier: cint; - - interleaver_chunk_size: cint64; - interleaver_chunk_duration: cint64; - - (** - * stream probing state - * -1 -> probing finished - * 0 -> no probing requested - * rest -> perform probing with request_probe being the minimum score to accept. - * NOT PART OF PUBLIC API - *) - request_probe: cint; - (** - * Indicates that everything up to the next keyframe - * should be discarded. - *) - skip_to_keyframe: cint; - - (** - * Number of samples to skip at the start of the frame decoded from the next packet. - *) - skip_samples: cint; - - (** - * If not 0, the number of samples that should be skipped from the start of - * the stream (the samples are removed from packets with pts==0, which also - * assumes negative timestamps do not happen). - * Intended for use with formats such as mp3 with ad-hoc gapless audio - * support. - *) - start_skip_samples: cint64; - - (** - * If not 0, the first audio sample that should be discarded from the stream. - * This is broken by design (needs global sample count), but can't be - * avoided for broken by design formats such as mp3 with ad-hoc gapless - * audio support. - *) - first_discard_sample: cint64; - - (** - * The sample after last sample that is intended to be discarded after - * first_discard_sample. Works on frame boundaries only. Used to prevent - * early EOF if the gapless info is broken (considered concatenated mp3s). - *) - last_discard_sample: cint64; - - (** - * Number of internally decoded frames, used internally in libavformat, do not access - * its lifetime differs from info which is why it is not in that structure. - *) - nb_decoded_frames: cint; - - (** - * Timestamp offset added to timestamps before muxing - * NOT PART OF PUBLIC API - *) - mux_ts_offset: cint64; - - (** - * Internal data to check for wrapping of the time stamp - *) - pts_wrap_reference: cint64; - - (** - * Options for behavior, when a wrap is detected. - * - * Defined by AV_PTS_WRAP_ values. - * - * If correction is enabled, there are two possibilities: - * If the first time stamp is near the wrap point, the wrap offset - * will be subtracted, which will create negative time stamps. - * Otherwise the offset will be added. - *) - pts_wrap_behavior: cint; - - (** - * Internal data to prevent doing update_initial_durations() twice - *) - update_initial_durations_done: cint; - - (** - * Internal data to generate dts from pts - *) - pts_reorder_error: array[0..MAX_REORDER_DELAY] of cint64; - pts_reorder_error_count: array[0..MAX_REORDER_DELAY] of byte; - - (** - * Internal data to analyze DTS and detect faulty mpeg streams - *) - last_dts_for_order_check: cint64; - dts_ordered: byte; - dts_misordered: byte; - - (** - * Internal data to inject global side data - *) - inject_global_side_data: cint; - - (***************************************************************** - * All fields above this line are not part of the public API. - * Fields below are part of the public API and ABI again. - ***************************************************************** - *) - - (** - * String containing paris of key and values describing recommended encoder configuration. - * Paris are separated by ','. - * Keys are separated from values by '='. - *) - recommended_encoder_configuration: PAnsiChar; - - (** - * display aspect ratio (0 if unknown) - * - encoding: unused - * - decoding: Set by libavformat to calculate sample_aspect_ratio internally - *) - display_aspect_ratio: TAVRational; - - priv_pts: PFFFrac; - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: pointer; - - (* - * Codec parameters associated with this stream. Allocated and freed by - * libavformat in avformat_new_stream() and avformat_free_context() - * respectively. - * - * - demuxing: filled by libavformat on stream creation or in - * avformat_find_stream_info() - * - muxing: filled by the caller before avformat_write_header() - *) - codecpar: PAVCodecParameters; - end; (** TAVStream **) - -(** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id: cint; - flags: cint; - discard: TAVDiscard; ///< selects which program to discard and which to feed to the caller - stream_index: Pcuint; - nb_stream_indexes: cuint; - metadata: PAVDictionary; - - program_num: cint; - pmt_pid: cint; - pcr_pid: cint; - - (***************************************************************** - * All fields below this line are not part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - *) - start_time: cint64; - end_time: cint64; - - pts_wrap_reference: cint64; ///< reference dts for wrap detection - pts_wrap_behavior: cint; ///< behavior on wrap detection - end; (*AVProgram*) - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - metadata: PAVDictionary; - end; (*AVChapter*) - - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - (** - * The duration of a video can be estimated through various ways, and this enum can be used - * to know how the duration was estimated. - *) - TAVDurationEstimationMethod = ( - AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes - AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration - AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) - ); - - PAVFormatInternal = ^TAVFormatInternal; - TAVFormatInternal = record - (** - * Number of streams relevant for interleaving. - * Muxing only. - *) - nb_interleaved_streams: cint; - inject_global_side_data: cint; - end; - - TAv_format_control_message = function (s: PAVFormatContext; type_: cint; - data: pointer; data_size: size_t): cint; cdecl; - - TAVOpenCallback = function (s: PAVFormatContext; pb: PPAVIOContext; url: {const} PAnsiChar; flags: cint; - int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*, use - * avformat_alloc_context() to create an AVFormatContext. - * - * Fields can be accessed through AVOptions (av_opt* ), - * the name string used matches the associated command line parameter name and - * can be found in libavformat/options_table.h. - * The AVOption/command line parameter names differ in some cases from the C - * structure field names for historic reasons or brevity. - *) - TAVFormatContext = record - (** - * A class for logging and @ref avoptions. Set by avformat_alloc_context(). - * Exports (de)muxer private options if they exist. - *) - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - - (** - * The input container format. - * - * Demuxing only, set by avformat_open_input(). - *) - iformat: PAVInputFormat; - - (** - * The output container format. - * - * Muxing only, must be set by the caller before avformat_write_header(). - *) - oformat: PAVOutputFormat; - - (** - * Format private data. This is an AVOptions-enabled struct - * if and only if iformat/oformat.priv_class is not NULL. - * - * - muxing: set by avformat_write_header() - * - demuxing: set by avformat_open_input() - *) - priv_data: pointer; - - (* - * I/O context. - * - * - demuxing: either set by the user before avformat_open_input() (then - * the user must close it manually) or set by avformat_open_input(). - * - muxing: set by the user before avformat_write_header(). The caller must - * take care of closing / freeing the IO context. - * - * Do NOT set this field if AVFMT_NOFILE flag is set in - * iformat/oformat.flags. In such a case, the (de)muxer will handle - * I/O in some other way and this field will be NULL. - *) - pb: PAVIOContext; - - (* stream info *) - (** - * Flags signalling stream properties. A combination of AVFMTCTX_*. - * Set by libavformat. - *) - ctx_flags: cint; - - (** - * Number of elements in AVFormatContext.streams. - * - * Set by avformat_new_stream(), must not be modified by any other code. - *) - nb_streams: cuint; - - (** - * A list of all streams in the file. New streams are created with - * avformat_new_stream(). - * - * - demuxing: streams are created by libavformat in avformat_open_input(). - * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also - * appear in av_read_frame(). - * - muxing: streams are created by the user before avformat_write_header(). - * - * Freed by libavformat in avformat_free_context(). - *) - streams: PPAVStream; - - (** - * input or output filename - * - * - demuxing: set by avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - *) - filename: array [0..1023] of AnsiChar; (* input or output filename *) - - (** - * Position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - * - * Demuxing only, set by libavformat. - *) - start_time: cint64; - (** - * Duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - - (** - * Total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint64; - - packet_size: cuint; - max_delay: cint; - - (** - * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. - * Set by the user before avformat_open_input() / avformat_write_header(). - *) - flags: cint; - - (** - * Maximum size of the data read from input for determining - * the input container format. - * Demuxing only, set by the caller before avformat_open_input(). - *) - probesize: cint64; - - (** - * Maximum duration (in AV_TIME_BASE units) of the data read - * from input in avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - * Can be set to 0 to let avformat choose using a heuristic. - *) - max_analyze_duration: cint64; - - key: pbyte; - keylen: cint; - - nb_programs: cuint; - programs: PPAVProgram; - - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TAVCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TAVCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TAVCodecID; - - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user - *) - max_index_size: cuint; - - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - - nb_chapters: cuint; - chapters: PAVChapterArray; - - (** - * Metadata that applies to the whole file. - * - * - demuxing: set by libavformat in avformat_open_input() - * - muxing: may be set by the caller before avformat_write_header() - * - * Freed by libavformat in avformat_free_context(). - *) - metadata: PAVDictionary; - - (** - * Start time of the stream in real world time, in microseconds - * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the - * stream was captured at this real world time. - * - muxing: Set by the caller before avformat_write_header(). If set to - * either 0 or AV_NOPTS_VALUE, then the current wall-time will - * be used. - * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that - * the value may become known after some number of frames - * have been received. - *) - start_time_realtime: cint64; - - (** - * The number of frames used for determining the framerate in - * avformat_find_stream_info(). - * Demuxing only, set by the caller before avformat_find_stream_info(). - *) - fps_probe_size: cint; - - (** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * Demuxing only, set by the caller before avformat_open_input(). - *) - error_recognition: cint; - - (** - * Custom interrupt callbacks for the I/O layer. - * - * demuxing: set by the user before avformat_open_input(). - * muxing: set by the user before avformat_write_header() - * (mainly useful for AVFMT_NOFILE formats). The callback - * should also be passed to avio_open2() if it's used to - * open the file. - *) - interrupt_callback: TAVIOInterruptCB; - - (** - * Flags to enable debugging. - *) - debug: cint; - - (** - * Maximum buffering duration for interleaving. - * - * To ensure all the streams are interleaved correctly, - * av_interleaved_write_frame() will wait until it has at least one packet - * for each stream before actually writing any packets to the output file. - * When some streams are "sparse" (i.e. there are large gaps between - * successive packets), this can result in excessive buffering. - * - * This field specifies the maximum difference between the timestamps of the - * first and the last packet in the muxing queue, above which libavformat - * will output a packet regardless of whether it has queued a packet for all - * the streams. - * - * Muxing only, set by the caller before avformat_write_header(). - *) - max_interleave_delta: cint64; - - (** - * Allow non-standard and experimental extension - * @see AVCodecContext.strict_std_compliance - *) - strict_std_compliance: cint; - - (** - * Flags for the user to detect events happening on the file. Flags must - * be cleared by the user once the event has been handled. - * A combination of AVFMT_EVENT_FLAG_*. - *) - event_flags: cint; - - (** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - *) - max_ts_probe: cint; - - (** - * Avoid negative timestamps during muxing. - * Any value of the AVFMT_AVOID_NEG_TS_* constants. - * Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) - * - muxing: Set by user - * - demuxing: unused - *) - avoid_negative_ts: cint; - - (** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - *) - ts_id: cint; - - (** - * Audio preload in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user - * - decoding: unused - *) - audio_preload: cint; - - (** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user - * - decoding: unused - *) - max_chunk_duration: cint; - - (** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user - * - decoding: unused - *) - max_chunk_size: cint; - - (** - * forces the use of wallclock timestamps as pts/dts of packets - * This has undefined results in the presence of B frames. - * - encoding: unused - * - decoding: Set by user - *) - use_wallclock_as_timestamps: cint; - - (** - * avio flags, used to force AVIO_FLAG_DIRECT. - * - encoding: unused - * - decoding: Set by user - *) - avio_flags: cint; - - (** - * The duration field can be estimated through various ways, and this field can be used - * to know how the duration was estimated. - * - encoding: unused - * - decoding: Read by user - *) - duration_estimation_method: TAVDurationEstimationMethod; - - (** - * Skip initial bytes when opening stream - * - encoding: unused - * - decoding: Set by user - *) - skip_initial_bytes: cint64; - - (** - * Correct single timestamp overflows - * - encoding: unused - * - decoding: Set by user - *) - correct_ts_overflow: cuint; - - (** - * Force seeking to any (also non key) frames. - * - encoding: unused - * - decoding: Set by user - *) - seek2any: cint; - - (** - * Flush the I/O context after each packet. - * - encoding: Set by user - * - decoding: unused - *) - flush_packets: cint; - - (** - * format probing score. - * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes - * the format. - * - encoding: unused - * - decoding: set by avformat, read by user - *) - probe_score: cint; - - (** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user - *) - format_probesize: cint; - - (** - * ',' separated list of allowed decoders. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user - *) - codec_whitelist: PAnsiChar; - - (** - * ',' separated list of allowed demuxers. - * If NULL then all are allowed - * - encoding: unused - * - decoding: set by user - *) - format_whitelist: PAnsiChar; - - - (** - * An opaque field for libavformat internal usage. - * Must not be accessed in any way by callers. - *) - internal: PAVFormatInternal; - - (** - * IO repositioned flag. - * This is set by avformat when the underlaying IO context read pointer - * is repositioned, for example when doing byte based seeking. - * Demuxers can use the flag to detect such changes. - *) - io_repositioned: cint; - - (** - * Forced video codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user - *) - video_codec: PAVCodec; - - (** - * Forced audio codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user - *) - audio_codec: PAVCodec; - - (** - * Forced subtitle codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user - *) - subtitle_codec: PAVCodec; - - (** - * Forced data codec. - * This allows forcing a specific decoder, even when there are multiple with - * the same codec_id. - * Demuxing: Set by user - *) - data_codec: PAVCodec; - - (** - * Number of bytes to be written as padding in a metadata header. - * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. - *) - metadata_header_padding: cint; - - (** - * User data. - * This is a place for some private data of the user. - *) - opaque: pointer; - - (** - * Callback used by devices to communicate with application. - *) - control_message_cb: TAv_format_control_message; - - (** - * Output timestamp offset, in microseconds. - * Muxing: set by user - *) - output_ts_offset: cint64; - - (** - * dump format separator. - * can be ", " or "\n " or anything else - * - muxing: Set by user. - * - demuxing: Set by user. - *) - dump_separator: Pcuint8; - - (** - * Forced Data codec_id. - * Demuxing: Set by user. - *) - data_codec_id: TAVCodecID; -{$IFDEF FF_API_OLD_OPEN_CALLBACKS} - (** - * Called to open further IO contexts when needed for demuxing. - * - * This can be set by the user application to perform security checks on - * the URLs before opening them. - * The function should behave like avio_open2(), AVFormatContext is provided - * as contextual information and to reach AVFormatContext.opaque. - * - * If NULL then some simple checks are used together with avio_open2(). - * - * Must not be accessed directly from outside avformat. - * @See av_format_set_open_cb() - * - * Demuxing: Set by user. - * - * @deprecated Use io_open and io_close. - *) - open_cb: function(s: PAVFormatContext; p: PPAVIOContext; url: {const} PAnsiChar; flags: cint; int_cb: {const} PAVIOInterruptCB; options: PPAVDictionary): cint; cdecl; {deprecated} -{$ENDIF} - - (** - * ',' separated list of allowed protocols. - * - encoding: unused - * - decoding: set by user - *) - protocol_whitelist: pchar; - - (* - * A callback for opening new IO streams. - * - * Whenever a muxer or a demuxer needs to open an IO stream (typically from - * avformat_open_input() for demuxers, but for certain formats can happen at - * other times as well), it will call this callback to obtain an IO context. - * - * @param s the format context - * @param pb on success, the newly opened IO context should be returned here - * @param url the url to open - * @param flags a combination of AVIO_FLAG_* - * @param options a dictionary of additional options, with the same - * semantics as in avio_open2() - * @return 0 on success, a negative AVERROR code on failure - * - * @note Certain muxers and demuxers do nesting, i.e. they open one or more - * additional internal format contexts. Thus the AVFormatContext pointer - * passed to this callback may be different from the one facing the caller. - * It will, however, have the same 'opaque' field. - *) - io_open: function(s: PAVFormatContext; pb: PPAVIOContext; url: {const} pchar; - flags: cint; options: PPAVDictionary): cint; cdecl; - - (** - * A callback for closing the streams opened with AVFormatContext.io_open(). - *) - io_close: procedure(s: PAVFormatContext; pb: PAVIOContext); cdecl; - - (** - * ',' separated list of disallowed protocols. - * - encoding: unused - * - decoding: set by user - *) - protocol_blacklist: PAnsiChar; - - (** - * The maximum number of streams. - * - encoding: unused - * - decoding: set by user - *) - max_streams: cint; - end; (** TAVFormatContext **) - - TAVTimebaseSource = ( - AVFMT_TBCF_AUTO = -1, - AVFMT_TBCF_DECODER, - AVFMT_TBCF_DEMUXER, -{$IFDEF FF_API_R_FRAME_RATE} - AVFMT_TBCF_R_FRAMERATE -{$ENDIF} - ); - -(** - * Accessors for some AVFormatContext fields. These used to be provided for ABI - * compatibility, and do not need to be used anymore. - *) -function av_format_get_probe_score(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -function av_format_get_video_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_video_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_audio_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_audio_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_subtitle_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_subtitle_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_data_codec(s: {const} PAVFormatContext): PAVCodec; - cdecl; external av__format; -procedure av_format_set_data_codec(s: PAVFormatContext; c: PAVCodec); - cdecl; external av__format; -function av_format_get_metadata_header_padding(s: {const} PAVFormatContext): cint; - cdecl; external av__format; -procedure av_format_set_metadata_header_padding(s: PAVFormatContext; c: cint); - cdecl; external av__format; -procedure av_format_get_opaque(s: {const} PAVFormatContext); - cdecl; external av__format; -procedure av_format_set_opaque(s: PAVFormatContext; opaque: pointer); - cdecl; external av__format; -function av_format_get_control_message_cb(s: {const} PAVFormatContext): TAv_format_control_message; - cdecl; external av__format; -procedure av_format_set_control_message_cb(s: PAVFormatContext; callback: TAv_format_control_message); - cdecl; external av__format; -{$IFDEF FF_API_OLD_OPEN_CALLBACKS} -function av_format_get_open_cb(s: {const} PAVFormatContext): TAVOpenCallback; {deprecated} - cdecl; external av__format; -procedure av_format_set_open_cb(s: PAVFormatContext; callback: TAVOpenCallback); {deprecated} - cdecl; external av__format; -{$ENDIF} - -(** - * This function will cause global side data to be injected in the next packet - * of each stream as well as after any subsequent seek. - *) -procedure av_format_inject_global_side_data(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Returns the method used to set ctx->duration. - * - * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. - *) -function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; - cdecl; external av__format; - -function av_stream_get_r_frame_rate({const} s: PAVStream): TAVRational; - cdecl; external av__format; -procedure av_stream_set_r_frame_rate(s: PAVStream; r: TAVRational); - cdecl; external av__format; -function av_stream_get_parser(s: {const} PAVStream): PAVCodecParserContext; - cdecl; external av__format; -function av_stream_get_recommended_encoder_configuration({const} s: PAVStream): PAnsiChar; - cdecl; external av__format; -procedure av_stream_set_recommended_encoder_configuration(s: PAVStream; configuration: PAnsiChar); - cdecl; external av__format; - -(** - * Returns the pts of the last muxed packet + its duration - * - * the retuned value is undefined when used with a demuxer. - *) -function av_stream_get_end_pts(st: {const} PAVStream): cint64; - cdecl; external av__format; - -(** - * @defgroup lavf_core Core functions - * @ingroup libavf - * - * Functions for querying libavformat capabilities, allocating core structures, - * etc. - * @ - *) - -(** - * Return the LIBAVFORMAT_VERSION_INT constant. - *) -function avformat_version(): cuint; - cdecl; external av__format; - -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -(** - * Do global initialization of network components. This is optional, - * but recommended, since it avoids the overhead of implicitly - * doing the setup for each session. - * - * Calling this function will become mandatory if using network - * protocols at some major version bump. - *) -function avformat_network_init(): cint; - cdecl; external av__format; - -(** - * Undo the initialization done by avformat_network_init. - *) -function avformat_network_deinit(): cint; - cdecl; external av__format; - -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: {const} PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: {const} PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; - -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; - -(** - * Free an AVFormatContext and all its streams. - * @param s context to free - *) -procedure avformat_free_context(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Get the AVClass for AVFormatContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function avformat_get_class(): {const} PAVClass; - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * When demuxing, it is called by the demuxer in read_header(). If the - * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also - * be called in read_packet(). - * - * When muxing, should be called by the user before avformat_write_header(). - * - * User is required to call avcodec_close() and avformat_free_context() to - * clean up the allocation by avformat_new_stream(). - * - * @param s media file handle - * @param c If non-NULL, the AVCodecContext corresponding to the new stream - * will be initialized to use this codec. This is needed for e.g. codec-specific - * defaults to be set, so codec should be provided if it is known. - * - * @return newly created stream or NULL on error. - *) -function avformat_new_stream(s: PAVFormatContext; c: {const} PAVCodec): PAVStream; - cdecl; external av__format; - -(** - * Wrap an existing array as stream side data. - * - * @param st stream - * @param type side information type - * @param data the side data array. It must be allocated with the av_malloc() - * family of functions. The ownership of the data is transferred to - * st. - * @param size side information size - * @return zero on success, a negative AVERROR code on failure. On failure, - * the stream is unchanged and the data remains owned by the caller. - *) -function av_stream_add_side_data(st: PAVStream; type_: TAVPacketSideDataType; - data: Pcuint8; size: size_t): cint; - cdecl; external av__format; - -(** - * Allocate new information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size side information size - * @return pointer to fresh allocated data or NULL otherwise - *) -function av_stream_new_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: cint): Pcuint8; - cdecl; external av__format; - -(** - * Get side information from stream. - * - * @param stream stream - * @param type desired side information type - * @param size pointer for side information size to store (optional) - * @return pointer to data if present or NULL otherwise - *) -{$IFDEF FF_API_NOCONST_GET_SIDE_DATA} -function av_stream_get_side_data(stream: PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; -{$ELSE} -function av_stream_get_side_data(stream: {const} PAVStream; - type_: TAVPacketSideDataType; size: Pcint): Pcuint8; - cdecl; external av__format; -{$ENDIF} - -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; - -(** - * @} - *) - -{$IFDEF FF_API_PKT_DUMP} -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); {deprecated} - cdecl; external av__format; -{$IFEND} - -(** - * Allocate an AVFormatContext for an output format. - * avformat_free_context() can be used to free the context and - * everything allocated by the framework within it. - * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure - *) -function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutputFormat; - {const} format_name: PAnsiChar; {const} filename: PAnsiChar): cint; - cdecl; external av__format; - -(** - * @addtogroup lavf_decoding - * @ - *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param pd data to be probed - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_ret The score of the best detection. - *) -function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pcint): PAVInputFormat; - cdecl; external av__format; - -(** - * Probe a bytestream to determine the input format. Each time a probe returns - * with a score that is too low, the probe buffer size is increased and another - * attempt is made. When the maximum probe size is reached, the input format - * with the highest score is returned. - * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param url the url of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from - * @param max_probe_size the maximum probe buffer size (zero for default) - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code otherwise - *) -function av_probe_input_buffer2(pb: PAVIOContext; var fmt: PAVInputFormat; - url: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Like av_probe_input_buffer2() but returns 0 on success - *) -function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; - url: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint): cint; - cdecl; external av__format; - -(** - * Open an input stream and read the header. The codecs are not opened. - * The stream must be closed with av_close_input_file(). - * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param url URL of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return 0 on success, a negative AVERROR on failure. - * - * @note If you want to use custom IO, preallocate the format context and set its pb field. - *) -function avformat_open_input(ps: PPAVFormatContext; url: {const} PAnsiChar; fmt: PAVInputFormat; options: PPAVDictionary): cint; - cdecl; external av__format; - -function av_demuxer_open(ic: PAVFormatContext): cint; - cdecl; external av__format; deprecated; - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @param options If non-NULL, an ic.nb_streams long array of pointers to - * dictionaries, where i-th member contains options for - * codec corresponding to i-th stream. - * On return each dictionary will be filled with options that were not found. - * @return >=0 if OK, AVERROR_xxx on error - * - * @note this function isn't guaranteed to open all the codecs, so - * options being non-empty at return is a perfectly normal behavior. - * - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function avformat_find_stream_info(ic: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Find the programs which belong to a given stream. - * - * @param ic media file handle - * @param last the last found program, the search will start after this - * program, or from the beginning if it is NULL - * @param s stream index - * @return the next program which belongs to s, NULL if no program is found or - * the last program is not among the programs of ic. - *) -function av_find_program_from_stream(ic: PAVFormatContext; last: PAVProgram; s: cint): PAVProgram; - cdecl; external av__format; - -procedure av_program_add_stream_index(ac: PAVFormatContext; progid: cint; idx: cuint); - cdecl; external av__format; - -(** - * Find the "best" stream in the file. - * The best stream is determined according to various heuristics as the most - * likely to be what the user expects. - * If the decoder parameter is non-NULL, av_find_best_stream will find the - * default decoder for the stream's codec; streams for which no decoder can - * be found are ignored. - * - * @param ic media file handle - * @param type stream type: video, audio, subtitles, etc. - * @param wanted_stream_nb user-requested stream number, - * or -1 for automatic selection - * @param related_stream try to find a stream related (eg. in the same - * program) to this one, or -1 if none - * @param decoder_ret if non-NULL, returns the decoder for the - * selected stream - * @param flags flags; none are currently defined - * @return the non-negative stream number in case of success, - * AVERROR_STREAM_NOT_FOUND if no stream with the requested type - * could be found, - * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder - * @note If av_find_best_stream returns successfully and decoder_ret is not - * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. - *) -function av_find_best_stream(ic: PAVFormatContext; - type_: TAVMediaType; - wanted_stream_nb: cint; - related_stream: cint; - decoder_ret: PPAVCodec; - flags: cint): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * This function returns what is stored in the file, and does not validate - * that what is there are valid frames for the decoder. It will split what is - * stored in the file into frames and return one for each call. It will not - * omit invalid data between valid frames so as to give the decoder the maximum - * information possible for decoding. - * - * If pkt->buf is NULL, then the packet is valid until the next - * av_read_frame() or until avformat_close_input(). Otherwise the packet - * is valid indefinitely. In both cases the packet must be freed with - * av_packet_unref when it is no longer needed. For video, the packet contains - * exactly one frame. For audio, it contains an integer number of frames if each - * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames - * have a variable size (e.g. MPEG audio), then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - - -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. - * - * @param s media file handle - * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; stream_index: cint; min_ts, ts, max_ts: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Discard all internally buffered data. This can be useful when dealing with - * discontinuities in the byte stream. Generally works only with formats that - * can resync. This includes headerless formats like MPEG-TS/TS but should also - * work with NUT, Ogg and in a limited way AVI for example. - * - * The set of streams, the detected duration, stream parameters and codecs do - * not change when calling this function. If you want a complete reset, it's - * better to open a new AVFormatContext. - * - * This does not flush the AVIOContext (s->pb). If necessary, call - * avio_flush(s->pb) before calling this function. - * - * @param s media file handle - * @return >=0 on success, error code otherwise - *) -function avformat_flush(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Close an opened input AVFormatContext. Free it and all its contents - * and set *s to NULL. - *) -procedure avformat_close_input(s: PPAVFormatContext); - cdecl; external av__format; -(** - * @} - *) - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes - AVSEEK_FLAG_FRAME = 8; - - AVSTREAM_INIT_IN_WRITE_HEADER = 0; ///< stream parameters initialized in avformat_write_header - AVSTREAM_INIT_IN_INIT_OUTPUT = 1; ///< stream parameters initialized in avformat_init_output - - AV_FRAME_FILENAME_FLAGS_MULTIPLE = 1; ///< Allow multiple %d - -(** - * @addtogroup lavf_encoding - * @{ - *) -(** - * Allocate the stream private data and write the stream header to - * an output media file. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec had not already been fully initialized in avformat_init, - * AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec had already been fully initialized in avformat_init, - * negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_init_output. - *) -function avformat_write_header(s: PAVFormatContext; options: {PPAVDictionary} pointer): cint; - cdecl; external av__format; - -(** - * Allocate the stream private data and initialize the codec, but do not write the header. - * May optionally be used before avformat_write_header to initialize stream parameters - * before actually writing the header. - * If using this function, do not pass the same options to avformat_write_header. - * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec requires avformat_write_header to fully initialize, - * AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec has been fully initialized, - * negative AVERROR on failure. - * - * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_write_header. - *) -{av_warn_unused_result} -function avformat_init_output(s: PAVFormatContext; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * This function passes the packet directly to the muxer, without any buffering - * or reordering. The caller is responsible for correctly interleaving the - * packets if the format requires it. Callers that want libavformat to handle - * the interleaving should call av_interleaved_write_frame() instead of this - * function. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. Note that unlike - * av_interleaved_write_frame(), this function does not take - * ownership of the packet passed to it (though some muxers may make - * an internal reference to the input packet). - *
- * This parameter can be NULL (at any time, not just at the end), in - * order to immediately flush data buffered within the muxer, for - * muxers that buffer up data internally before writing it to the - * output. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". - *
- * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") - * must be set to correct values in the stream's timebase (unless the - * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then - * they can be set to AV_NOPTS_VALUE). - * The dts for subsequent packets passed to this function must be strictly - * increasing when compared in their respective timebases (unless the - * output format is flagged with the AVFMT_TS_NONSTRICT, then they - * merely have to be nondecreasing). @ref AVPacket.duration - * "duration") should also be set if known. - * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush - * - * @see av_interleaved_write_frame() - *) -function av_write_frame(s: PAVFormatContext; pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * This function will buffer the packets internally as needed to make sure the - * packets in the output file are properly interleaved in the order of - * increasing dts. Callers doing their own interleaving should call - * av_write_frame() instead of this function. - * - * Using this function instead of av_write_frame() can give muxers advance - * knowledge of future packets, improving e.g. the behaviour of the mp4 - * muxer for VFR content in fragmenting mode. - * - * @param s media file handle - * @param pkt The packet containing the data to be written. - *
- * If the packet is reference-counted, this function will take - * ownership of this reference and unreference it later when it sees - * fit. - * The caller must not access the data through this reference after - * this function returns. If the packet is not reference-counted, - * libavformat will make a copy. - *
- * This parameter can be NULL (at any time, not just at the end), to - * flush the interleaving queues. - *
- * Packet's @ref AVPacket.stream_index "stream_index" field must be - * set to the index of the corresponding stream in @ref - * AVFormatContext.streams "s->streams". - *
- * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") - * must be set to correct values in the stream's timebase (unless the - * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then - * they can be set to AV_NOPTS_VALUE). - * The dts for subsequent packets in one stream must be strictly - * increasing (unless the output format is flagged with the - * AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). - * @ref AVPacket.duration "duration") should also be set if known. - * - * @return 0 on success, a negative AVERROR on error. Libavformat will always - * take care of freeing the packet, even if this function fails. - * - * @see av_write_frame(), AVFormatContext.max_interleave_delta - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write an uncoded frame to an output media file. - * - * The frame must be correctly interleaved according to the container - * specification; if not, then av_interleaved_write_frame() must be used. - * - * See av_interleaved_write_frame() for details. - *) -function av_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - -(** - * Write an uncoded frame to an output media file. - * - * If the muxer supports it, this function makes it possible to write an AVFrame - * structure directly, without encoding it into a packet. - * It is mostly useful for devices and similar special muxers that use raw - * video or PCM data and will not serialize it into a byte stream. - * - * To test whether it is possible to use it with a given muxer and stream, - * use av_write_uncoded_frame_query(). - * - * The caller gives up ownership of the frame and must not access it - * afterwards. - * - * @return >=0 for success, a negative code on error - *) -function av_interleaved_write_uncoded_frame(s: PAVFormatContext; stream_index: cint; - frame: PAVFrame): cint; - cdecl; external av__format; - - -(** - * Test whether a muxer supports uncoded frame. - * - * @return >=0 if an uncoded frame can be written to that muxer and stream, - * <0 if not - *) -function av_write_uncoded_frame_query(s: PAVFormatContext; stream_index: cint): cint; - cdecl; external av__format; - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to avformat_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TAVCodecID; - cdecl; external av__format; - -(** - * Get timing information for the data currently output. - * The exact meaning of "currently output" depends on the format. - * It is mostly relevant for devices that have an internal buffer and/or - * work in real time. - * @param s media file handle - * @param stream stream in the media file - * @param[out] dts DTS of the last packet output for the stream, in stream - * time_base units - * @param[out] wall absolute time when that packet whas output, - * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. - *) -function av_get_output_timestamp(s: PAVFormatContext; stream: cint; - dts: Pcint64; wall: Pcint64): cint; - cdecl; external av__format; - - -(** - * @} - *) - - -(** - * @defgroup lavf_misc Utility functions - * @ingroup libavf - * @ - * - * Miscellaneous utility functions related to both muxing and demuxing - * (or neither). - *) - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 - *) -procedure av_hex_dump(f: PAVFile; buf: {const} PByteArray; size: cint); {<-?FILE} - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: {const} PByteArray; size: cint); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump2(f: PAVFile; pkt: {const} PAVPacket; dump_payload: cint; st: {const} PAVStream); - cdecl; external av__format; - -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - * @param st AVStream that the packet belongs to - *) -procedure av_pkt_dump_log2(avcl: pointer; level: cint; pkt: {const} PAVPacket; dump_payload: cint; - st: {const} PAVStream); - cdecl; external av__format; - -(** - * Get the AVCodecID for the given codec tag tag. - * If no codec id is found returns AV_CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param tag codec tag to match to a codec ID - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TAVCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec ID to match to a codec tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TAVCodecID): cuint; - cdecl; external av__format; - -(** - * Get the codec tag for the given codec id. - * - * @param tags list of supported codec_id - codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - * @param id codec id that should be searched for in the list - * @param tag A pointer to the found tag - * @return 0 if id was not found in tags, > 0 if it was found - *) -function av_codec_get_tag2(var tags: PAVCodecTag; id: TAVCodecID; - tag: Pcuint): cint; - cdecl; external av__format; - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * - * @param st stream that the timestamp belongs to - * @param timestamp timestamp to retrieve the index for - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - url: {const} PAnsiChar); - cdecl; external av__format; - -(** - * Print detailed information about the input or output format, such as - * duration, bitrate, streams, container, programs, metadata, side data, - * codec and time base. - * - * @param ic the context to analyze - * @param index index of the stream to dump information about - * @param url the URL to print, such as source or destination file - * @param is_output Select whether the specified context is an input(0) or output(1) - *) -procedure av_dump_format(ic: PAVFormatContext; - index: cint; - url: {const} PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @param flags AV_FRAME_FILENAME_FLAGS_* - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename2(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint; flags: cint): cint; - cdecl; external av__format; -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: {const} PAnsiChar; number: cint): cint; - cdecl; external av__format; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Generate an SDP for an RTP session. - * - * Note, this overwrites the id values of AVStreams in the muxer contexts - * for getting unique dynamic payload types. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buf buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function av_sdp_create(ac: pointer; n_files: cint; buf: PAnsiChar; size: cint): cint; - cdecl; external av__format; - -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param filename file name to check against the given extensions - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; - -(** - * Test if the given container can store a codec. - * - * @param ofmt container to check for compatibility - * @param codec_id codec to potentially store in container - * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* - * - * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. - * A negative number if this information is not available. - *) -function avformat_query_codec(ofmt: {const} PAVOutputFormat; codec_id: TAVCodecID; - std_compliance: cint): cint; - cdecl; external av__format; - -(** - * @defgroup riff_fourcc RIFF FourCCs - * @ - * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are - * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the - * following code: - * @code - * uint32_t tag = MKTAG('H', '2', '6', '4'); - * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; - * enum AVCodecID id = av_codec_get_id(table, tag); - * @endcode - *) -(** - * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_riff_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; -(** - * @return the table mapping RIFF FourCCs for audio to AVCodecID. - *) -function avformat_get_riff_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. - *) -function avformat_get_mov_video_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * @return the table mapping MOV FourCCs for audio to AVCodecID. - *) -function avformat_get_mov_audio_tags(): {const} PAVCodecTag; - cdecl; external av__format; - -(** - * Guess the sample aspect ratio of a frame, based on both the stream and the - * frame aspect ratio. - * - * Since the frame aspect ratio is set by the codec but the stream aspect ratio - * is set by the demuxer, these two may not be equal. This function tries to - * return the value that you should use if you would like to display the frame. - * - * Basic logic is to use the stream aspect ratio if it is set to something sane - * otherwise use the frame aspect ratio. This way a container setting, which is - * usually easy to modify can override the coded value in the frames. - * - * @param format the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame with the aspect ratio to be determined - * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea - *) -function av_guess_sample_aspect_ratio(format: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Guess the frame rate, based on both the container and codec information. - * - * @param ctx the format context which the stream is part of - * @param stream the stream which the frame is part of - * @param frame the frame for which the frame rate should be determined, may be NULL - * @return the guessed (valid) frame rate, 0/1 if no idea - *) -function av_guess_frame_rate(ctx: PAVFormatContext; stream: PAVStream; frame: PAVFrame): TAVRational; - cdecl; external av__format; - -(** - * Check if the stream st contained in s is matched by the stream specifier - * spec. - * - * See the "stream specifiers" chapter in the documentation for the syntax - * of spec. - * - * @return >0 if st is matched by spec; - * 0 if st is not matched by spec; - * AVERROR code if spec is invalid - * - * @note A stream specifier can match several streams in the format. - *) -function avformat_match_stream_specifier(s: PAVFormatContext; st: PAVStream; - spec: PAnsiChar): cint; - cdecl; external av__format; - -function avformat_queue_attached_pictures(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IFDEF FF_API_OLD_BSF} -(** - * Apply a list of bitstream filters to a packet. - * - * @param codec AVCodecContext, usually from an AVStream - * @param pkt the packet to apply filters to. If, on success, the returned - * packet has size == 0 and side_data_elems == 0, it indicates that - * the packet should be dropped - * @param pkt the packet to apply filters to - * @param bsfc a NULL-terminated list of filters to apply - * @return >=0 on success; - * AVERROR code on failure - *) -function av_apply_bitstream_filters(codec: PAVCodecContext; pkt: PAVPacket; - bsfc: PAVBitStreamFilterContext): cint; - cdecl; external av__format; deprecated; -{$ENDIF} - -(** - * Transfer internal timing information from one stream to another. - * - * This function is useful when doing stream copy. - * - * @param ofmt target output format for ost - * @param ost output stream which needs timings copy and adjustments - * @param ist reference input stream to copy timings from - * @param copy_tb define from where the stream codec timebase needs to be imported - *) -function avformat_transfer_internal_stream_timing_info(ofmt: {const} PAVOutputFormat; - ost: PAVStream; ist: {const} PAVStream; - copy_tb: TAVTimebaseSource): cint; - cdecl; external av__format; - -(** - * Get the internal codec timebase from a stream. - * - * @param st input stream to extract the timebase from - *) -function av_stream_get_codec_timebase(st: {const} PAVStream): TAVRational; - cdecl; external av__format; - -implementation - -end. diff --git a/src/lib/ffmpeg-3.4/avio.pas b/src/lib/ffmpeg-3.4/avio.pas deleted file mode 100644 index 7c09da34..00000000 --- a/src/lib/ffmpeg-3.4/avio.pas +++ /dev/null @@ -1,997 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * avformat version: 56.4.101 - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - {$IFDEF UNIX} - BaseUnix, // for SEEK_CUR - {$ENDIF} - avcodec, - avutil, - SysUtils, - UConfig; - -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - -const - (** - * Seeking works like for a local file. - *) - AVIO_SEEKABLE_NORMAL = (1 << 0); - - (** - * Seeking by timestamp with avio_seek_time() is possible. - *) - AVIO_SEEKABLE_TIME = (1 << 1); - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - Tcallback = function(p: pointer): cint; cdecl; - -type -(** - * Callback for checking whether to abort blocking functions. - * AVERROR_EXIT is returned in this case by the interrupted - * function. During blocking operations, callback is called with - * opaque as parameter. If the callback returns 1, the - * blocking operation will be aborted. - * - * No members can be added to this struct without a major bump, if - * new elements have been added after this struct in AVFormatContext - * or AVIOContext. - *) - PAVIOInterruptCB = ^TAVIOInterruptCB; - TAVIOInterruptCB = record - callback: Tcallback; - opaque: pointer; - end; (*TAVIOInterruptCB*) - - (** - * Directory entry types. - *) - TAVIODirEntryType = ( - AVIO_ENTRY_UNKNOWN, - AVIO_ENTRY_BLOCK_DEVICE, - AVIO_ENTRY_CHARACTER_DEVICE, - AVIO_ENTRY_DIRECTORY, - AVIO_ENTRY_NAMED_PIPE, - AVIO_ENTRY_SYMBOLIC_LINK, - AVIO_ENTRY_SOCKET, - AVIO_ENTRY_FILE, - AVIO_ENTRY_SERVER, - AVIO_ENTRY_SHARE, - AVIO_ENTRY_WORKGROUP - ); - - TAVIODataMarkerType = ( - (** - * Header data; this needs to be present for the stream to be decodeable. - *) - AVIO_DATA_MARKER_HEADER, - (** - * A point in the output bytestream where a decoder can start decoding - * (i.e. a keyframe). A demuxer/decoder given the data flagged with - * AVIO_DATA_MARKER_HEADER, followed by any AVIO_DATA_MARKER_SYNC_POINT, - * should give decodeable results. - *) - AVIO_DATA_MARKER_SYNC_POINT, - (** - * A point in the output bytestream where a demuxer can start parsing - * (for non self synchronizing bytestream formats). That is, any - * non-keyframe packet start point. - *) - AVIO_DATA_MARKER_BOUNDARY_POINT, - (** - * This is any, unlabelled data. It can either be a muxer not marking - * any positions at all, it can be an actual boundary/sync point - * that the muxer chooses not to mark, or a later part of a packet/fragment - * that is cut into multiple write callbacks due to limited IO buffer size. - *) - AVIO_DATA_MARKER_UNKNOWN, - (** - * Trailer data, which doesn't contain actual content, but only for - * finalizing the output file. - *) - AVIO_DATA_MARKER_TRAILER, - (** - * A point in the output bytestream where the underlying AVIOContext might - * flush the buffer depending on latency or buffering requirements. Typically - * means the end of a packet. - *) - AVIO_DATA_MARKER_FLUSH_POINT - ); - - (** - * Describes single entry of the directory. - * - * Only name and type fields are guaranteed be set. - * Rest of fields are protocol or/and platform dependent and might be unknown. - *) - PPAVIODirEntry = ^PAVIODirEntry; - PAVIODirEntry = ^TAVIODirEntry; - TAVIODirEntry = record - name: PAnsiChar; (**< Filename *) - type_: cint; (**< Type of the entry *) - utf8: cint; (**< Set to 1 when name is encoded with UTF-8, 0 otherwise. - Name can be encoded with UTF-8 even though 0 is set. *) - size: cint64; (**< File size in bytes, -1 if unknown. *) - modification_timestamp: cint64; (**< Time of last modification in microseconds since unix - epoch, -1 if unknown. *) - access_timestamp: cint64; (**< Time of last access in microseconds since unix epoch, - -1 if unknown. *) - status_change_timestamp: cint64; (**< Time of last status change in microseconds since unix - epoch, -1 if unknown. *) - user_id: cint64; (**< User ID of owner, -1 if unknown. *) - group_id: cint64; (**< Group ID of owner, -1 if unknown. *) - filemode: cint64; (**< Unix file mode, -1 if unknown. *) - end; - - PPAVIODirContext = ^PAVIODirContext; - PAVIODirContext = ^TAVIODirContext; - TAVIODirContext = record - url_context: pointer; - (** struct URLContext *url_context; *) - end; - -(** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVIOContext) must not be used outside libav*. - * - * @note None of the function pointers in AVIOContext should be called - * directly, they should only be set by the client application - * when implementing custom I/O. Normally these are set to the - * function pointers specified in avio_alloc_context() - *) - PPAVIOContext = ^PAVIOContext; - PAVIOContext = ^TAVIOContext; - TAVIOContext = record - (** - * A class for private options. - * - * If this AVIOContext is created by avio_open2(), av_class is set and - * passes the options down to protocols. - * - * If this AVIOContext is manually allocated, then av_class may be set by - * the caller. - * - * warning -- this field can be NULL, be sure to not pass this AVIOContext - * to any av_opt_* functions in that case. - *) - av_class: {const} PAVClass; - - (* - * The following shows the relationship between buffer, buf_ptr, - * buf_ptr_max, buf_end, buf_size, and pos, when reading and when writing - * (since AVIOContext is used for both): - * - ********************************************************************************** - * READING - ********************************************************************************** - * - * | buffer_size | - * |---------------------------------------| - * | | - * - * buffer buf_ptr buf_end - * +---------------+-----------------------+ - * |/ / / / / / / /|/ / / / / / /| | - * read buffer: |/ / consumed / | to be read /| | - * |/ / / / / / / /|/ / / / / / /| | - * +---------------+-----------------------+ - * - * pos - * +-------------------------------------------+-----------------+ - * input file: | | | - * +-------------------------------------------+-----------------+ - * - * - ********************************************************************************** - * WRITING - ********************************************************************************** - * - * | buffer_size | - * |--------------------------------------| - * | | - * - * buf_ptr_max - * buffer (buf_ptr) buf_end - * +-----------------------+--------------+ - * |/ / / / / / / / / / / /| | - * write buffer: | / / to be flushed / / | | - * |/ / / / / / / / / / / /| | - * +-----------------------+--------------+ - * buf_ptr can be in this - * due to a backward seek - * - * pos - * +-------------+----------------------------------------------+ - * output file: | | | - * +-------------+----------------------------------------------+ - * - *) - - buffer: PByteArray; (**< Start of the buffer. *) - buffer_size: cint; (**< Maximum buffer size *) - buf_ptr: PByteArray; (**< Current position in the buffer *) - buf_end: PByteArray; (**< End of the data, may be less than - buffer+buffer_size if the read function returned - less data than requested, e.g. for streams where - no more data has been received yet. *) - opaque: pointer; (**< A private pointer, passed to the read/write/seek/... - functions. *) - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc; - pos: cint64; (**< position in the file of the current buffer *) - must_flush: cint; (**< unused *) - eof_reached: cint; (**< true if eof reached *) - write_flag: cint; (**< true if open for writing *) - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PAnsiChar; size: cuint): culong; cdecl; - error: cint; (**< contains the error code or 0 if no error happened *) - (** - * Pause or resume playback for network streaming protocols - e.g. MMS. - *) - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - (** - * Seek to a given timestamp in stream with the specified stream_index. - * Needed for some network streaming protocols which don't support seeking - * to byte position. - *) - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - (** - * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. - *) - seekable: cint; - - (** - * max filesize, used to limit allocations - * This field is internal to libavformat and access from outside is not allowed. - *) - maxsize: cint64; - - (** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - direct: cint; - - (** - * Bytes read statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - bytes_read: cint64; - - (** - * seek statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - seek_count: cint; - - (** - * writeout statistic - * This field is internal to libavformat and access from outside is not allowed. - *) - writeout_count: cint; - - (** - * Original buffer size - * used internally after probing and ensure seekback to reset the buffer size - * This field is internal to libavformat and access from outside is not allowed. - *) - orig_buffer_size: cint; - - (** - * Threshold to favor readahead over seek. - * This is current internal only, do not use from outside. - *) - short_seek_threshold: cint; - - (** - * ',' separated list of allowed protocols. - *) - protocol_whitelist: {const} PAnsiChar; - - (** - * A callback that is used instead of write_packet. - *) - write_data_type: function(opaque: pointer; buf: Pcuint8; buf_size: cint; - type_: TAVIODataMarkerType; time: cint64): cint; cdecl; - (** - * If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT, - * but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly - * small chunks of data returned from the callback). - *) - ignore_boundary_point: cint; - - (** - * Internal, not meant to be used from outside of AVIOContext. - *) - current_type: TAVIODataMarkerType; - last_time: cint64; - - (** - * A callback that is used instead of short_seek_threshold. - * This is current internal only, do not use from outside. - *) - short_seek_get: function(opaque: pointer): cint; cdecl; - - written: cint64; - - (** - * Maximum reached position before a backward seek in the write buffer, - * used keeping track of already written data for a later flush. - *) - buf_ptr_max: PByteArray; - - (** - * Try to buffer at least this amount of data before flushing it - *) - min_packet_size: cint; - end; {AVIOContext} - -(* unbuffered I/O *) - -(** - * Return the name of the protocol that will handle the passed URL. - * - * NULL is returned if no protocol could be found for the given URL. - * - * @return Name of the protocol or NULL. - *) -function avio_find_protocol_name(url: {const} PAnsiChar): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Return AVIO_* access flags corresponding to the access permissions - * of the resource in url, or a negative value corresponding to an - * AVERROR code in case of failure. The returned access flags are - * masked by the value in flags. - * - * @note This function is intrinsically unsafe, in the sense that the - * checked resource may change its existence or permission status from - * one call to another. Thus you should not trust the returned value, - * unless you are sure that no other processes are accessing the - * checked resource. - *) -function avio_check(url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Move or rename a resource. - * - * @note url_src and url_dst should share the same protocol and authority. - * - * @param url_src url to resource to be moved - * @param url_dst new url to resource if the operation succeeded - * @return >=0 on success or negative on error. - *) -function avpriv_io_move(url_src: {const} PAnsiChar; url_dst: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Delete a resource. - * - * @param url resource to be deleted. - * @return >=0 on success or negative on error. - *) -function avpriv_io_delete(url: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Open directory for reading. - * - * @param s directory read context. Pointer to a NULL pointer must be passed. - * @param url directory to be listed. - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dictionary - * containing options that were not found. May be NULL. - * @return >=0 on success or negative on error. - *) -function avio_open_dir(s: PPAVIODirContext; url: {const} PAnsiChar; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Get next directory entry. - * - * Returned entry must be freed with avio_free_directory_entry(). In particular - * it may outlive AVIODirContext. - * - * @param s directory read context. - * @param[out] next next entry or NULL when no more entries. - * @return >=0 on success or negative on error. End of list is not considered an - * error. - *) -function avio_read_dir(s: PAVIODirContext; next: PPAVIODirEntry): cint; - cdecl; external av__format; - -(** - * Close directory. - * - * @note Entries created using avio_read_dir() are not deleted and must be - * freeded with avio_free_directory_entry(). - * - * @param s directory read context. - * @return >=0 on success or negative on error. - *) -function avio_close_dir(s: PPAVIODirContext): cint; - cdecl; external av__format; - -(** - * Free entry allocated by avio_read_dir(). - * - * @param entry entry to be freed. - *) -procedure avio_free_directory_entry(entry: PPAVIODirEntry); - cdecl; external av__format; - -(** - * Allocate and initialize an AVIOContext for buffered I/O. It must be later - * freed with avio_context_free(). - * - * @param buffer Memory block for input/output operations via AVIOContext. - * The buffer must be allocated with av_malloc() and friends. - * It may be freed and replaced with a new buffer by libavformat. - * AVIOContext.buffer holds the buffer currently in use, - * which must be later freed with av_free(). - * @param buffer_size The buffer size is very important for performance. - * For protocols with fixed blocksize it should be set to this blocksize. - * For others a typical size is a cache page, e.g. 4kb. - * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. - * @param opaque An opaque pointer to user-specific data. - * @param read_packet A function for refilling the buffer, may be NULL. - * @param write_packet A function for writing the buffer contents, may be NULL. - * The function may not change the input buffers content. - * @param seek A function for seeking to specified byte position, may be NULL. - * - * @return Allocated AVIOContext or NULL on failure. - *) -function avio_alloc_context( - buffer: PAnsiChar; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PAVIOContext; - cdecl; external av__format; - -(** - * Free the supplied IO context and everything associated with it. - * - * @param s Double pointer to the IO context. This function will write NULL - * into s. - *) -procedure avio_context_free(s: PAVIOContext); - cdecl; external av__format; - -procedure avio_w8(s: PAVIOContext; b: cint); - cdecl; external av__format; -procedure avio_write(s: PAVIOContext; buf: {const} PAnsiChar; size: cint); - cdecl; external av__format; -procedure avio_wl64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wb64(s: PAVIOContext; val: cuint64); - cdecl; external av__format; -procedure avio_wl32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb32(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb24(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wl16(s: PAVIOContext; val: cuint); - cdecl; external av__format; -procedure avio_wb16(s: PAVIOContext; val: cuint); - cdecl; external av__format; - -(** - * Write a NULL-terminated string. - * @return number of bytes written. - *) -function avio_put_str(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16LE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16le(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Convert an UTF-8 string to UTF-16BE and write it. - * @param s the AVIOContext - * @param str NULL-terminated UTF-8 string - * - * @return number of bytes written. - *) -function avio_put_str16be(s: PAVIOContext; str: {const} PAnsiChar): cint; - cdecl; external av__format; - -(** - * Mark the written bytestream as a specific type. - * - * Zero-length ranges are omitted from the output. - * - * @param time the stream time the current bytestream pos corresponds to - * (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not - * applicable - * @param type the kind of data written starting at the current pos - *) -procedure avio_write_marker(s: PAVIOContext; time: cint64; type_: TAVIODataMarkerType); - cdecl; external av__format; - -const -(** - * ORing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -(** - * Passing this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonable - * means that can be extremely slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; - -(** - * fseek() equivalent for AVIOContext. - * @return new position or AVERROR. - *) -function avio_seek(s: PAVIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward - * @return new position or AVERROR. - *) -function avio_skip(s: PAVIOContext; offset: cint64): cint64; - cdecl; external av__format; - -{$IFDEF UNIX} -(** - * ftell() equivalent for AVIOContext. - * @return position or AVERROR. - *) -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -{$ELSE} -{$ENDIF} - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function avio_size(s: PAVIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for AVIOContext. - * @return non zero if and only if end of file - *) -function avio_feof(s: PAVIOContext): cint; - cdecl; external av__format; -{$IFDEF FF_API_URL_FEOF} -(** - * @deprecated use avio_feof() - *) -function url_feof(s: PAVIOContext): cint; - cdecl; external av__format; {attribute_deprecated} -{$ENDIF} - -(** @warning Writes up to 4 KiB per call *) -function avio_printf(s: PAVIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** - * Force flushing of buffered data. - * - * For write streams, force the buffered data to be immediately written to the output, - * without to wait to fill the internal buffer. - * - * For read streams, discard all currently buffered data, and advance the - * reported file position to that of the underlying stream. This does not - * read new data, and does not perform any seeks. - *) -procedure avio_flush(s: PAVIOContext); - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. - * @return number of bytes read or AVERROR - *) -function avio_read(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed - * to read fewer bytes than requested. The missing bytes can be read in the next - * call. This always tries to read at least 1 byte. - * Useful to reduce latency in certain cases. - * @return number of bytes read or AVERROR - *) -function avio_read_partial(s: PAVIOContext; buf: Pbyte; size: cint): cint; - cdecl; external av__format; - -(** - * @name Functions for reading from AVIOContext - * @ - * - * @note return 0 if EOF, so you cannot use it if EOF handling is - * necessary - *) -function avio_r8(s: PAVIOContext): cint; - cdecl; external av__format; - -function avio_rl16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rl64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -function avio_rb16(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb24(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb32(s: PAVIOContext): cuint; - cdecl; external av__format; - -function avio_rb64(s: PAVIOContext): cuint64; - cdecl; external av__format; - -(** - * @ - *) -(** - * Read a string from pb into buf. The reading will terminate when either - * a NULL character was encountered, maxlen bytes have been read, or nothing - * more can be read from pb. The result is guaranteed to be NULL-terminated, it - * will be truncated if buf is too small. - * Note that the string is not interpreted or validated in any way, it - * might get truncated in the middle of a sequence for multi-byte encodings. - * - * @return number of bytes read (is always <= maxlen). - * If reading ends on EOF or error, the return value will be one more than - * bytes actually read. - *) -function avio_get_str(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * Read a UTF-16 string from pb and convert it to UTF-8. - * The reading will terminate when either a null or invalid character was - * encountered or maxlen bytes have been read. - * @return number of bytes read (is always <= maxlen) - *) -function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint; - cdecl; external av__format; - -(** - * @name URL open modes - * The flags argument to avio_open must be one of the following - * constants, optionally ORed with other flags. - * @{ - *) -const - AVIO_FLAG_READ = 1; (**< read-only *) - AVIO_FLAG_WRITE = 2; (**< write-only *) - AVIO_FLAG_READ_WRITE = {(AVIO_FLAG_READ|AVIO_FLAG_WRITE)} 3; (**< read-write pseudo flag *) -(** - * @ - *) - -const -(** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - *) - AVIO_FLAG_NONBLOCK = 8; - -(** - * Use direct mode. - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - *) - AVIO_FLAG_DIRECT = $8000; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open(s: PPAVIOContext; url: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Create and initialize a AVIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the AVIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created AVIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @param int_cb an interrupt callback to be used at the protocols level - * @param options A dictionary filled with protocol-private options. On return - * this parameter will be destroyed and replaced with a dict containing options - * that were not found. May be NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function avio_open2(s: PPAVIOContext; {const} url: PAnsiChar; flags: cint; - {const} int_cb: PAVIOInterruptCB; options: PPAVDictionary): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext s and free it. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_close(s: PAVIOContext): cint; - cdecl; external av__format; - -(** - * Close the resource accessed by the AVIOContext *s, free it - * and set the pointer pointing to it to NULL. - * This function can only be used if s was opened by avio_open(). - * - * The internal buffer is automatically flushed before closing the - * resource. - * - * @return 0 on success, an AVERROR < 0 on error. - * @see avio_close - *) -function avio_closep(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -function avio_open_dyn_buf(s: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. - * The AVIOContext stream is left intact. - * The buffer must NOT be freed. - * No padding is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_get_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). - * Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. - * - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint; - cdecl; external av__format; - -(** - * Iterate through names of available protocols. - * - * @param opaque A private pointer representing current protocol. - * It must be a pointer to NULL on first iteration and will - * be updated by successive calls to avio_enum_protocols. - * @param output If set to 1, iterate over output protocols, - * otherwise over input protocols. - * - * @return A static string containing the name of current protocol or NULL - *) -function avio_enum_protocols(var opaque: Pointer; output: cint): {const} PAnsiChar; - cdecl; external av__format; - -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function avio_pause(h: PAVIOContext; pause: cint): cint; - cdecl; external av__format; - -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat: : read_seek - *) -function avio_seek_time(h: PAVIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; - -(* Avoid a warning. The header can not be included because it breaks c++. *) -type - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - end; - -(** - * Read contents of h into print buffer, up to max_size bytes, or up to EOF. - * - * @return 0 for success (max_size bytes read or EOF reached), negative error - * code otherwise - *) -function avio_read_to_bprint(h: PAVIOContext; pb: PAVBPrint; max_size: size_t): cint; - cdecl; external av__format; - -(** - * Accept and allocate a client context on a server context. - * @param s the server context - * @param c the client context, must be unallocated - * @return >= 0 on success or a negative value corresponding - * to an AVERROR on failure - *) -function avio_accept(s: PAVIOContext; c: PPAVIOContext): cint; - cdecl; external av__format; - -(** - * Perform one step of the protocol handshake to accept a new client. - * This function must be called on a client returned by avio_accept() before - * using it as a read/write context. - * It is separate from avio_accept() because it may block. - * A step of the handshake is defined by places where the application may - * decide to change the proceedings. - * For example, on a protocol with a request header and a reply header, each - * one can constitute a step because the application may use the parameters - * from the request to change parameters in the reply; or each individual - * chunk of the request can constitute a step. - * If the handshake is already finished, avio_handshake() does nothing and - * returns 0 immediately. - * - * @param c the client context to perform the handshake on - * @return 0 on a complete and successful handshake - * > 0 if the handshake progressed, but is not complete - * < 0 for an AVERROR code - *) -function avio_handshake(c: PAVIOContext): cint; - cdecl; external av__format; - -implementation - -(** - * For SEEK_CUR on Windows - * values taken from stdio.h of C - *) -{$IFNDEF SEEK_SET} -const - SEEK_SET = 0; -{$ENDIF} - -{$IFNDEF SEEK_CUR} -const - SEEK_CUR = 1; -{$ENDIF} - -{$IFNDEF SEEK_END} -const - SEEK_END = 2; -{$ENDIF} - -function avio_tell(s: PAVIOContext): cint64; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := avio_seek(s, 0, SEEK_CUR); -end; - - -end. diff --git a/src/lib/ffmpeg-3.4/avutil.pas b/src/lib/ffmpeg-3.4/avutil.pas deleted file mode 100644 index 02973aa7..00000000 --- a/src/lib/ffmpeg-3.4/avutil.pas +++ /dev/null @@ -1,382 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * version: 54.7.100 - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 55; - LIBAVUTIL_MAX_VERSION_MINOR = 78; - LIBAVUTIL_MAX_VERSION_RELEASE = 100; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 55; - LIBAVUTIL_MIN_VERSION_MINOR = 78; - LIBAVUTIL_MIN_VERSION_RELEASE = 100; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -type -{$IFNDEF FPC} - // defines for Delphi - size_t = cardinal; -{$ENDIF} - Psize_t = ^size_t; - -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; - -(** - * Return an informative version string. This usually is the actual release - * version number or a git commit description. This string has no fixed format - * and can change any time. It should never be parsed by code. - *) -function av_version_info(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; - -(** - * @addtogroup lavu_media Media Type - * @brief Media Type - *) - -type - - PAVFile = pointer; - - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse - AVMEDIA_TYPE_NB - ); - -(** - * Return a string describing the media_type enum, NULL if media_type - * is unknown. - *) -function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; - cdecl; external av__util; - -const - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256*128-1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - -(** - * @brief Undefined timestamp value - * - * Usually reported by demuxer that work on containers that do not provide - * either pts or dts. - *) - - AV_NOPTS_VALUE = $8000000000000000; - -(** - * Internal time base represented as integer - *) - - AV_TIME_BASE = 1000000; - -(** - * Internal time base represented as fractional value - *) - - AV_TIME_BASE_Q : TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * @} - * @} - * @defgroup lavu_picture Image related - * - * AVPicture types, pixel formats and basic image planes manipulation. - * - * @ - *) - -type - TAVPictureType = ( - AV_PICTURE_TYPE_NONE = 0, ///< Undefined - AV_PICTURE_TYPE_I, ///< Intra - AV_PICTURE_TYPE_P, ///< Predicted - AV_PICTURE_TYPE_B, ///< Bi-dir predicted - AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG-4 - AV_PICTURE_TYPE_SI, ///< Switching Intra - AV_PICTURE_TYPE_SP, ///< Switching Predicted - AV_PICTURE_TYPE_BI ///< BI type - ); - -(** - * Return a single letter to describe the given picture type - * pict_type. - * - * @param[in] pict_type the picture type @return a single character - * representing the picture type, '?' if pict_type is unknown - *) -function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; - cdecl; external av__util; - -(** - * Return x default pointer in case p is NULL. - *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compute the length of an integer list. - * - * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length_for_size(elsize: cuint; - {const} list: pointer; term: cuint64): cuint; {av_pure} - cdecl; external av__util; - -(** - * Compute the length of an integer list. - * - * @param term list terminator (usually 0 or -1) - * @param list pointer to the list - * @return length of the list, in elements, not counting the terminator - *) -function av_int_list_length({const} list: pointer; term: cuint64): cuint; - -(** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - *) -function av_fopen_utf8(path: {const} Pchar; mode: {const} Pchar): PAVFile; - cdecl; external av__util; - -(** - * Return the fractional representation of the internal time base. - *) -function av_get_time_base_q: TAVRational; - cdecl; external av__util; - -const AV_FOURCC_MAX_STRING_SIZE = 32; - -function av_fourcc2str(fourcc: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing a FourCC (four-character - * code) representation. - * - * @param buf a buffer with size in bytes of at least AV_FOURCC_MAX_STRING_SIZE - * @param fourcc the fourcc to represent - * @return the buffer in input - *) -function av_fourcc_make_string(buf: PAnsiChar; fourcc: cuint64): PAnsiChar; - cdecl; external av__util; - -{$INCLUDE libavutil/cpu.pas} - -{$INCLUDE libavutil/dict.pas} - -{$INCLUDE libavutil/error.pas} - -{$INCLUDE libavutil/mathematics.pas} - -{$INCLUDE libavutil/mem.pas} - -{$INCLUDE libavutil/log.pas} - -{$INCLUDE libavutil/pixfmt.pas} - -{$INCLUDE libavutil/samplefmt.pas} - -{$INCLUDE libavutil/opt.pas} - -{$INCLUDE libavutil/buffer.pas} - -{$INCLUDE libavutil/frame.pas} - - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -implementation - -uses - SysUtils; - -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} -begin - if p = nil then - Result := x - else - Result := p; -end; - -function av_int_list_length({const} list: pointer; term: cuint64): cuint; -begin - // KMS 2013: It is not really clear whether it should be sizeof(pointer) or sizeof(cint). - // Going for the larger one (pointer) should at least prevent buffer overflows. - // So, the result is either 4 byte or 8 byte. - Result := av_int_list_length_for_size(sizeof(pointer), list, term); -end; - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -(* libavutil/error.h *) - -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -begin - av_strerror(errnum, errbuf, errbuf_size); - av_make_error_string := errbuf; -end; - -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -var - errbuf: Pchar; -begin - errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); - av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); - av_err2str := errbuf; -end; - -(* libavutil/mem.h *) - -function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; - cdecl; external av__util; -(* To Be Implemented, March 2012 KMS *) -//function av_size_mult(a: size_t; b: size_t; r: pointer): size_t; -//begin -// { -// size_t t = a * b; -// /* Hack inspired from glibc: only try the division if nelem and elsize -// * are both greater than sqrt(SIZE_MAX). */ -// if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) -// return AVERROR(EINVAL); -// *r = t; -// return 0; -//} -//end; - -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_malloc_array := NIL - else - av_malloc_array := av_malloc(nmemb * size); -end; - -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1,2)} -begin - if (size <= 0 ) or (nmemb >= maxint / size) then - av_mallocz_array := NIL - else - av_mallocz_array := av_mallocz(nmemb * size); -end; - -function AVERROR(e: integer): integer; -begin - AVERROR := AVERROR_SIGN * e; -end; - -end. diff --git a/src/lib/ffmpeg-3.4/ff_api-defines.inc b/src/lib/ffmpeg-3.4/ff_api-defines.inc deleted file mode 100644 index a0a555f1..00000000 --- a/src/lib/ffmpeg-3.4/ff_api-defines.inc +++ /dev/null @@ -1,287 +0,0 @@ -// prevent pasdoc from parsing this file -{$IFNDEF PASDOC} - -(** - * FF_API_* defines may be placed below to indicate public API that will be - * dropped at a future version bump. The defines themselves are not part of - * the public API and may change, break or disappear at any time. - *) - -(** avcodec defines *) -{$ifndef FF_API_VIMA_DECODER} -{$define FF_API_VIMA_DECODER := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AUDIO_CONVERT} -{$define FF_API_AUDIO_CONVERT := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCODEC_RESAMPLE} -{$define FF_API_AVCODEC_RESAMPLE := FF_API_AUDIO_CONVERT} -{$endif} -{$ifndef FF_API_MISSING_SAMPLE} -{$define FF_API_MISSING_SAMPLE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LOWRES} -{$define FF_API_LOWRES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_CAP_VDPAU} -{$define FF_API_CAP_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_BUFS_VDPAU} -{$define FF_API_BUFS_VDPAU := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VOXWARE} -{$define FF_API_VOXWARE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_SET_DIMENSIONS} -{$define FF_API_SET_DIMENSIONS := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_DEBUG_MV} -{$define FF_API_DEBUG_MV := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AC_VLC} -{$define FF_API_AC_VLC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_OLD_MSMPEG4} -{$define FF_API_OLD_MSMPEG4 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ASPECT_EXTENDED} -{$define FF_API_ASPECT_EXTENDED := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_ALPHA} -{$define FF_API_ARCH_ALPHA := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ERROR_RATE} -{$define FF_API_ERROR_RATE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_QSCALE_TYPE} -{$define FF_API_QSCALE_TYPE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MB_TYPE} -{$define FF_API_MB_TYPE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MAX_BFRAMES} -{$define FF_API_MAX_BFRAMES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NEG_LINESIZES} -{$define FF_API_NEG_LINESIZES := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_EMU_EDGE} -{$define FF_API_EMU_EDGE := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_SH4} -{$define FF_API_ARCH_SH4 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_ARCH_SPARC} -{$define FF_API_ARCH_SPARC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_UNUSED_MEMBERS} -{$define FF_API_UNUSED_MEMBERS := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_IDCT_XVIDMMX} -{$define FF_API_IDCT_XVIDMMX := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_INPUT_PRESERVED} -{$define FF_API_INPUT_PRESERVED := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NORMALIZE_AQP} -{$define FF_API_NORMALIZE_AQP := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_GMC} -{$define FF_API_GMC := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MV0} -{$define FF_API_MV0 := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_CODEC_NAME} -{$define FF_API_CODEC_NAME := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AFD} -{$define FF_API_AFD := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VISMV} -(* XXX: don't forget to drop the -vismv documentation *) -{$define FF_API_VISMV := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AUDIOENC_DELAY} -{$define FF_API_AUDIOENC_DELAY := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_VAAPI_CONTEXT} -{$define FF_API_VAAPI_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_MERGE_SD} -{$define FF_API_MERGE_SD := (LIBAVCODEC_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_AVCTX_TIMEBASE} -{$define FF_API_AVCTX_TIMEBASE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MPV_OPT} -{$define FF_API_MPV_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STREAM_CODEC_TAG} -{$define FF_API_STREAM_CODEC_TAG := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_QUANT_BIAS} -{$define FF_API_QUANT_BIAS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_RC_STRATEGY} -{$define FF_API_RC_STRATEGY := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CODED_FRAME} -{$define FF_API_CODED_FRAME := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MOTION_EST} -{$define FF_API_MOTION_EST := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_WITHOUT_PREFIX} -{$define FF_API_WITHOUT_PREFIX := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_SIDEDATA_ONLY_PKT} -{$define FF_API_SIDEDATA_ONLY_PKT:= (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_VDPAU_PROFILE} -{$define FF_API_VDPAU_PROFILE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CONVERGENCE_DURATION} -{$define FF_API_CONVERGENCE_DURATION := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_AVPICTURE} -{$define FF_API_AVPICTURE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_AVPACKET_OLD_API} -{$define FF_API_AVPACKET_OLD_API := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_RTP_CALLBACK} -{$define FF_API_RTP_CALLBACK := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_VBV_DELAY} -{$define FF_API_VBV_DELAY := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_CODER_TYPE} -{$define FF_API_CODER_TYPE := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STAT_BITS} -{$define FF_API_STAT_BITS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_PRIVATE_OPT} -{$define FF_API_PRIVATE_OPT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_ASS_TIMING} -{$define FF_API_ASS_TIMING := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_OLD_BSF} -{$define FF_API_OLD_BSF := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_COPY_CONTEXT} -{$define FF_API_COPY_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_GET_CONTEXT_DEFAULTS} -{$define FF_API_GET_CONTEXT_DEFAULTS := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_NVENC_OLD_NAME} -{$define FF_API_NVENC_OLD_NAME := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_STRUCT_VAAPI_CONTEXT} -{$define FF_API_STRUCT_VAAPI_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_MERGE_SD_API} -{$define FF_API_MERGE_SD_API := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_TAG_STRING} -{$define FF_API_TAG_STRING := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} -{$ifndef FF_API_GETCHROMA} -{$define FF_API_GETCHROMA := (LIBAVCODEC_VERSION_MAJOR < 59)} -{$endif} - -(* avutil defines *) -{$ifndef FF_API_VDPAU} -{$define FF_API_VDPAU := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_XVMC} -{$define FF_API_XVMC := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_OPT_TYPE_METADATA} -{$define FF_API_OPT_TYPE_METADATA := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_DLOG} -{$define FF_API_DLOG := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_VAAPI} -{$define FF_API_VAAPI := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_FRAME_QP} -{$define FF_API_FRAME_QP := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_PLUS1_MINUS1} -{$define FF_API_PLUS1_MINUS1 := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_ERROR_FRAME} -{$define FF_API_ERROR_FRAME := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CRC_BIG_TABLE} -{$define FF_API_CRC_BIG_TABLE := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_PKT_PTS} -{$define FF_API_PKT_PTS := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} -{$ifndef FF_API_CRYPTO_SIZE_T} -{$define FF_API_CRYPTO_SIZE_T := (LIBAVUTIL_VERSION_MAJOR < 56)} -{$endif} - -(** avformat FF_API defines *) -{$ifndef FF_API_LAVF_BITEXACT} -{$define FF_API_LAVF_BITEXACT := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_FRAC} -{$define FF_API_LAVF_FRAC := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_CODEC_TB} -{$define FF_API_LAVF_CODEC_TB := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_URL_FEOF} -{$define FF_API_URL_FEOF := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_FMT_RAWPICTURE} -{$define FF_API_LAVF_FMT_RAWPICTURE := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_COMPUTE_PKT_FIELDS2} -{$define FF_API_COMPUTE_PKT_FIELDS2 := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_OLD_OPEN_CALLBACKS} -{$define FF_API_OLD_OPEN_CALLBACKS := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_AVCTX} -{$define FF_API_LAVF_AVCTX := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_NOCONST_GET_SIDE_DATA} -{$define FF_API_NOCONST_GET_SIDE_DATA := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_HTTP_USER_AGENT} -{$define FF_API_HTTP_USER_AGENT := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_HLS_WRAP} -{$define FF_API_HLS_WRAP := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_MERGE_SD} -{$define FF_API_LAVF_MERGE_SD := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_LAVF_KEEPSIDE_FLAG} -{$define FF_API_LAVF_KEEPSIDE_FLAG := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} -{$ifndef FF_API_OLD_ROTATE_API} -{$define FF_API_OLD_ROTATE_API := (LIBAVFORMAT_VERSION_MAJOR < 58)} -{$endif} - -{$ifndef FF_API_R_FRAME_RATE} -{$define FF_API_R_FRAME_RATE := 1} -{$endif} - -(** swscale FF_API defines *) -{$ifndef FF_API_SWS_VECTOR} -{$define FF_API_SWS_VECTOR := (LIBSWSCALE_VERSION_MAJOR < 6)} -{$endif} - -{$ENDIF PASDOC} diff --git a/src/lib/ffmpeg-3.4/libavcodec/audioconvert.pas b/src/lib/ffmpeg-3.4/libavcodec/audioconvert.pas deleted file mode 100644 index cf6c96bb..00000000 --- a/src/lib/ffmpeg-3.4/libavcodec/audioconvert.pas +++ /dev/null @@ -1,294 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/channel_layout.h and libavcodec/audioconvert.h - * avutil version 52.66.100; avcodec version 55.52.102 - * - *) - -(** libavutil/channel_layout.h **) - -(** - * @file - * audio channel layout utility functions - *) - -(** - * @defgroup channel_masks Audio channel masks - * - * A channel layout is a 64-bits integer with a bit set for every channel. - * The number of bits set must be equal to the number of channels. - * The value 0 means that the channel layout is not known. - * @note this data structure is not powerful enough to handle channels - * combinations that have the same channel multiple times, such as - * dual-mono. - * - *) -const - {* Audio channel masks *} - AV_CH_FRONT_LEFT = $00000001; - AV_CH_FRONT_RIGHT = $00000002; - AV_CH_FRONT_CENTER = $00000004; - AV_CH_LOW_FREQUENCY = $00000008; - AV_CH_BACK_LEFT = $00000010; - AV_CH_BACK_RIGHT = $00000020; - AV_CH_FRONT_LEFT_OF_CENTER = $00000040; - AV_CH_FRONT_RIGHT_OF_CENTER = $00000080; - AV_CH_BACK_CENTER = $00000100; - AV_CH_SIDE_LEFT = $00000200; - AV_CH_SIDE_RIGHT = $00000400; - AV_CH_TOP_CENTER = $00000800; - AV_CH_TOP_FRONT_LEFT = $00001000; - AV_CH_TOP_FRONT_CENTER = $00002000; - AV_CH_TOP_FRONT_RIGHT = $00004000; - AV_CH_TOP_BACK_LEFT = $00008000; - AV_CH_TOP_BACK_CENTER = $00010000; - AV_CH_TOP_BACK_RIGHT = $00020000; - AV_CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - AV_CH_STEREO_RIGHT = $40000000; ///< See AV_CH_STEREO_LEFT. - AV_CH_WIDE_LEFT = $0000000080000000; - AV_CH_WIDE_RIGHT = $0000000100000000; - AV_CH_SURROUND_DIRECT_LEFT = $0000000200000000; - AV_CH_SURROUND_DIRECT_RIGHT = $0000000400000000; - AV_CH_LOW_FREQUENCY_2 = $0000000800000000; - -(** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *) - AV_CH_LAYOUT_NATIVE = $8000000000000000; - -(** - * @} - * @defgroup channel_mask_c Audio channel convenience macros - * @{ - * *) - AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT or AV_CH_FRONT_RIGHT); - AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO or AV_CH_FRONT_CENTER); - AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND or AV_CH_SIDE_LEFT or AV_CH_SIDE_RIGHT); - AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0 or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND or AV_CH_BACK_LEFT or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK or AV_CH_BACK_CENTER); - AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT or AV_CH_LOW_FREQUENCY); - AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1 or AV_CH_BACK_LEFT or AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1 or AV_CH_FRONT_LEFT_OF_CENTER or - AV_CH_FRONT_RIGHT_OF_CENTER); - AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0 or AV_CH_BACK_LEFT or AV_CH_BACK_CENTER or - AV_CH_BACK_RIGHT); - AV_CH_LAYOUT_HEXADECAGONAL = (AV_CH_LAYOUT_OCTAGONAL or AV_CH_WIDE_LEFT or AV_CH_WIDE_RIGHT or AV_CH_TOP_BACK_LEFT or - AV_CH_TOP_BACK_RIGHT or AV_CH_TOP_BACK_CENTER or AV_CH_TOP_FRONT_CENTER or - AV_CH_TOP_FRONT_LEFT or AV_CH_TOP_FRONT_RIGHT); - AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT or AV_CH_STEREO_RIGHT); - -type - TAVMatrixEncoding = ( - AV_MATRIX_ENCODING_NONE, - AV_MATRIX_ENCODING_DOLBY, - AV_MATRIX_ENCODING_DPLII, - AV_MATRIX_ENCODING_DPLIIX, - AV_MATRIX_ENCODING_DPLIIZ, - AV_MATRIX_ENCODING_DOLBYEX, - AV_MATRIX_ENCODING_DOLBYHEADPHONE, - AV_MATRIX_ENCODING_NB - ); - -(** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, optionally followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" - *) -function av_get_channel_layout(name: {const} PAnsiChar): cuint64; - cdecl; external av__util; - -(** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - *) -procedure av_get_channel_layout_string(buf: PAnsiChar; buf_size: cint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -type -// Type definition from libavutil/bprint.h -// The actual record is padded to a certain number of bytes. -// As of now (2013) this number is 1024. - PAVBPrint = ^TAVBPrint; - TAVBPrint = record - case integer of - 0 : (paddedRecord: array[1..1024] of byte); - 1 : ( - str: PAnsiChar; //** string so far */ - len: cuint; //** length so far */ - size: cuint; //** allocated memory */ - size_max: cuint; //** maximum allocated memory */ - reserved_internal_buffer: Pchar - ); - end; - -(** - * Append a description of a channel layout to a bprint buffer. - *) -procedure av_bprint_channel_layout(bp: PAVBPrint; nb_channels: cint; channel_layout: cuint64); - cdecl; external av__util; - -(** - * Return the number of channels in the channel layout. - *) -function av_get_channel_layout_nb_channels(channel_layout: cuint64): cint; - cdecl; external av__util; - -(** - * Return default channel layout for a given number of channels. - *) -function av_get_default_channel_layout(nb_channels: cint): cint64; - cdecl; external av__util; - -(** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - *) -function av_get_channel_layout_channel_index(channel_layout: cuint64; - channel: cuint64): cint; - cdecl; external av__util; - -(** - * Get the channel with the given index in channel_layout. - *) -function av_channel_layout_extract_channel(channel_layout: cuint64; index: cint): cuint64; - cdecl; external av__util; - -(** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - *) -function av_get_channel_name(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - *) -function av_get_channel_description(channel: cuint64): PAnsiChar; - cdecl; external av__util; - -(** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - *) -function av_get_standard_channel_layout(index: cuint; layout: Pcuint64; - name: {const} PPAnsiChar): cint; - cdecl; external av__util; - -{$IFDEF FF_API_AUDIO_CONVERT} - -(** libavcodec/audioconvert.h **) - -// type definition from libavcodec/audioconvert.c -type - PAVAudioConvert = ^TAVAudioConvert; - TAVAudioConvert = record - in_channels, out_channels: cint; - fmt_pair: cint; - end; - -(** - * Create an audio sample format converter context - * @param out_fmt Output sample format - * @param out_channels Number of output channels - * @param in_fmt Input sample format - * @param in_channels Number of input channels - * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. - * @param flags See AV_CPU_FLAG_xx - * @return NULL on error - *) -function av_audio_convert_alloc(out_fmt: TAVSampleFormat; out_channels: cint; - in_fmt: TAVSampleFormat; in_channels: cint; - matrix: {const} Pcfloat; flags: cint): PAVAudioConvert; - cdecl; external av__codec; - -(** - * Free audio sample format converter context - *) -procedure av_audio_convert_free(ctx: PAVAudioConvert); - cdecl; external av__codec; - -type - P6 = array [1..6] of pointer; - I6 = array [1..6] of cint; - -(** - * Convert between audio sample formats - * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive output samples (measured in bytes) - * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive input samples (measured in bytes) - * @param len length of audio frame size (measured in samples) - *) -function av_audio_convert(ctx: PAVAudioConvert; - out[6]: {const} P6; out_stride[6]: {const} I6; - in[6]: {const} P6; in_stride[6]: {const} I6; len: cint): cint; - cdecl; external av__codec; - -{$IFEND} diff --git a/src/lib/ffmpeg-3.4/libavutil/buffer.pas b/src/lib/ffmpeg-3.4/libavutil/buffer.pas deleted file mode 100644 index 5d7a747b..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/buffer.pas +++ /dev/null @@ -1,310 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/buffer.h - * avutil version 54.7.100 - * - *) - -const -(** - * Always treat the buffer as read-only, even when it has only one - * reference. - *) - AV_BUFFER_FLAG_READONLY = (1 << 0); - -type -(** - * @defgroup lavu_buffer AVBuffer - * @ingroup lavu_data - * - * @ - * AVBuffer is an API for reference-counted data buffers. - * - * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer - * represents the data buffer itself; it is opaque and not meant to be accessed - * by the caller directly, but only through AVBufferRef. However, the caller may - * e.g. compare two AVBuffer pointers to check whether two different references - * are describing the same data buffer. AVBufferRef represents a single - * reference to an AVBuffer and it is the object that may be manipulated by the - * caller directly. - * - * There are two functions provided for creating a new AVBuffer with a single - * reference -- av_buffer_alloc() to just allocate a new buffer, and - * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing - * reference, additional references may be created with av_buffer_ref(). - * Use av_buffer_unref() to free a reference (this will automatically free the - * data once all the references are freed). - * - * The convention throughout this API and the rest of FFmpeg is such that the - * buffer is considered writable if there exists only one reference to it (and - * it has not been marked as read-only). The av_buffer_is_writable() function is - * provided to check whether this is true and av_buffer_make_writable() will - * automatically create a new writable buffer when necessary. - * Of course nothing prevents the calling code from violating this convention, - * however that is safe only when all the existing references are under its - * control. - * - * @note Referencing and unreferencing the buffers is thread-safe and thus - * may be done from multiple threads simultaneously without any need for - * additional locking. - * - * @note Two different references to the same buffer can point to different - * parts of the buffer (i.e. their AVBufferRef.data will not be equal). - *) - -(** - * A reference counted buffer type. It is opaque and is meant to be used through - * references (AVBufferRef). - *) - TAVBuffer = record - end; - -(** - * A reference to a data buffer. - * - * The size of this struct is not a part of the public ABI and it is not meant - * to be allocated directly. - *) - PPAVBufferRef = ^PAVBufferRef; - PAVBufferRef = ^TAVBufferRef; - TAVBufferRef = record - buffer: TAVBuffer; - (** - * The data buffer. It is considered writable if and only if - * this is the only reference to the buffer, in which case - * av_buffer_is_writable() returns 1. - *) - data: PByte; - (** - * Size of data in bytes. - *) - size: cint; - end; - - //callbacks used in the functions av_buffer_create and av_buffer_pool_init respectively - TFree = procedure(opaque: pointer; data: pbyte); - TAlloc = function(size: cint): PAVBufferRef; - TAlloc2 = function(opaque: pointer; size: cint): PAVBufferRef; - TPoolFree = procedure(opaque: pointer); - -(** - * The buffer pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with av_buffer_pool_init() and freed with - * av_buffer_pool_uninit(). - *) - PPAVBufferPool = ^PAVBufferPool; - PAVBufferPool = ^TAVBufferPool; - TAVBufferPool = record - end; - -(** - * Allocate an AVBuffer of the given size using av_malloc(). - * - * @return an AVBufferRef of given size or NULL when out of memory - *) -function av_buffer_alloc(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Same as av_buffer_alloc(), except the returned buffer will be initialized - * to zero. - *) -function av_buffer_allocz(size: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Create an AVBuffer from an existing array. - * - * If this function is successful, data is owned by the AVBuffer. The caller may - * only access data through the returned AVBufferRef and references derived from - * it. - * If this function fails, data is left untouched. - * @param data data array - * @param size size of data in bytes - * @param free a callback for freeing this buffer's data - * @param opaque parameter to be got for processing or passed to free - * @param flags a combination of AV_BUFFER_FLAG_* - * - * @return an AVBufferRef referring to data on success, NULL on failure. - *) - -function av_buffer_create(data: PByte; size: cint; - free: TFree; - opaque: pointer; flags: cint): PAVBufferRef; - cdecl; external av__util; - -(** - * Default free callback, which calls av_free() on the buffer data. - * This function is meant to be passed to av_buffer_create(), not called - * directly. - *) -procedure av_buffer_default_free(opaque: pointer; data: pbyte); - cdecl; external av__util; - -(** - * Create a new reference to an AVBuffer. - * - * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on - * failure. - *) -function av_buffer_ref(buf: PAVBufferRef): PAVBufferRef; - cdecl; external av__util; - -(** - * Free a given reference and automatically free the buffer if there are no more - * references to it. - * - * @param buf the reference to be freed. The pointer is set to NULL on return. - *) -procedure av_buffer_unref(buf: PPAVBufferRef); - cdecl; external av__util; - -(** - * @return 1 if the caller may write to the data referred to by buf (which is - * true if and only if buf is the only reference to the underlying AVBuffer). - * Return 0 otherwise. - * A positive answer is valid until av_buffer_ref() is called on buf. - *) -function av_buffer_is_writable(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * @return the opaque parameter set by av_buffer_create. - *) -procedure av_buffer_get_opaque(buf: {const} PAVBufferRef); - cdecl; external av__util; - -function av_buffer_get_ref_count(buf: {const} PAVBufferRef): cint; - cdecl; external av__util; - -(** - * Create a writable reference from a given buffer reference, avoiding data copy - * if possible. - * - * @param buf buffer reference to make writable. On success, buf is either left - * untouched, or it is unreferenced and a new writable AVBufferRef is - * written in its place. On failure, buf is left untouched. - * @return 0 on success, a negative AVERROR on failure. - *) -function av_buffer_make_writable(buf: PPAVBufferRef): cint; - cdecl; external av__util; - -(** - * Reallocate a given buffer. - * - * @param buf a buffer reference to reallocate. On success, buf will be - * unreferenced and a new reference with the required size will be - * written in its place. On failure buf will be left untouched. *buf - * may be NULL, then a new buffer is allocated. - * @param size required new buffer size. - * @return 0 on success, a negative AVERROR on failure. - * - * @note the buffer is actually reallocated with av_realloc() only if it was - * initially allocated through av_buffer_realloc(NULL) and there is only one - * reference to it (i.e. the one passed to this function). In all other cases - * a new buffer is allocated and the data is copied. - *) -function av_buffer_realloc(buf: PPAVBufferRef; size: cint): cint; - cdecl; external av__util; - -(** - * @defgroup lavu_bufferpool AVBufferPool - * @ingroup lavu_data - * - * @ - * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. - * - * Frequently allocating and freeing large buffers may be slow. AVBufferPool is - * meant to solve this in cases when the caller needs a set of buffers of the - * same size (the most obvious use case being buffers for raw video or audio - * frames). - * - * At the beginning, the user must call av_buffer_pool_init() to create the - * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to - * get a reference to a new buffer, similar to av_buffer_alloc(). This new - * reference works in all aspects the same way as the one created by - * av_buffer_alloc(). However, when the last reference to this buffer is - * unreferenced, it is returned to the pool instead of being freed and will be - * reused for subsequent av_buffer_pool_get() calls. - * - * When the caller is done with the pool and no longer needs to allocate any new - * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. - * Once all the buffers are released, it will automatically be freed. - * - * Allocating and releasing buffers with this API is thread-safe as long as - * either the default alloc callback is used, or the user-supplied one is - * thread-safe. - *) - -(** - * Allocate and initialize a buffer pool. - * - * @param size size of each buffer in this pool - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. May be NULL, then the default allocator will be used - * (av_buffer_alloc()). - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init(size: cint; alloc: TAlloc): PAVBufferPool; - cdecl; external av__util; - -(** - * Allocate and initialize a buffer pool with a more complex allocator. - * - * @param size size of each buffer in this pool - * @param opaque arbitrary user data used by the allocator - * @param alloc a function that will be used to allocate new buffers when the - * pool is empty. - * @param pool_free a function that will be called immediately before the pool - * is freed. I.e. after av_buffer_pool_uninit() is called - * by the caller and all the frames are returned to the pool - * and freed. It is intended to uninitialize the user opaque - * data. - * @return newly created buffer pool on success, NULL on error. - *) -function av_buffer_pool_init2(size: cint; opaque: pointer; - alloc: TAlloc2; - pool_free: TPoolFree): PAVBufferPool; - cdecl; external av__util; - -(** - * Mark the pool as being available for freeing. It will actually be freed only - * once all the allocated buffers associated with the pool are released. Thus it - * is safe to call this function while some of the allocated buffers are still - * in use. - * - * @param pool pointer to the pool to be freed. It will be set to NULL. - *) -procedure av_buffer_pool_uninit(pool: PPAVBufferPool); - cdecl; external av__util; - -(** - * Allocate a new AVBuffer, reusing an old buffer from the pool when available. - * This function may be called simultaneously from multiple threads. - * - * @return a reference to the new buffer on success, NULL on error. - *) -function av_buffer_pool_get(pool: PAVBufferPool): PAVBufferRef; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.4/libavutil/cpu.pas b/src/lib/ffmpeg-3.4/libavutil/cpu.pas deleted file mode 100644 index 355eaee2..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/cpu.pas +++ /dev/null @@ -1,134 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/cpu.h - * avutil version 54.7.100 - * - *) - -const - - AV_CPU_FLAG_FORCE = $80000000; (* force usage of selected flags (OR) *) - - (* lower 16 bits - CPU features *) - AV_CPU_FLAG_MMX = $0001; ///< standard MMX - AV_CPU_FLAG_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - AV_CPU_FLAG_3DNOW = $0004; ///< AMD 3DNOW - AV_CPU_FLAG_SSE = $0008; ///< SSE functions - AV_CPU_FLAG_SSE2 = $0010; ///< PIV SSE2 functions - AV_CPU_FLAG_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_3DNOWEXT = $0020; ///< AMD 3DNowExt - AV_CPU_FLAG_SSE3 = $0040; ///< Prescott SSE3 functions - AV_CPU_FLAG_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - AV_CPU_FLAG_SSSE3 = $0080; ///< Conroe SSSE3 functions - AV_CPU_FLAG_ATOM = $10000000; ///< Atom processor, some SSSE3 instructions are slower - AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions - AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions - AV_CPU_FLAG_AESNI = $80000; ///< Advanced Encryption Standard functions - AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_AVXSLOW = $8000000; ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer) - AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions - AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions - - AV_CPU_FLAG_CMOV = $1000; ///< supports cmov instruction - - AV_CPU_FLAG_AVX2 = $8000; ///< AVX2 functions: requires OS support even if YMM registers aren't used - AV_CPU_FLAG_FMA3 = $10000; ///< Haswell FMA3 functions - AV_CPU_FLAG_BMI1 = $20000; ///< Bit Manipulation Instruction Set 1 - AV_CPU_FLAG_BMI2 = $40000; ///< Bit Manipulation Instruction Set 2 - - AV_CPU_FLAG_ALTIVEC = $0001; ///< standard - AV_CPU_FLAG_VSX = $0002; ///< ISA 2.06 - AV_CPU_FLAG_POWER8 = $0004; ///< ISA 2.07 - - AV_CPU_FLAG_ARMV5TE = (1 << 0); - AV_CPU_FLAG_ARMV6 = (1 << 1); - AV_CPU_FLAG_ARMV6T2 = (1 << 2); - AV_CPU_FLAG_VFP = (1 << 3); - AV_CPU_FLAG_VFPV3 = (1 << 4); - AV_CPU_FLAG_NEON = (1 << 5); - AV_CPU_FLAG_ARMV8 = (1 << 6); - AV_CPU_FLAG_VFP_VM = (1 << 7); ///< VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations - AV_CPU_FLAG_SETEND = (1 <<16); - -(** - * Return the flags which specify extensions supported by the CPU. - * The returned value is affected by av_force_cpu_flags() if that was used - * before. So av_get_cpu_flags() can easily be used in an application to - * detect the enabled cpu flags. - *) -function av_get_cpu_flags(): cint; - cdecl; external av__util; - -(** - * Disables cpu detection and forces the specified flags. - * -1 is a special case that disables forcing of specific flags. - *) -procedure av_force_cpu_flags(flags: cint); - cdecl; external av__util; - -(** - * Set a mask on flags returned by av_get_cpu_flags(). - * This function is mainly useful for testing. - * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible - *) -procedure av_set_cpu_flags_mask(mask: cint); - cdecl; external av__util; deprecated; - -(** - * Parse CPU flags from a string. - * - * The returned flags contain the specified flags as well as related unspecified flags. - * - * This function exists only for compatibility with libav. - * Please use av_parse_cpu_caps() when possible. - * @return a combination of AV_CPU_* flags, negative on error. - *) -function av_parse_cpu_flags(s: {const} PAnsiChar): cint; - cdecl; external av__util; deprecated; - -(** - * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. - * - * @return negative on error. - *) -function av_parse_cpu_caps(flags: Pcuint; s: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * @return the number of logical CPU cores present. - *) -function av_cpu_count(): cint; - cdecl; external av__util; - -(** - * Get the maximum data alignment that may be required by FFmpeg. - * - * Note that this is affected by the build configuration and the CPU flags mask, - * so e.g. if the CPU supports AVX, but libavutil has been built with - * --disable-avx or the AV_CPU_FLAG_AVX flag has been disabled through - * av_set_cpu_flags_mask(), then this function will behave as if AVX is not - * present. - *) -function av_cpu_max_align(): size_t; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.4/libavutil/dict.pas b/src/lib/ffmpeg-3.4/libavutil/dict.pas deleted file mode 100644 index ef54610c..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/dict.pas +++ /dev/null @@ -1,168 +0,0 @@ -(* - * AVDictionary - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/dict.h - * avutil version 54.7.100 - * - *) - -const - AV_DICT_MATCH_CASE = 1; - AV_DICT_IGNORE_SUFFIX = 2; - AV_DICT_DONT_STRDUP_KEY = 4; (**< Take ownership of a key that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_STRDUP_VAL = 8; (**< Take ownership of a value that's been - allocated with av_malloc() or another memory allocation function. *) - AV_DICT_DONT_OVERWRITE = 16; (**< Don't overwrite existing entries. *) - AV_DICT_APPEND = 32; (**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. *) - AV_DICT_MULTIKEY = 64; (**< Allow to store several equal keys in the dictionary *) - -type - PAVDictionaryEntry = ^TAVDictionaryEntry; - TAVDictionaryEntry = record - key: PAnsiChar; - value: PAnsiChar; - end; - -(* with the "help" of libavutil/internal.h: *) - - PPAVDictionary = ^PAVDictionary; - PAVDictionary = ^TAVDictionary; - TAVDictionary = record - count: cint; - elems: PAVDictionaryEntry; - end; - -(** - * Get a dictionary entry with matching key. - * - * The returned entry key or value must not be changed, or it will - * cause undefined behavior. - * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. - * - * @param key matching key - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary - *) -function av_dict_get({const} m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAVDictionaryEntry; flags: cint): PAVDictionaryEntry; - cdecl; external av__util; - -(** - * Get number of entries in dictionary. - * - * @param m dictionary - * @return number of entries in dictionary - *) -function av_dict_count({const} m: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set the given entry in *pm, overwriting an existing entry. - * - * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, - * these arguments will be freed on error. - * - * Warning: Adding a new entry to a dictionary invalidates all existing entries - * previously returned with av_dict_get. - * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) - * @param value entry value to add to *pm (will be av_strduped or added as a new key depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * Convenience wrapper for av_dict_set that converts the value to a string - * and stores it. - * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. - *) -function av_dict_set_int(var pm: PAVDictionary; {const} key: PAnsiChar; - value: cint64; flags: cint): cint; - cdecl; external av__util; - -(** - * Parse the key/value pairs list and add the parsed entries to a dictionary. - * - * In case of failure, all the successfully set entries are stored in - * *pm. You may need to manually free the created dictionary. - * - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL - * are ignored since the key/value tokens will always - * be duplicated. - * @return 0 on success, negative AVERROR code on failure - *) -function av_dict_parse_string(var pm: PAVDictionary; {const} str: PAnsiChar; - {const} key_val_sep: PAnsiChar; {const} pairs_sep: PAnsiChar; - flags: cint): cint; - cdecl; external av__util; - -(** - * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - * @return 0 on success, negative AVERROR code on failure. If dst was allocated - * by this function, callers should free the associated memory. - *) -function av_dict_copy(var dst: PAVDictionary; {const} src: PAVDictionary; flags: cint): cint; - cdecl; external av__util; - -(** - * Get dictionary entries as a string. - * - * Create a string containing dictionary's entries. - * Such string may be passed back to av_dict_parse_string(). - * @note String is escaped with backslashes ('\'). - * - * @param[in] m dictionary - * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. - * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other - * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. - *) -function av_dict_get_string({const} m: PAVDictionary; buffer: PPAnsiChar; - {const} key_val_sep: AnsiChar; {const} pairs_sep: AnsiChar): cint; - cdecl; external av__util; - -(** - * Free all the memory allocated for an AVDictionary struct - * and all keys and values. - *) -procedure av_dict_free(var m: PAVDictionary); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.4/libavutil/error.pas b/src/lib/ffmpeg-3.4/libavutil/error.pas deleted file mode 100644 index f972aa7d..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/error.pas +++ /dev/null @@ -1,169 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * error code definitions - *) - -(** - * @addtogroup lavu_error - * - * @ - *) - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; - EAGAIN = ESysEAGAIN; -{$ELSE} - ENOENT = 2; - EIO = 5; - EAGAIN = 11; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EDOM > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) -function AVERROR(e: integer): integer; - -const - - // Note: function calls as constant-initializers are invalid - AVERROR_BSF_NOT_FOUND = -(ord($F8) or (ord('B') shl 8) or (ord('S') shl 16) or (ord('F') shl 24)); ///< Bitstream filter not found - AVERROR_BUG = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord('!') shl 24)); ///< Internal bug, also see AVERROR_BUG2 - AVERROR_BUFFER_TOO_SMALL = -(ord('B') or (ord('U') shl 8) or (ord('F') shl 16) or (ord('S') shl 24)); ///< Buffer too small - AVERROR_DECODER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('C') shl 24)); ///< Decoder not found - AVERROR_DEMUXER_NOT_FOUND = -(ord($F8) or (ord('D') shl 8) or (ord('E') shl 16) or (ord('M') shl 24)); ///< Demuxer not found - AVERROR_ENCODER_NOT_FOUND = -(ord($F8) or (ord('E') shl 8) or (ord('N') shl 16) or (ord('C') shl 24)); ///< Encoder not found - AVERROR_EOF = -(ord('E') or (ord('O') shl 8) or (ord('F') shl 16) or (ord(' ') shl 24)); ///< End of file - AVERROR_EXIT = -(ord('E') or (ord('X') shl 8) or (ord('I') shl 16) or (ord('T') shl 24)); ///< Immediate exit was requested; the called function should not be restarted - AVERROR_EXTERNAL = -(ord('E') or (ord('X') shl 8) or (ord('T') shl 16) or (ord(' ') shl 24)); ///< Generic error in an external library - AVERROR_FILTER_NOT_FOUND = -(ord($F8) or (ord('F') shl 8) or (ord('I') shl 16) or (ord('L') shl 24)); ///< Filter not found - AVERROR_INVALIDDATA = -(ord('I') or (ord('N') shl 8) or (ord('D') shl 16) or (ord('A') shl 24)); ///< Invalid data found when processing input - AVERROR_MUXER_NOT_FOUND = -(ord($F8) or (ord('M') shl 8) or (ord('U') shl 16) or (ord('X') shl 24)); ///< Muxer not found - AVERROR_OPTION_NOT_FOUND = -(ord($F8) or (ord('O') shl 8) or (ord('P') shl 16) or (ord('T') shl 24)); ///< Option not found - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); ///< Not yet implemented in FFmpeg, patches welcome - AVERROR_PROTOCOL_NOT_FOUND = -(ord($F8) or (ord('P') shl 8) or (ord('R') shl 16) or (ord('O') shl 24)); ///< Protocol not found - AVERROR_STREAM_NOT_FOUND = -(ord($F8) or (ord('S') shl 8) or (ord('T') shl 16) or (ord('R') shl 24)); ///< Stream not found - -(** - * This is semantically identical to AVERROR_BUG - * it has been introduced in Libav after our AVERROR_BUG and with a modified value. - *) - AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24)); - AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library - AVERROR_EXPERIMENTAL = -($2bb2afa8); ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. - AVERROR_INPUT_CHANGED = -($636e6701); ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) - AVERROR_OUTPUT_CHANGED = -($636e6702); ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) -(* HTTP & RTSP errors *) - AVERROR_HTTP_BAD_REQUEST = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('0') shl 24)); - AVERROR_HTTP_UNAUTHORIZED = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('1') shl 24)); - AVERROR_HTTP_FORBIDDEN = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('3') shl 24)); - AVERROR_HTTP_NOT_FOUND = -(ord($F8) or (ord('4') shl 8) or (ord('0') shl 16) or (ord('4') shl 24)); - AVERROR_HTTP_OTHER_4XX = -(ord($F8) or (ord('4') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - AVERROR_HTTP_SERVER_ERROR = -(ord($F8) or (ord('5') shl 8) or (ord('X') shl 16) or (ord('X') shl 24)); - - AV_ERROR_MAX_STRING_SIZE = 64; - -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) -function av_strerror(errnum: cint; errbuf: PAnsiChar; errbuf_size: size_t): cint; - cdecl; external av__util; - -(** - * Fill the provided buffer with a string containing an error string - * corresponding to the AVERROR code errnum. - * - * @param errbuf a buffer - * @param errbuf_size size in bytes of errbuf - * @param errnum error code to describe - * @return the buffer in input, filled with the error description - * @see av_strerror() - *) -function av_make_error_string(errbuf: Pchar; errbuf_size: size_t; errnum: cint): Pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * Convenience macro, the return value should be used only directly in - * function arguments but never stand-alone. - *) -function av_err2str(errnum: cint): pchar; {$IFDEF HasInline}inline;{$ENDIF} -// Note: defined in avutil.pas - -(** - * @} - *) diff --git a/src/lib/ffmpeg-3.4/libavutil/frame.pas b/src/lib/ffmpeg-3.4/libavutil/frame.pas deleted file mode 100644 index a7bcf6e0..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/frame.pas +++ /dev/null @@ -1,881 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/frame.h - * avutil version 54.7.100 - * -*) - -const - AV_NUM_DATA_POINTERS = 8; - - (** from the definitions of TAVFrame *) - - (** - * The frame data may be corrupted, e.g. due to decoding errors. - *) - AV_FRAME_FLAG_CORRUPT = (1 << 0); - (** - * A flag to mark the frames which need to be decoded, but shouldn't be output. - *) - AV_FRAME_FLAG_DISCARD = (1 << 2); - - FF_DECODE_ERROR_INVALID_BITSTREAM = 1; - FF_DECODE_ERROR_MISSING_REFERENCE = 2; - - -type -(* is already in pixfmt.pas - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M_ = 7, - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); -*) - -(* Note: AVPanScan is defined in avcodec.h but is here to avoid reference problems - Brian-ch 28/09/2014 - * - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of cint16; - end; {TAVPanScan} - - (** - * @defgroup lavu_frame AVFrame - * @ingroup lavu_data - * - * @ - * AVFrame is an abstraction for reference-counted raw multimedia data. - *) - TAVFrameSideDataType = ( - (** - * The data is the AVPanScan struct defined in libavcodec. - *) - AV_FRAME_DATA_PANSCAN, - (** - * ATSC A53 Part 4 Closed Captions. - * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. - * The number of bytes of CC data is AVFrameSideData.size. - *) - AV_FRAME_DATA_A53_CC, - (** - * Stereoscopic 3d metadata. - * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. - *) - AV_FRAME_DATA_STEREO3D, - (** - * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. - *) - AV_FRAME_DATA_MATRIXENCODING, - (** - * Metadata relevant to a downmix procedure. - * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. - *) - AV_FRAME_DATA_DOWNMIX_INFO, - (** - * ReplayGain information in the form of the AVReplayGain struct. - *) - AV_FRAME_DATA_REPLAYGAIN, - (** - * This side data contains a 3x3 transformation matrix describing an affine - * transformation that needs to be applied to the frame for correct - * presentation. - * - * See libavutil/display.h for a detailed description of the data. - *) - AV_FRAME_DATA_DISPLAYMATRIX, - (** - * Active Format Description data consisting of a single byte as specified - * in ETSI TS 101 154 using AVActiveFormatDescription enum. - *) - AV_FRAME_DATA_AFD, - (** - * Motion vectors exported by some codecs (on demand through the export_mvs - * flag set in the libavcodec AVCodecContext flags2 option). - * The data is the AVMotionVector struct defined in - * libavutil/motion_vector.h. - *) - AV_FRAME_DATA_MOTION_VECTORS, - (** - * Recommmends skipping the specified number of samples. This is exported - * only if the "skip_manual" AVOption is set in libavcodec. - * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. - * @code - * u32le number of samples to skip from start of this packet - * u32le number of samples to skip from end of this packet - * u8 reason for start skip - * u8 reason for end skip (0=padding silence, 1=convergence) - * @endcode - *) - AV_FRAME_DATA_SKIP_SAMPLES, - (** - * This side data must be associated with an audio frame and corresponds to - * enum AVAudioServiceType defined in avcodec.h. - *) - AV_FRAME_DATA_AUDIO_SERVICE_TYPE, - (** - * Mastering display metadata associated with a video frame. The payload is - * an AVMasteringDisplayMetadata type and contains information about the - * mastering display color volume. - *) - AV_FRAME_DATA_MASTERING_DISPLAY_METADATA, - (** - * The GOP timecode in 25 bit timecode format. Data format is 64-bit integer. - * This is set on the first frame of a GOP that has a temporal reference of 0. - *) - AV_FRAME_DATA_GOP_TIMECODE, - (** - * The data represents the AVSphericalMapping structure defined in - * libavutil/spherical.h. - *) - AV_FRAME_DATA_SPHERICAL, - (** - * Content light level (based on CTA-861.3). This payload contains data in - * the form of the AVContentLightMetadata struct. - *) - AV_FRAME_DATA_CONTENT_LIGHT_LEVEL, - (** - * The data contains an ICC profile as an opaque octet buffer following the - * format described by ISO 15076-1 with an optional name defined in the - * metadata key entry "name". - *) - AV_FRAME_DATA_ICC_PROFILE - ); - - TAVActiveFormatDescription = ( - AV_AFD_SAME = 8, - AV_AFD_4_3 = 9, - AV_AFD_16_9 = 10, - AV_AFD_14_9 = 11, - AV_AFD_4_3_SP_14_9 = 13, - AV_AFD_16_9_SP_14_9 = 14, - AV_AFD_SP_4_3 = 15 - ); {TAVActiveFormatDescription} - - PAVFrameSideData = ^TAVFrameSideData; -(** - * Structure to hold side data for an AVFrame. - * - * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - *) - TAVFrameSideData = record - type_: TAVFrameSideDataType; - data: PByte; - size: cint; - metadata: TAVDictionary; - buf: PAVBufferRef; - end; {TAVFrameSideData} - -(** - * This structure describes decoded (raw) audio or video data. - * - * AVFrame must be allocated using av_frame_alloc(). Note that this only - * allocates the AVFrame itself, the buffers for the data must be managed - * through other means (see below). - * AVFrame must be freed with av_frame_free(). - * - * AVFrame is typically allocated once and then reused multiple times to hold - * different data (e.g. a single AVFrame to hold frames received from a - * decoder). In such a case, av_frame_unref() will free any references held by - * the frame and reset it to its original clean state before it - * is reused again. - * - * The data described by an AVFrame is usually reference counted through the - * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / - * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at - * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, - * every single data plane must be contained in one of the buffers in - * AVFrame.buf or AVFrame.extended_buf. - * There may be a single buffer for all the data, or one separate buffer for - * each plane, or anything in between. - * - * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added - * to the end with a minor bump. - * - * Fields can be accessed through AVOptions, the name string used, matches the - * C structure field name for fields accessible through AVOptions. The AVClass - * for AVFrame can be obtained from avcodec_get_frame_class() - *) - PPAVFrame = ^PAVFrame; - PAVFrame = ^TAVFrame; - TAVFrame = record - (** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - * - * NOTE: Except for hwaccel formats, pointers not needed by the format - * MUST be set to NULL. - *) - data: array [0..AV_NUM_DATA_POINTERS - 1] of pbyte; - - (** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - *) - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; - - (** - * pointers to the data planes/channels. - * - * For video, this should simply point to data[]. - * - * For planar audio, each channel has a separate data pointer, and - * linesize[0] contains the size of each channel buffer. - * For packed audio, there is just one data pointer, and linesize[0] - * contains the total size of the buffer for all channels. - * - * Note: Both data and extended_data will always be set by get_buffer(), - * but for planar audio with more channels that can fit in data, - * extended_data must be used in order to access all channels. - *) - extended_data: ^pbyte; - - (** - * @name Video dimensions - * Video frames only. The coded dimensions (in pixels) of the video frame, - * i.e. the size of the rectangle that contains some well-defined values. - * - * @note The part of the frame intended for display/presentation is further - * restricted by the @ref cropping "Cropping rectangle". - *) - width, height: cint; - (** - * number of audio samples (per channel) described by this frame - *) - nb_samples: cint; - - (** - * format of the frame, -1 if unknown or unset - * Values correspond to enum AVPixelFormat for video frames, - * enum AVSampleFormat for audio) - *) - format: cint; - - (** - * 1 -> keyframe, 0-> not - *) - key_frame: cint; - - (** - * Picture type of the frame - *) - pict_type: TAVPictureType; - - (** - * sample aspect ratio for the video frame, 0/1 if unknown/unspecified - *) - sample_aspect_ratio: TAVRational; - - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - *) - pts: cint64; - -{$IFDEF FF_API_PKT_PTS} - (** - * PTS copied from the AVPacket that was decoded to produce this frame. - *) - pkt_pts: cint64; {deprecated} -{$ENDIF} - - (** - * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) - * This is also the Presentation time of this AVFrame calculated from - * only AVPacket.dts values without pts values. - *) - pkt_dts: cint64; - - (** - * picture number in bitstream order - *) - coded_picture_number: cint; - - (** - * picture number in display order - *) - display_picture_number: cint; - - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - *) - quality: cint; - - (** - * for some private data of the user - *) - opaque: pointer; - -{$IFDEF FF_API_ERROR_FRAME} - (** - * @deprecated unused - *) - error: array [0..AV_NUM_DATA_POINTERS - 1] of cuint64; {deprecated} -{$ENDIF} - - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - *) - repeat_pict: cint; - - (** - * The content of the picture is interlaced. - *) - interlaced_frame: cint; - - (** - * If the content is interlaced, is top field displayed first. - *) - top_field_first: cint; - - (** - * Tell user application that palette has changed from previous frame. - *) - palette_has_changed: cint; - - (** - * reordered opaque 64 bits (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - * @deprecated in favor of pkt_pts - *) - reordered_opaque: cint64; - - (** - * Sample rate of the audio data. - *) - sample_rate: cint; - - (** - * Channel layout of the audio data. - *) - channel_layout: cuint64; - - (** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. This array - * must be filled contiguously -- if buf[i] is non-NULL then buf[j] must - * also be non-NULL for all j < i. - * - * There may be at most one AVBuffer per data plane, so for video this array - * always contains all the references. For planar audio with more than - * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in - * this array. Then the extra AVBufferRef pointers are stored in the - * extended_buf array. - *) - buf: array [0..AV_NUM_DATA_POINTERS - 1] of PAVBufferRef; - - (** - * For planar audio which requires more than AV_NUM_DATA_POINTERS - * AVBufferRef pointers, this array will hold all the references which - * cannot fit into AVFrame.buf. - * - * Note that this is different from AVFrame.extended_data, which always - * contains all the pointers. This array only contains the extra pointers, - * which cannot fit into AVFrame.buf. - * - * This array is always allocated using av_malloc() by whoever constructs - * the frame. It is freed in av_frame_unref(). - *) - extended_buf: PPAVBufferRef; - - (** - * Number of elements in extended_buf. - *) - nb_extended_buf: cint; - - side_data: ^PAVFrameSideData; - nb_side_data: cint; - - (** - * @defgroup lavu_frame_flags AV_FRAME_FLAGS - * @ingroup lavu_frame - * Flags describing additional frame properties. - * - * @ - *) - - (** - * Frame flags, a combination of @ref lavu_frame_flags - *) - flags: cint; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - color_primaries: TAVColorPrimaries; - - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - chroma_location: TAVChromaLocation; - - (** - * frame timestamp estimated using various heuristics, in stream time base - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - best_effort_timestamp: cint64; - - (** - * reordered pos from the last AVPacket that has been input into the decoder - * - encoding: unused - * - decoding: Read by user. - *) - pkt_pos: cint64; - - (** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * - encoding: unused - * - decoding: Read by user. - *) - pkt_duration: cint64; - - (** - * metadata. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - metadata: PAVDictionary; - - (** - * decode error flags of the frame, set to a combination of - * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there - * were errors during the decoding. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - decode_error_flags: cint; - - (** - * number of audio channels, only used for audio. - * - encoding: unused - * - decoding: Read by user. - *) - channels: cint; - - (** - * size of the corresponding packet containing the compressed - * frame. - * It is set to a negative value if unknown. - * - encoding: unused - * - decoding: set by libavcodec, read by user. - *) - pkt_size: cint; - -{$IFDEF FF_API_FRAME_QP} - (** - * QP table - *) - qscale_table: PByte; {deprecated} - (** - * QP store stride - *) - qstride: cint; {deprecated} - - qscale_type: cint; {deprecated} - - qp_table_buf: PAVBufferRef; {deprecated} -{$ENDIF} - (** - * For hwaccel-format frames, this should be a reference to the - * AVHWFramesContext describing the frame. - *) - hw_frames_ctx: PAVBufferRef; - - (** - * AVBufferRef for free use by the API user. FFmpeg will never check the - * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when - * the frame is unreferenced. av_frame_copy_props() calls create a new - * reference with av_buffer_ref() for the target frame's opaque_ref field. - * - * This is unrelated to the opaque field, although it serves a similar - * purpose. - *) - opaque_ref: PAVBufferRef; - - (** - * @anchor cropping - * @name Cropping - * Video frames only. The number of pixels to discard from the the - * top/bottom/left/right border of the frame to obtain the sub-rectangle of - * the frame intended for presentation. - *) - crop_top: size_t; - crop_bottom: size_t; - crop_left: size_t; - crop_right: size_t; - end; {TAVFrame} - -(** - * Accessors for some AVFrame fields. These used to be provided for ABI - * compatibility, and do not need to be used anymore. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; overload; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; overload; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function avpriv_frame_get_metadatap(frame: PAVFrame): PPAVDictionary; - cdecl; external av__codec; -{$IFDEF FF_API_FRAME_QP} -function av_frame_get_qp_table(f: PAVFrame; stride: pcint; type_: pcint): PByte; - cdecl; external av__codec; -function av_frame_set_qp_table(f: PAVFrame; buf: PAVBufferRef; stride: cint; type_: cint): cint; - cdecl; external av__codec; -{$ENDIF} -function av_frame_get_colorspace(frame: {const} PAVFrame): TAVColorSpace; - cdecl; external av__codec; -procedure av_frame_set_colorspace(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; -procedure av_frame_set_color_range(frame: PAVFrame; val: TAVColorSpace); - cdecl; external av__codec; - -(** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - *) -function av_get_colorspace_name(val: TAVColorSpace): PAnsiChar; - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct must be freed using av_frame_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * - * @note this only allocates the AVFrame itself, not the data buffers. Those - * must be allocated through other means, e.g. with av_frame_get_buffer() or - * manually. - *) -function av_frame_alloc(): PAVFrame; - cdecl; external av__util; - -(** - * Free the frame and any dynamically allocated objects in it, - * e.g. extended_data. If the frame is reference counted, it will be - * unreferenced first. - * - * @param frame frame to be freed. The pointer will be set to NULL. - *) -procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; - -(** - * Set up a new reference to the data described by the source frame. - * - * Copy frame properties from src to dst and create a new reference for each - * AVBufferRef from src. - * - * If src is not reference counted, new buffers are allocated and the data is - * copied. - * - * @warning: dst MUST have been either unreferenced with av_frame_unref(dst), - * or newly allocated with av_frame_alloc() before calling this - * function, or undefined behavior will occur. - * - * @return 0 on success, a negative AVERROR on error - *) -function av_frame_ref(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Create a new frame that references the same data as src. - * - * This is a shortcut for av_frame_alloc()+av_frame_ref(). - * - * @return newly created AVFrame on success, NULL on error. - *) -function av_frame_clone(src: {const} PAVFrame): PAVFrame; - cdecl; external av__codec; - -(** - * Unreference all the buffers referenced by frame and reset the frame fields. - *) -procedure av_frame_unref(frame: PAVFrame); - cdecl; external av__util; - -(** - * Move everything contained in src to dst and reset src. - * - * @warning: dst is not unreferenced, but directly overwritten without reading - * or deallocating its contents. Call av_frame_unref(dst) manually - * before calling this function to ensure that no memory is leaked. - *) -procedure av_frame_move_ref(dst, src: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate new buffer(s) for audio or video data. - * - * The following fields must be set on frame before calling this function: - * - format (pixel format for video, sample format for audio) - * - width and height for video - * - nb_samples and channel_layout for audio - * - * This function will fill AVFrame.data and AVFrame.buf arrays and, if - * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. - * For planar formats, one buffer will be allocated for each plane. - * - * @warning: if frame already has been allocated, calling this function will - * leak memory. In addition, undefined behavior can occur in certain - * cases. - * - * @param frame frame in which to store the new buffers. - * @param align Required buffer size alignment. If equal to 0, alignment will be - * chosen automatically for the current CPU. It is highly - * recommended to pass 0 here unless you know what you are doing. - * - * @return 0 on success, a negative AVERROR on error. - *) -function av_frame_get_buffer(frame: PAVFrame; align: cint): cint; - cdecl; external av__codec; - -(** - * Check if the frame data is writable. - * - * @return A positive value if the frame data is writable (which is true if and - * only if each of the underlying buffers has only one reference, namely the one - * stored in this frame). Return 0 otherwise. - * - * If 1 is returned the answer is valid until av_buffer_ref() is called on any - * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). - * - * @see av_frame_make_writable(), av_buffer_is_writable() - *) -function av_frame_is_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Ensure that the frame data is writable, avoiding data copy if possible. - * - * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. - * - * @return 0 on success, a negative AVERROR on error. - * - * @see av_frame_is_writable(), av_buffer_is_writable(), - * av_buffer_make_writable() - *) -function av_frame_make_writable(frame: PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy the frame data from src to dst. - * - * This function does not allocate anything, dst must be already initialized and - * allocated with the same parameters as src. - * - * This function only copies the frame data (i.e. the contents of the data / - * extended data arrays), not any other properties. - * - * @return >= 0 on success, a negative AVERROR on error. - *) -function av_frame_copy(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Copy only "metadata" fields from src to dst. - * - * Metadata for the purpose of this function are those fields that do not affect - * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample - * aspect ratio (for video), but not width/height or channel layout. - * Side data is also copied. - *) -function av_frame_copy_props(dst: PAVFrame; src: {const} PAVFrame): cint; - cdecl; external av__codec; - -(** - * Get the buffer reference a given data plane is stored in. - * - * @param plane index of the data plane of interest in frame->extended_data. - * - * @return the buffer reference that contains the plane or NULL if the input - * frame is not valid. - *) -function av_frame_get_plane_buffer(frame: PAVFrame; plane: cint): PAVBufferRef; - cdecl; external av__codec; - -(** - * Add a new side data to a frame. - * - * @param frame a frame to which the side data should be added - * @param type type of the added side data - * @param size size of the side data - * - * @return newly added side data on success, NULL on error - *) -function av_frame_new_side_data(frame: PAVFrame; - type_: TAVFrameSideDataType; - size: cint): PAVFrameSideData; - cdecl; external av__codec; - -(** - * @return a pointer to the side data of a given type on success, NULL if there - * is no side data with such type in this frame. - *) -function av_frame_get_side_data(frame: {const} PAVFrame; type_: TAVFrameSideDataType): PAVFrameSideData; - cdecl; external av__codec; - -(** - * If side data of the supplied type exists in the frame, free it and remove it - * from the frame. - *) -procedure av_frame_remove_side_data(frame: PAVFrame; type_: TAVFrameSideDataType); - cdecl; external av__codec; - - -(** - * Flags for frame cropping. - *) -const - (** - * Apply the maximum possible cropping, even if it requires setting the - * AVFrame.data[] entries to unaligned pointers. Passing unaligned data - * to FFmpeg API is generally not allowed, and causes undefined behavior - * (such as crashes). You can pass unaligned data only to FFmpeg APIs that - * are explicitly documented to accept it. Use this flag only if you - * absolutely know what you are doing. - *) - AV_FRAME_CROP_UNALIGNED = 1 << 0; - -(** - * Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ - * crop_bottom fields. If cropping is successful, the function will adjust the - * data pointers and the width/height fields, and set the crop fields to 0. - * - * In all cases, the cropping boundaries will be rounded to the inherent - * alignment of the pixel format. In some cases, such as for opaque hwaccel - * formats, the left/top cropping is ignored. The crop fields are set to 0 even - * if the cropping was rounded or ignored. - * - * @param frame the frame which should be cropped - * @param flags Some combination of AV_FRAME_CROP_* flags, or 0. - * - * @return >= 0 on success, a negative AVERROR on error. If the cropping fields - * were invalid, AVERROR(ERANGE) is returned, and nothing is changed. - *) -function av_frame_apply_cropping(frame: PAVFrame; flags: cint): cint; - cdecl; external av__codec; - -(** - * @return a string identifying the side data type - *) -function av_frame_side_data_name(type_: TAVFrameSideDataType): PAnsiChar; - cdecl; external av__codec; diff --git a/src/lib/ffmpeg-3.4/libavutil/log.pas b/src/lib/ffmpeg-3.4/libavutil/log.pas deleted file mode 100644 index c184047f..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/log.pas +++ /dev/null @@ -1,545 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/log.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * log - *) - -type - (* from opt.h *) - TAVOptionType = ( - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_DICT, - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_BOOL = $424F4F4C, ///< MKBETAG('B','O','O','L'), - AV_OPT_TYPE_CHANNEL_LAYOUT = $43484C41, ///< MKBETAG('C','H','L','A'), - AV_OPT_TYPE_COLOR = $434F4C52, ///< MKBETAG('C','O','L','R'), - AV_OPT_TYPE_DURATION = $44555220, ///< MKBETAG('D','U','R',' '), - AV_OPT_TYPE_PIXEL_FMlT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_IMAGE_SIZE = $53495A45, ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers - AV_OPT_TYPE_VIDEO_RATE = $56524154 ///< MKBETAG('V','R','A','T'), offset must point to TAVRational - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding -{$IFDEF FF_API_OPT_TYPE_METADATA} - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... -{$ENDIF} - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - (** - * The option is intended for exporting values to the caller. - *) - AV_OPT_FLAG_EXPORT = 64; - (** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - *) - AV_OPT_FLAG_READONLY = 128; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -type - PAVClassCategory = ^TAVClassCategory; - TAVClassCategory = ( - AV_CLASS_CATEGORY_NA = 0, - AV_CLASS_CATEGORY_INPUT, - AV_CLASS_CATEGORY_OUTPUT, - AV_CLASS_CATEGORY_MUXER, - AV_CLASS_CATEGORY_DEMUXER, - AV_CLASS_CATEGORY_ENCODER, - AV_CLASS_CATEGORY_DECODER, - AV_CLASS_CATEGORY_FILTER, - AV_CLASS_CATEGORY_BITSTREAM_FILTER, - AV_CLASS_CATEGORY_SWSCALER, - AV_CLASS_CATEGORY_SWRESAMPLER, - AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, - AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, - AV_CLASS_CATEGORY_DEVICE_OUTPUT, - AV_CLASS_CATEGORY_DEVICE_INPUT, - AV_CLASS_CATEGORY_NB ///< not part of ABI/API - ); - -(* -#define AV_IS_INPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) - -#define AV_IS_OUTPUT_DEVICE(category) \ - (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ - ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -*) - -// struct AVOptionRanges; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - (** - * Value range. - * For string ranges this represents the min/max length. - * For dimensions this represents the min/max pixel count or width/height in multi-component case. - *) - value_min, value_max: cdouble; - (** - * Value's component range. - * For string this represents the unicode range for chars, 0-127 limits to ASCII. - *) - component_min, component_max: cdouble; - (** - * Range flag. - * If set to 1 the struct encodes a range, if set to 0 a single value. - *) - is_range: cint; - end; - - (** - * List of AVOptionRange structs. - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - (** - * Array of option ranges. - * - * Most of option types use just one component. - * Following describes multi-component option types: - * - * AV_OPT_TYPE_IMAGE_SIZE: - * component index 0: range of pixel count (width * height). - * component index 1: range of width. - * component index 2: range of height. - * - * @note To obtain multi-component version of this structure, user must - * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or - * av_opt_query_ranges_default function. - * - * Multi-component range can be read as in following example: - * - * @code - * int range_index, component_index; - * AVOptionRanges *ranges; - * AVOptionRange *range[3]; //may require more than 3 in the future. - * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); - * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { - * for (component_index = 0; component_index < ranges->nb_components; component_index++) - * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; - * //do something with range here. - * } - * av_opt_freep_ranges(&ranges); - * @endcode - *) - range: PPAVOptionRange; - (** - * Number of ranges per component. - *) - nb_ranges: cint; - (** - * Number of componentes. - *) - nb_components: cint; - end; - -(** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). - *) - PAVClass = ^TAVClass; - TAVClass = record - (** - * The name of the class; usually it is the same name as the - * context structure type to which the AVClass is associated. - *) - class_name: PAnsiChar; - - (** - * A pointer to a function which returns the name of a context - * instance ctx associated with the class. - *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - - (** - * a pointer to the first option specified in the class if any or NULL - * - * @see av_set_default_options() - *) - option: PAVOption; - - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; - - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; - - (** - * Offset in the structure where a pointer to the parent context for - * logging is stored. For example a decoder could pass its AVCodecContext - * to eval as such a parent context, which an av_log() implementation - * could then leverage to display the parent context. - * The offset can be NULL. - *) - parent_log_context_offset: cint; - - (** - * Return next AVOptions-enabled child or NULL - *) - child_next: function (obj: pointer; prev: pointer): pointer; cdecl; - - (** - * Return an AVClass corresponding to the next potential - * AVOptions-enabled child. - * - * The difference between child_next and this is that - * child_next iterates over _already existing_ objects, while - * child_class_next iterates over _all possible_ children. - *) - child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - - (** - * Category used for visualization (like color) - * This is only set if the category is equal for all objects using this class. - * available since version (51 << 16 | 56 << 8 | 100) - *) - category: TAVClassCategory; - - (** - * Callback to return the category. - * available since version (51 << 16 | 59 << 8 | 100) - *) - get_category: function (ctx: pointer): PAVClassCategory; cdecl; - - (** - * Callback to return the supported/allowed ranges. - * available since version (52.12) - *) - query_ranges: function (P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; cdecl; -end; - -const -(** - * Print no output. - *) - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - -(** - * Standard information. - *) - AV_LOG_INFO = 32; - -(** - * Detailed information. - *) - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; - -(** - * Extremely verbose debugging, useful for libav* development. - *) - AV_LOG_TRACE = 56; - - AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET); - -(** - * Sets additional colors for extended debugging sessions. - * @code - av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); - @endcode - * Requires 256color terminal support. Uses outside debugging is not - * recommended. - *) -{** to be translated if needed - AV_LOG_C(x) (x << 8) -**} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct or NULL if general log. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - *) -{** to be translated if needed -void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); -**} - -type - va_list = pointer; - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different logging callback - * function. - * @see av_log_set_callback - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -procedure av_vlog(avcl: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list); - cdecl; external av__util; - -(** - * Get the current log level - * - * @see lavu_log_constants - * - * @return Current log level - *) -function av_log_get_level(): cint; - cdecl; external av__util; - -(** - * Set the log level - * - * @see lavu_log_constants - * - * @param level Logging level - *) -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -(** - * Set the logging callback - * - * @note The callback must be thread safe, even if the application does not use - * threads itself as some codecs are multithreaded. - * - * @see av_log_default_callback - * - * @param callback A logging function with a compatible signature. - *) -{** to be translated if needed -void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -**} - -(** - * Default logging callback - * - * It prints the message to stderr, optionally colorizing it. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message expressed using a @ref - * lavu_log_constants "Logging Constant". - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @param vl The arguments referenced by the format string. - *) -{** to be translated if needed -void av_log_default_callback(void* avcl, int level, const char *fmt, va_list vl); -**} - -(** - * Return the context name - * - * @param ctx The AVClass context - * - * @return The AVClass class_name - *) -function av_default_item_name(ctx: pointer): PAnsiChar; - cdecl; external av__util; -function av_default_get_category(ptr: pointer): TAVClassCategory; - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formatted line - * @param line_size size of the buffer - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - *) -procedure av_log_format_line(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint); - cdecl; external av__util; - -(** - * Format a line of log the same way as the default callback. - * @param line buffer to receive the formatted line; - * may be NULL if line_size is 0 - * @param line_size size of the buffer; at most line_size-1 characters will - * be written to the buffer, plus one null terminator - * @param print_prefix used to store whether the prefix must be printed; - * must point to a persistent integer initially set to 1 - * @return Returns a negative value if an error occurred, otherwise returns - * the number of characters that would have been written for a - * sufficiently large buffer, not including the terminating null - * character. If the return value is not less than line_size, it means - * that the log message was truncated to fit the buffer. - *) -function av_log_format_line2(ptr: pointer; level: cint; fmt: {const} PAnsiChar; vl: va_list; - line: PAnsiChar; line_size: cint; print_prefix: Pcint): cint; - cdecl; external av__util; - -{$IFDEF FF_API_DLOG} -(** - * av_dlog macros - * @deprecated unused - * Useful to print debug messages that shouldn't get compiled in normally. - *) -(** to be translated if needed -#ifdef DEBUG -# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) -#else -# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) -#endif -**) -{$ENDIF} //FF_API_DLOG - -const -(** - * Skip repeated messages, this requires the user app to use av_log() instead of - * (f)printf as the 2 would otherwise interfere and lead to - * "Last message repeated x times" messages below (f)printf messages with some - * bad luck. - * Also to receive the last, "last repeated" line if any, the user app must - * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end - *) - AV_LOG_SKIP_REPEATED = 1; - -(** - * Include the log severity in messages originating from codecs. - * - * Results in messages such as: - * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts - *) - AV_LOG_PRINT_LEVEL = 2; - -procedure av_log_set_flags(arg: cint); - cdecl; external av__util; - -function av_log_get_flags: cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.4/libavutil/mathematics.pas b/src/lib/ffmpeg-3.4/libavutil/mathematics.pas deleted file mode 100644 index f6df1368..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/mathematics.pas +++ /dev/null @@ -1,222 +0,0 @@ -(* - * copyright (c) 2005-2012 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * @addtogroup lavu_math - * Mathematical utilities for working with timestamp and time base. - *) - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 - M_PHI = 1.61803398874989484820; // phi / golden ratio - M_PI = 3.14159265358979323846; // pi - M_PI_2 = 1.57079632679489661923; // pi/2 - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) - M_SQRT2 = 1.41421356237309504880; // sqrt(2) - NAN = $7fc00000; - INFINITY = $7f800000; - -(** - * @addtogroup lavu_math - * @ - *) - -type - (** - * Rounding methods. - *) - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. - (** - * Flag telling rescaling functions to pass `INT64_MIN`/`MAX` through - * unchanged, avoiding special cases for #AV_NOPTS_VALUE. - * - * Unlike other values of the enumeration AVRounding, this value is a - * bitmask that must be used in conjunction with another value of the - * enumeration through a bitwise OR, in order to set behavior for normal - * cases. - * - * @code{.c} - * av_rescale_rnd(3, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); - * // Rescaling 3: - * // Calculating 3 * 1 / 2 - * // 3 / 2 is rounded up to 2 - * // => 2 - * - * av_rescale_rnd(AV_NOPTS_VALUE, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); - * // Rescaling AV_NOPTS_VALUE: - * // AV_NOPTS_VALUE == INT64_MIN - * // AV_NOPTS_VALUE is passed through - * // => AV_NOPTS_VALUE - * @endcode - *) - AV_ROUND_PASS_MINMAX = 8192 - ); - -(** - * Compute the greatest common divisor of two integer operands. - * - * @param a,b Operands - * @return GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; - * if a == 0 and b == 0, returns 0. - *) -function av_gcd(a, b: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * - * The operation is mathematically equivalent to `a * b / c`, but writing that - * directly can overflow. - * - * This function is equivalent to av_rescale_rnd() with #AV_ROUND_NEAR_INF. - * - * @see av_rescale_rnd(), av_rescale_q(), av_rescale_q_rnd() - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * - * The operation is mathematically equivalent to `a * b / c`, but writing that - * directly can overflow, and does not support different rounding methods. - * - * @see av_rescale(), av_rescale_q(), av_rescale_q_rnd() - *) -function av_rescale_rnd (a, b, c: cint64; rnd: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - * - * The operation is mathematically equivalent to `a * bq / cq`. - * - * This function is equivalent to av_rescale_q_rnd() with #AV_ROUND_NEAR_INF. - * - * @see av_rescale(), av_rescale_rnd(), av_rescale_q_rnd() - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers with specified rounding. - * - * The operation is mathematically equivalent to `a * bq / cq`. - * - * @see av_rescale(), av_rescale_rnd(), av_rescale_q() - *) -function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational; - rnd: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Compare two timestamps each in its own time base. - * - * @return One of the following values: - * - -1 if `ts_a` is before `ts_b` - * - 1 if `ts_a` is after `ts_b` - * - 0 if they represent the same position - * - * @warning - * The result of the function is undefined if one of the timestamps is outside - * the `int64_t` range when represented in the other's timebase. - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; - -(** - * Compare the remainders of two integer operands divided by a common divisor. - * - * In other words, compare the least significant `log2(mod)` bits of integers - * `a` and `b`. - * - * @code{.c} - * av_compare_mod(0x11, 0x02, 0x10) < 0 // since 0x11 % 0x10 (0x1) < 0x02 % 0x10 (0x2) - * av_compare_mod(0x11, 0x02, 0x20) > 0 // since 0x11 % 0x20 (0x11) > 0x02 % 0x20 (0x02) - * @endcode - * - * @param a,b Operands - * @param mod Divisor; must be a power of 2 - * @return - * - a negative value if `a % mod < b % mod` - * - a positive value if `a % mod > b % mod` - * - zero if `a % mod == b % mod` - *) -function av_compare_mod(a, b, modVar: cuint64): cint64; - cdecl; external av__util; - -(** - * Rescale a timestamp while preserving known durations. - * - * This function is designed to be called per audio packet to scale the input - * timestamp to a different time base. Compared to a simple av_rescale_q() - * call, this function is robust against possible inconsistent frame durations. - * - * The `last` parameter is a state variable that must be preserved for all - * subsequent calls for the same stream. For the first call, `*last` should be - * initialized to #AV_NOPTS_VALUE. - * - * @param[in] in_tb Input time base - * @param[in] in_ts Input timestamp - * @param[in] fs_tb Duration time base; typically this is finer-grained - * (greater) than `in_tb` and `out_tb` - * @param[in] duration Duration till the next call to this function (i.e. - * duration of the current packet/frame) - * @param[in,out] last Pointer to a timestamp expressed in terms of - * `fs_tb`, acting as a state variable - * @param[in] out_tb Output timebase - * @return Timestamp expressed in terms of `out_tb` - * - * @note In the context of this function, "duration" is in term of samples, not - * seconds. - *) -function av_rescale_delta(in_tb: TAVRational; in_ts: cint64; fs_tb: TAVRational; duration: cint; last: Pcint64; out_tb: TAVRational): cint64; - cdecl; external av__util; - -(** - * Add a value to a timestamp. - * - * This function guarantees that when the same value is repeatly added that - * no accumulation of rounding errors occurs. - * - * @param ts Input timestamp - * @param ts_tb Input timestamp timebase - * @param inc value to add to ts - * @param inc_tb inc timebase - *) -function av_add_stable(ts_tb: TAVRational; ts: cint64; inc_tb: TAVRational; inc: cint64): cint64; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.4/libavutil/mem.pas b/src/lib/ffmpeg-3.4/libavutil/mem.pas deleted file mode 100644 index 6dfd7444..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/mem.pas +++ /dev/null @@ -1,578 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mem.h - * avutil version 52.66.100 - * - *) - -(** - * @file - * error code definitions - *) - -(* Memory handling functions *) - -(** - * @defgroup lavu_mem_funcs Heap Management - * Functions responsible for allocating, freeing, and copying memory. - * - * All memory allocation functions have a built-in upper limit of `INT_MAX` - * bytes. This may be changed with av_max_alloc(), although exercise extreme - * caution when doing so. - * - * @{ - *) - -(** - * Allocate a memory block with alignment suitable for all memory accesses - * (including vectors if available on the CPU). - * - * @param size Size in bytes for the memory block to be allocated - * @return Pointer to the allocated block, or `NULL` if the block cannot - * be allocated - * @see av_mallocz() - * @see av_mallocz() - *) -function av_malloc(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a memory block with alignment suitable for all memory accesses - * (including vectors if available on the CPU) and zero all the bytes of the - * block. - * - * @param size Size in bytes for the memory block to be allocated - * @return Pointer to the allocated block, or `NULL` if it cannot be allocated - * @see av_malloc() - *) -function av_mallocz(size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate a memory block for an array with av_malloc(). - * - * The allocated memory will have size `size * nmemb` bytes. - * - * @param nmemb Number of element - * @param size Size of a single element - * @return Pointer to the allocated block, or `NULL` if the block cannot - * be allocated - * @see av_malloc() - *) -function av_malloc_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate a memory block for an array with av_mallocz(). - * - * The allocated memory will have size `size * nmemb` bytes. - * - * @param nmemb Number of elements - * @param size Size of the single element - * @return Pointer to the allocated block, or `NULL` if the block cannot - * be allocated - * - * @see av_mallocz() - * @see av_malloc_array() - *) -function av_mallocz_array(nmemb: size_t; size: size_t): pointer; {$IFDEF HasInline}inline;{$ENDIF} {av_alloc_size(1, 2)} -// Note: defined in avutil.pas - -(** - * Allocate a block of nmemb * size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zero all the bytes of the block. - * The allocation will fail if nmemb * size is greater than or equal - * to INT_MAX. - * @param nmemb - * @param size - * @return Pointer to the allocated block, NULL if it cannot be allocated. - *) -function av_calloc(nmemb: size_t; size: size_t): pointer; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Allocate, reallocate, or free a block of memory. - * - * If `ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is - * zero, free the memory block pointed to by `ptr`. Otherwise, expand or - * shrink that block of memory according to `size`. - * - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or `NULL` - * @param size Size in bytes of the memory block to be allocated or - * reallocated - * - * @return Pointer to a newly-reallocated block or `NULL` if the block - * cannot be reallocated or the function is used to free the memory block - * - * @warning Unlike av_malloc(), the returned pointer is not guaranteed to be - * correctly aligned. - * @see av_fast_realloc() - * @see av_reallocp() - *) -function av_realloc(ptr: pointer; size: size_t): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Allocate, reallocate, or free a block of memory through a pointer to a - * pointer. - * - * If `*ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is - * zero, free the memory block pointed to by `*ptr`. Otherwise, expand or - * shrink that block of memory according to `size`. - * - * @param[in,out] ptr Pointer to a pointer to a memory block already allocated - * with av_realloc(), or a pointer to `NULL`. The pointer - * is updated on success, or freed on failure. - * @param[in] size Size in bytes for the memory block to be allocated or - * reallocated - * - * @return Zero on success, an AVERROR error code on failure - * - * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be - * correctly aligned. - *) -function av_reallocp(ptr: pointer; elsize: size_t): cint; - cdecl; external av__util; - -(** - * Allocate, reallocate, or free a block of memory. - * - * This function does the same thing as av_realloc(), except: - * - It takes two size arguments and allocates `nelem * elsize` bytes, - * after checking the result of the multiplication for integer overflow. - * - It frees the input block in case of failure, thus avoiding the memory - * leak with the classic - * @code{.c} - * buf = realloc(buf); - * if (!buf) - * return -1; - * @endcode - * pattern. - *) -function av_realloc_f(ptr: pointer; nelem: size_t; elsize: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate, reallocate, or free an array. - * - * If `ptr` is `NULL` and `nmemb` > 0, allocate a new block. If - * `nmemb` is zero, free the memory block pointed to by `ptr`. - * - * @param ptr Pointer to a memory block already allocated with - * av_realloc() or `NULL` - * @param nmemb Number of elements in the array - * @param size Size of the single element of the array - * - * @return Pointer to a newly-reallocated block or NULL if the block - * cannot be reallocated or the function is used to free the memory block - * - * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be - * correctly aligned. - * @see av_reallocp_array() - *) -function av_realloc_array(ptr: pointer; nmemb, size: size_t): pointer; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Allocate, reallocate, or free an array through a pointer to a pointer. - * - * If `*ptr` is `NULL` and `nmemb` > 0, allocate a new block. If `nmemb` is - * zero, free the memory block pointed to by `*ptr`. - * - * @param[in,out] ptr Pointer to a pointer to a memory block already - * allocated with av_realloc(), or a pointer to `NULL`. - * The pointer is updated on success, or freed on failure. - * @param[in] nmemb Number of elements - * @param[in] size Size of the single element - * - * @return Zero on success, an AVERROR error code on failure - * - * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be - * correctly aligned. - *) -function av_reallocp_array(ptr: pointer; nmemb, size: size_t): cint; {av_alloc_size(2, 3)} - cdecl; external av__util; - -(** - * Reallocate the given buffer if it is not large enough, otherwise do nothing. - * - * If the given buffer is `NULL`, then a new uninitialized buffer is allocated. - * - * If the given buffer is not large enough, and reallocation fails, `NULL` is - * returned and `*size` is set to 0, but the original buffer is not changed or - * freed. - * - * A typical use pattern follows: - * - * @code{.c} - * uint8_t *buf = ...; - * uint8_t *new_buf = av_fast_realloc(buf, ¤t_size, size_needed); - * if (!new_buf) { - * // Allocation failed; clean up original buffer - * av_freep(&buf); - * return AVERROR(ENOMEM); - * } - * @endcode - * - * @param[in,out] ptr Already allocated buffer, or `NULL` - * @param[in,out] size Pointer to current size of buffer `ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `ptr` - * @return `ptr` if the buffer is large enough, a pointer to newly reallocated - * buffer if the buffer was not large enough, or `NULL` in case of - * error - * @see av_realloc() - * @see av_fast_malloc() - *) -function av_fast_realloc(ptr: pointer; size: Pcuint; min_size: size_t): pointer; - cdecl; external av__util; - -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc(), the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special handling to - * avoid memleaks is necessary. - * - * `*ptr` is allowed to be `NULL`, in which case allocation always happens if - * `size_needed` is greater than 0. - * - * @code{.c} - * uint8_t *buf = ...; - * av_fast_malloc(&buf, ¤t_size, size_needed); - * if (!buf) { - * // Allocation failed; buf already freed - * return AVERROR(ENOMEM); - * } - * @endcode - * - * @param[in,out] ptr Pointer to pointer to an already allocated buffer. - * `*ptr` will be overwritten with pointer to new - * buffer on success or `NULL` on failure - * @param[in,out] size Pointer to current size of buffer `*ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `*ptr` - * @see av_realloc() - * @see av_fast_mallocz() - *) -procedure av_fast_malloc(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Allocate and clear a buffer, reusing the given one if large enough. - * - * Like av_fast_malloc(), but all newly allocated space is initially cleared. - * Reused buffer is not cleared. - * - * `*ptr` is allowed to be `NULL`, in which case allocation always happens if - * `size_needed` is greater than 0. - * - * @param[in,out] ptr Pointer to pointer to an already allocated buffer. - * `*ptr` will be overwritten with pointer to new - * buffer on success or `NULL` on failure - * @param[in,out] size Pointer to current size of buffer `*ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `*ptr` - * @see av_fast_malloc() - *) -procedure av_fast_mallocz(ptr: pointer; size: Pcuint; min_size: size_t); - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with a function of av_malloc() - * or av_realloc() family. - * - * @param ptr Pointer to the memory block which should be freed. - * - * @note `ptr = NULL` is explicitly allowed. - * @note It is recommended that you use av_freep() instead, to prevent leaving - * behind dangling pointers. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Free a memory block which has been allocated with a function of av_malloc() - * or av_realloc() family, and set the pointer pointing to it to `NULL`. - * - * @code{.c} - * uint8_t *buf = av_malloc(16); - * av_free(buf); - * // buf now contains a dangling pointer to freed memory, and accidental - * // dereference of buf will result in a use-after-free, which may be a - * // security risk. - * - * uint8_t *buf = av_malloc(16); - * av_freep(&buf); - * // buf is now NULL, and accidental dereference will only result in a - * // NULL-pointer dereference. - * @endcode - * - * @param ptr Pointer to the pointer to the memory block which should be freed - * @note `*ptr = NULL` is safe and leads to no action. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(** - * Duplicate a string. - * - * @param s String to be duplicated - * @return Pointer to a newly-allocated string containing a - * copy of `s` or `NULL` if the string cannot be allocated - * @see av_strndup() - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a substring of a string. - * - * @param s String to be duplicated - * @param len Maximum length of the resulting string (not counting the - * terminating byte) - * @return Pointer to a newly-allocated string containing a - * substring of `s` or `NULL` if the string cannot be allocated - *) -function av_strndup({const} s: PAnsiChar; len: size_t): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Duplicate a buffer with av_malloc(). - * - * @param p Buffer to be duplicated - * @param size Size in bytes of the buffer copied - * @return Pointer to a newly allocated buffer containing a - * copy of `p` or `NULL` if the buffer cannot be allocated - *) -function av_memdup({const} p: pointer; size: size_t): pointer; - cdecl; external av__util; - -(** - * Overlapping memcpy() implementation. - * - * @param dst Destination buffer - * @param back Number of bytes back to start copying (i.e. the initial size of - * the overlapping window); must be > 0 - * @param cnt Number of bytes to copy; must be >= 0 - * - * @note `cnt > back` is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of `back`. - *) -procedure av_memcpy_backptr(dst: Pcuint8; back: cint; cnt: cint); - cdecl; external av__util; - -(** - * @} - *) - -(** - * @defgroup lavu_mem_dynarray Dynamic Array - * - * Utilities to make an array grow when needed. - * - * Sometimes, the programmer would want to have an array that can grow when - * needed. The libavutil dynamic array utilities fill that need. - * - * libavutil supports two systems of appending elements onto a dynamically - * allocated array, the first one storing the pointer to the value in the - * array, and the second storing the value directly. In both systems, the - * caller is responsible for maintaining a variable containing the length of - * the array, as well as freeing of the array after use. - * - * The first system stores pointers to values in a block of dynamically - * allocated memory. Since only pointers are stored, the function does not need - * to know the size of the type. Both av_dynarray_add() and - * av_dynarray_add_nofree() implement this system. - * - * @code - * type **array = NULL; //< an array of pointers to values - * int nb = 0; //< a variable to keep track of the length of the array - * - * type to_be_added = ...; - * type to_be_added2 = ...; - * - * av_dynarray_add(&array, &nb, &to_be_added); - * if (nb == 0) - * return AVERROR(ENOMEM); - * - * av_dynarray_add(&array, &nb, &to_be_added2); - * if (nb == 0) - * return AVERROR(ENOMEM); - * - * // Now: - * // nb == 2 - * // &to_be_added == array[0] - * // &to_be_added2 == array[1] - * - * av_freep(&array); - * @endcode - * - * The second system stores the value directly in a block of memory. As a - * result, the function has to know the size of the type. av_dynarray2_add() - * implements this mechanism. - * - * @code - * type *array = NULL; //< an array of values - * int nb = 0; //< a variable to keep track of the length of the array - * - * type to_be_added = ...; - * type to_be_added2 = ...; - * - * type *addr = av_dynarray2_add((void ** )&array, &nb, sizeof(*array), NULL); - * if (!addr) - * return AVERROR(ENOMEM); - * memcpy(addr, &to_be_added, sizeof(to_be_added)); - * - * // Shortcut of the above. - * type *addr = av_dynarray2_add((void ** )&array, &nb, sizeof(*array), - * (const void * )&to_be_added2); - * if (!addr) - * return AVERROR(ENOMEM); - * - * // Now: - * // nb == 2 - * // to_be_added == array[0] - * // to_be_added2 == array[1] - * - * av_freep(&array); - * @endcode - * - * @{ - *) - - -(** - * Add the pointer to an element to a dynamic array. - * - * The array to grow is supposed to be an array of pointers to - * structures, and the element to add must be a pointer to an already - * allocated structure. - * - * The array is reallocated when its size reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by `nb_ptr` - * is incremented. - * In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and - * `*nb_ptr` is set to 0. - * - * @param[in,out] tab_ptr Pointer to the array to grow - * @param[in,out] nb_ptr Pointer to the number of elements in the array - * @param[in] elem Element to add - * @see av_dynarray_add_nofree(), av_dynarray2_add() - *) -procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer); - cdecl; external av__util; - -(** - * Add an element to a dynamic array. - * - * Function has the same functionality as av_dynarray_add(), - * but it doesn't free memory on fails. It returns error code - * instead and leave current buffer untouched. - * - * @return >=0 on success, negative otherwise - * @see av_dynarray_add(), av_dynarray2_add() - *) -function av_dynarray_add_nofree(tab_ptr: pointer; nb_ptr: Pcint; elem: pointer): cint; - cdecl; external av__util; - -(** - * Add an element of size `elem_size` to a dynamic array. - * - * The array is reallocated when its number of elements reaches powers of 2. - * Therefore, the amortized cost of adding an element is constant. - * - * In case of success, the pointer to the array is updated in order to - * point to the new grown array, and the number pointed to by `nb_ptr` - * is incremented. - * In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and - * `*nb_ptr` is set to 0. - * - * @param[in,out] tab_ptr Pointer to the array to grow - * @param[in,out] nb_ptr Pointer to the number of elements in the array - * @param[in] elem_size Size in bytes of an element in the array - * @param[in] elem_data Pointer to the data of the element to add. If - * `NULL`, the space of the newly added element is - * allocated but left uninitialized. - * - * @return Pointer to the data of the element to copy in the newly allocated - * space - * @see av_dynarray_add(), av_dynarray_add_nofree() - *) -function av_dynarray2_add(tab_ptr: Pointer; nb_ptr: Pcint; elem_size: size_t; - {const} elem_data: Pcuint8): pointer; - cdecl; external av__util; - -(** - * @} - *) - -(** - * @defgroup lavu_mem_misc Miscellaneous Functions - * - * Other functions related to memory allocation. - * - * @{ - *) - -(** - * Multiply two `size_t` values checking for overflow. - * - * @param[in] a,b Operands of multiplication - * @param[out] r Pointer to the result of the operation - * @return 0 on success, AVERROR(EINVAL) on overflow - *) -//static inline int av_size_mult(size_t a, size_t b, size_t *r) -{ - size_t t = a * b; - /* Hack inspired from glibc: don't try the division if nelem and elsize - * are both less than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) - return AVERROR(EINVAL); - *r = t; - return 0; -} - -(** - * Set the maximum size that may be allocated in one block. - * - * The value specified with this function is effective for all libavutil's @ref - * lavu_mem_funcs "heap management functions." - * - * By default, the max value is defined as `INT_MAX`. - * - * @param max Value to be set as the new maximum size - * - * @warning Exercise extreme caution when using this function. Don't touch - * this if you do not understand the full consequence of doing so. - *) -procedure av_max_alloc(max: size_t); - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.4/libavutil/opt.pas b/src/lib/ffmpeg-3.4/libavutil/opt.pas deleted file mode 100644 index 87ec68aa..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/opt.pas +++ /dev/null @@ -1,507 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/opt.h - * avutil version 54.7.100 - * - *) - -(** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options - *) -function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint; - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - *) -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__util; - -(** - * Set the values of all AVOption fields to their default values. Only these - * AVOption fields for which (opt->flags & mask) == flags will have their - * default applied to s. - * - * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) - * @param mask combination of AV_OPT_FLAG_* - * @param flags combination of AV_OPT_FLAG_* - *) -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__util; deprecated; - -(** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set -*) -function av_set_options_string(ctx: pointer; opts: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - *) -function av_opt_set_from_string(ctx: pointer; opts: {const} PAnsiChar; - shorthand: {const} PAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Free all allocated objects in obj. - *) -procedure av_opt_free(obj: pointer); - cdecl; external av__util; - -(** - * Check whether a particular flag is set in a flags field. - * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. - *) -function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_name: {const} PAnsiChar): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; - cdecl; external av__util; - -(** - * Set all the options from a given dictionary on an object. - * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - *) -function av_opt_set_dict2(obj: pointer; var options: PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - *) -function av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; - flags: byte; - rkey, rval: PPAnsiChar): cint; - cdecl; external av__util; - -const - (** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - *) - AV_OPT_FLAG_IMPLICIT_KEY = 1; - -(** - * @defgroup opt_eval_funcs Evaluating option strings - * @ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - *) -function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; - cdecl; external av__util; -function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; - cdecl; external av__util; -function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; - cdecl; external av__util; -function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; - cdecl; external av__util; -function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; - cdecl; external av__util; -(** - * @ - *) - -const - AV_OPT_SEARCH_CHILDREN = (1 << 0); (**< Search in possible children of the - given object first.*) -(** - * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass - * instead of a required pointer to a struct containing AVClass. This is - * useful for searching for options without needing to allocate the corresponding - * object. - *) - AV_OPT_SEARCH_FAKE_OBJ = (1 << 1); - -(** - * In av_opt_get, return NULL if the option has a pointer type and is set to NULL, - * rather than returning an empty string. - *) - AV_OPT_ALLOW_NULL = (1 << 2); -(** - * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than - * one component for certain option types. - * @see AVOptionRanges for details. - *) - AV_OPT_MULTI_COMPONENT_RANGE = (1 << 12); - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return A pointer to the option found, or NULL if no option - * was found. - * - * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable - * directly with av_set_string3(). Use special calls which take an options - * AVDictionary (e.g. avformat_open_input()) to set options found with this - * flag. - *) -function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint): PAVOption; - cdecl; external av__util; - -(** - * Look for an option in an object. Consider only options which - * have all the specified flags set. - * - * @param[in] obj A pointer to a struct whose first element is a - * pointer to an AVClass. - * Alternatively a double pointer to an AVClass, if - * AV_OPT_SEARCH_FAKE_OBJ search flag is set. - * @param[in] name The name of the option to look for. - * @param[in] unit When searching for named constants, name of the unit - * it belongs to. - * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * @param[out] target_obj if non-NULL, an object to which the option belongs will be - * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present - * in search_flags. This parameter is ignored if search_flags contain - * AV_OPT_SEARCH_FAKE_OBJ. - * - * @return A pointer to the option found, or NULL if no option - * was found. - *) -function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; - opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over all AVOptions belonging to obj. - * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL - *) -function av_opt_next(obj: {const} pointer; prev: {const} PAVOption): {const} PAVOption; - cdecl; external av__util; - -(** - * Iterate over AVOptions-enabled children of obj. - * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL - *) -function av_opt_child_next(obj: pointer; prev: pointer): pointer; - cdecl; external av__util; - -(** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param prev result of a previous call to this function or NULL - * @return AVClass corresponding to next potential child or NULL - *) -function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass; - cdecl; external av__util; - -(** - * @defgroup opt_set_funcs Option setting functions - * @ - * Those functions set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. In case of av_opt_set() if the field is not - * of a string type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be set on a child of obj. - * - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR_OPTION_NOT_FOUND if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_double (obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_bin (obj: pointer; name: {const} PAnsiChar; val: {const} cuint8; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_image_size(obj: pointer; name: {const} PAnsiChar; w, h, search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_pixel_fmt (obj: pointer; name: {const} PAnsiChar; fmt: TAVPixelFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_sample_fmt(obj: pointer; name: {const} PAnsiChar; fmt: TAVSampleFormat; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_video_rate(obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint; - cdecl; external av__util; -function av_opt_set_channel_layout(obj: pointer; name: {const} PAnsiChar; ch_layout: cint64; search_flags: cint): cint; - cdecl; external av__util; - -(** - * @note Any old dictionary present is discarded and replaced with a copy of the new one. The - * caller still owns val is and responsible for freeing it. - *) -function av_opt_set_dict_val(obj: pointer; name: {const} PAnsiChar; val: {const} PAVDictionary; search_flags: cint): cint; - cdecl; external av__util; - -(** - * Set a binary option to an integer list. - * - * @param obj AVClass object to set options on - * @param name name of the binary option - * @param val pointer to an integer list (must have the correct type with - * regard to the contents of the list) - * @param term list terminator (usually 0 or -1) - * @param flags search flags - *) -{to be translated -#define av_opt_set_int_list(obj, name, val, term, flags) \ - (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ - AVERROR(EINVAL) : \ - av_opt_set_bin(obj, name, (const uint8_t *)(val), \ - av_int_list_length(val, term) * sizeof(*(val)), flags)) -} -(** - * @ - *) - -(** - * @defgroup opt_get_funcs Option getting functions - * @ - * Those functions get a value of the option with the given name from an object. - * - * @param[in] obj a struct whose first element is a pointer to an AVClass. - * @param[in] name name of the option to get. - * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN - * is passed here, then the option may be found in a child of obj. - * @param[out] out_val value of the option will be written here - * @return >=0 on success, a negative error code otherwise - *) -(** - * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller - * - * @note if AV_OPT_ALLOW_NULL is set in search_flags in av_opt_get, and the option has - * AV_OPT_TYPE_STRING or AV_OPT_TYPE_BINARY and is set to NULL, *out_val will be set - * to NULL instead of an allocated empty string. - *) -function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint; - cdecl; external av__util; -function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint; - cdecl; external av__util; -function av_opt_get_double (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint; - cdecl; external av__util; -function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_image_size(obj: pointer; name: {const} PAnsiChar; search_flags: cint; w_out, h_out: Pcint): cint; - cdecl; external av__util; -function av_opt_get_pixel_fmt (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_sample_fmt(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_fmt: PAVPixelFormat): cint; - cdecl; external av__util; -function av_opt_get_video_rate(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint; - cdecl; external av__util; -function av_opt_get_channel_layout(obj: pointer; name: {const} PAnsiChar; search_flags: cint; ch_layout: Pcint64): cint; - cdecl; external av__util; -(** - * @param[out] out_val The returned dictionary is a copy of the actual value and must - * be freed with av_dict_free() by the caller - *) -function av_opt_get_dict_val (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: PAVDictionary): cint; - cdecl; external av__util; -(** - * @ - *) -(** - * Gets a pointer to the requested field in a struct. - * This function allows accessing a struct even when its fields are moved or - * renamed since the application making the access has been compiled, - * - * @returns a pointer to the field, it can be cast to the correct type and read - * or written to. - *) -function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer; - cdecl; external av__util; - -(** - * Free an AVOptionRanges struct and set it to NULL. - *) -procedure av_opt_freep_ranges(ranges: PPAVOptionRanges); - cdecl; external av__util; - -(** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -function av_opt_copy(dest: pointer;src: {const }pointer): cint; - cdecl; external av__util; - -(** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - *) -function av_opt_query_ranges_default(P: PPAVOptionRanges; obj: pointer; key: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__util; - -(** - * @ - *) diff --git a/src/lib/ffmpeg-3.4/libavutil/pixfmt.pas b/src/lib/ffmpeg-3.4/libavutil/pixfmt.pas deleted file mode 100644 index 6b23267a..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/pixfmt.pas +++ /dev/null @@ -1,611 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/pixfmt.h - * avutil version 54.7.100 - * - *) - -(** - * @file - * Pixel format - *) - -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * Pixel format. Notes: - * - * @note - * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * @par - * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB32 palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * @par - * For all the 8 bits per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - AV_PIX_FMT_NONE = -1, - AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) - AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) - AV_PIX_FMT_GRAY8, ///< Y , 8bpp - AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - AV_PIX_FMT_PAL8, ///< 8 bits with AV_PIX_FMT_RGB32 palette - AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range - AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range - AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range -{$IFDEF FF_API_XVMC} - AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - AV_PIX_FMT_XVMC_MPEG2_IDCT, - AV_PIX_FMT_XVMC = AV_PIX_FMT_XVMC_MPEG2_IDCT, -{$ENDIF} - AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 - AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped - - AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... - - AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range - AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian - - AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian, most significant bit to 0 - AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian, most significant bit to 1 - AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, most significant bit to 1 -{$IFDEF FF_API_VAAPI} - (** Deprecated pixel formats *) - AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a VASurfaceID - - AV_PIX_FMT_VAAPI = AV_PIX_FMT_VAAPI_VLD, -{$ELSE} - AV_PIX_FMT_VAAPI, -{$ENDIF} - AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian -{$IFDEF FF_API_VDPAU} - AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG-4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$ENDIF} - AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer - - AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, most significant bits to 0 - AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, most significant bits to 0 - AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, most significant bits to 1 - AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, most significant bits to 1 - AV_PIX_FMT_YA8, ///< 8 bits gray, 8 bits alpha -(* see const declaration way down - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -*) - AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian - AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian - - (** - * The following 12 formats have the disadvantage of needing 1 format for each bit depth. - * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. - * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. - *) - AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA - - AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp - AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP, // alias for #AV_PIX_FMT_GBRP - AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian - AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian - AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian - AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian - AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) - AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) - AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian - AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian - AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) - AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) - AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) - AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) - AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) - - AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface - - AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 - AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - - AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian - AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian - - AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb - - AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef - - AV_PIX_FMT_YA16BE, ///< 16 bits gray, 16 bits alpha (big-endian) - AV_PIX_FMT_YA16LE, ///< 16 bits gray, 16 bits alpha (little-endian) - - AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp - AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian - AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian - (** - * HW acceleration through QSV, data[3] contains a pointer to the - * mfxFrameSurface1 structure. - *) - AV_PIX_FMT_QSV, - (** - * HW acceleration though MMAL, data[3] contains a pointer to the - * MMAL_BUFFER_HEADER_T structure. - *) - AV_PIX_FMT_MMAL, - - AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer - - (** - * HW acceleration through CUDA. data[i] contain CUdeviceptr pointers - * exactly as for system memory frames. - *) - AV_PIX_FMT_CUDA, - - AV_PIX_FMT_0RGB = $123 + 4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined - AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined - AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined - AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined - - AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian - AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian - AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian - AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian - AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian - AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range - - AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ - AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ - AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ - AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ -{$ifndef FF_API_XVMC} - AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -{$endif} - AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian - AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian - AV_PIX_FMT_AYUV64LE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian - AV_PIX_FMT_AYUV64BE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian - - AV_PIX_FMT_VIDEOTOOLBOX, ///< hardware decoding through Videotoolbox - - AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian - AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian - - AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian - AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian - - AV_PIX_FMT_GBRAP10BE, ///< planar GBR 4:4:4:4 40bpp, big-endian - AV_PIX_FMT_GBRAP10LE, ///< planar GBR 4:4:4:4 40bpp, little-endian - - AV_PIX_FMT_MEDIACODEC, ///< hardware decoding through MediaCodec - - AV_PIX_FMT_GRAY12BE, ///< Y , 12bpp, big-endian - AV_PIX_FMT_GRAY12LE, ///< Y , 12bpp, little-endian - AV_PIX_FMT_GRAY10BE, ///< Y , 10bpp, big-endian - AV_PIX_FMT_GRAY10LE, ///< Y , 10bpp, little-endian - - AV_PIX_FMT_P016LE, ///< like NV12, with 16bpp per component, little-endian - AV_PIX_FMT_P016BE, ///< like NV12, with 16bpp per component, big-endian - - (** - * Hardware surfaces for Direct3D11. - * - * This is preferred over the legacy AV_PIX_FMT_D3D11VA_VLD. The new D3D11 - * hwaccel API and filtering support AV_PIX_FMT_D3D11 only. - * - * data[0] contains a ID3D11Texture2D pointer, and data[1] contains the - * texture array index of the frame as intptr_t if the ID3D11Texture2D is - * an array texture (or always 0 if it's a normal texture). - *) - AV_PIX_FMT_D3D11, - - AV_PIX_FMT_GRAY9BE, ///< Y , 9bpp, big-endian - AV_PIX_FMT_GRAY9LE, ///< Y , 9bpp, little-endian - - AV_PIX_FMT_GBRPF32BE, ///< IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian - AV_PIX_FMT_GBRPF32LE, ///< IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian - AV_PIX_FMT_GBRAPF32BE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian - AV_PIX_FMT_GBRAPF32LE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian - - (** - * DRM-managed buffers exposed through PRIME buffer sharing. - * - * data[0] points to an AVDRMFrameDescriptor. - *) - AV_PIX_FMT_DRM_PRIME, - - AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const - AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8; ///< alias for AV_PIX_FMT_YA8 - -{$IFDEF WORDS_BIGENDIAN} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_0RGB; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_0BGR; - - AV_PIX_FMT_GRAY9 = AV_PIX_FMT_GRAY9BE; - AV_PIX_FMT_GRAY10 = AV_PIX_FMT_GRAY10BE; - AV_PIX_FMT_GRAY12 = AV_PIX_FMT_GRAY12BE; - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16BE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16BE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48BE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565BE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555BE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444BE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64BE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48BE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565BE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555BE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444BE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64BE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9BE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9BE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9BE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10BE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10BE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10BE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10BE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12BE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12BE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12BE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12BE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14BE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14BE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14BE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16BE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16BE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16BE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9BE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10BE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12BE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14BE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16BE; - AV_PIX_FMT_GBRAP10 = AV_PIX_FMT_GBRAP10BE; - AV_PIX_FMT_GBRAP12 = AV_PIX_FMT_GBRAP12BE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16BE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16BE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16BE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16BE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16BE; - - AV_PIX_FMT_GBRPF32 = AV_PIX_FMT_GBRPF32BE; - AV_PIX_FMT_GBRAPF32 = AV_PIX_FMT_GBRAPF32BE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9BE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9BE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9BE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10BE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10BE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10BE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16BE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16BE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16BE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12BE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20BE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64BE; - AV_PIX_FMT_P010 = AV_PIX_FMT_P010BE; - AV_PIX_FMT_P016 = AV_PIX_FMT_P016BE; - -{$ELSE} - AV_PIX_FMT_RGB32 = AV_PIX_FMT_BGRA; - AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_ABGR; - AV_PIX_FMT_BGR32 = AV_PIX_FMT_RGBA; - AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_ARGB; - AV_PIX_FMT_0RGB32 = AV_PIX_FMT_BGR0; - AV_PIX_FMT_0BGR32 = AV_PIX_FMT_RGB0; - - AV_PIX_FMT_GRAY9 = AV_PIX_FMT_GRAY9LE; - AV_PIX_FMT_GRAY10 = AV_PIX_FMT_GRAY10LE; - AV_PIX_FMT_GRAY12 = AV_PIX_FMT_GRAY12LE; - AV_PIX_FMT_GRAY16 = AV_PIX_FMT_GRAY16LE; - AV_PIX_FMT_YA16 = AV_PIX_FMT_YA16LE; - AV_PIX_FMT_RGB48 = AV_PIX_FMT_RGB48LE; - AV_PIX_FMT_RGB565 = AV_PIX_FMT_RGB565LE; - AV_PIX_FMT_RGB555 = AV_PIX_FMT_RGB555LE; - AV_PIX_FMT_RGB444 = AV_PIX_FMT_RGB444LE; - AV_PIX_FMT_RGBA64 = AV_PIX_FMT_RGBA64LE; - AV_PIX_FMT_BGR48 = AV_PIX_FMT_BGR48LE; - AV_PIX_FMT_BGR565 = AV_PIX_FMT_BGR565LE; - AV_PIX_FMT_BGR555 = AV_PIX_FMT_BGR555LE; - AV_PIX_FMT_BGR444 = AV_PIX_FMT_BGR444LE; - AV_PIX_FMT_BGRA64 = AV_PIX_FMT_BGRA64LE; - - AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_YUV420P9LE; - AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_YUV422P9LE; - AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_YUV444P9LE; - AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_YUV420P10LE; - AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_YUV422P10LE; - AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_YUV440P10LE; - AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_YUV444P10LE; - AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_YUV420P12LE; - AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_YUV422P12LE; - AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_YUV440P12LE; - AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_YUV444P12LE; - AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_YUV420P14LE; - AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_YUV422P14LE; - AV_PIX_FMT_YUV444P14= AV_PIX_FMT_YUV444P14LE; - AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_YUV420P16LE; - AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_YUV422P16LE; - AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_YUV444P16LE; - - AV_PIX_FMT_GBRP9 = AV_PIX_FMT_GBRP9LE; - AV_PIX_FMT_GBRP10 = AV_PIX_FMT_GBRP10LE; - AV_PIX_FMT_GBRP12 = AV_PIX_FMT_GBRP12LE; - AV_PIX_FMT_GBRP14 = AV_PIX_FMT_GBRP14LE; - AV_PIX_FMT_GBRP16 = AV_PIX_FMT_GBRP16LE; - AV_PIX_FMT_GBRAP10 = AV_PIX_FMT_GBRAP10LE; - AV_PIX_FMT_GBRAP12 = AV_PIX_FMT_GBRAP12LE; - AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_GBRAP16LE; - - AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_BAYER_BGGR16LE; - AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_BAYER_RGGB16LE; - AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_BAYER_GBRG16LE; - AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_BAYER_GRBG16LE; - - AV_PIX_FMT_GBRPF32 = AV_PIX_FMT_GBRPF32LE; - AV_PIX_FMT_GBRAPF32 = AV_PIX_FMT_GBRAPF32LE; - - AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_YUVA420P9LE; - AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_YUVA422P9LE; - AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_YUVA444P9LE; - AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_YUVA420P10LE; - AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_YUVA422P10LE; - AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_YUVA444P10LE; - AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_YUVA420P16LE; - AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_YUVA422P16LE; - AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_YUVA444P16LE; - - AV_PIX_FMT_XYZ12 = AV_PIX_FMT_XYZ12LE; - AV_PIX_FMT_NV20 = AV_PIX_FMT_NV20LE; - AV_PIX_FMT_AYUV64 = AV_PIX_FMT_AYUV64LE; - AV_PIX_FMT_P010 = AV_PIX_FMT_P010LE; - AV_PIX_FMT_P016 = AV_PIX_FMT_P016LE; -{$ENDIF} - -type -(** - * Chromaticity coordinates of the source primaries. - * These values match the ones defined by ISO/IEC 23001-8_2013 § 7.1. - *) - TAVColorPrimaries = ( - AVCOL_PRI_RESERVED0 = 0, - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_RESERVED = 3, - AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C - AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 - AVCOL_PRI_SMPTE428 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ) - AVCOL_PRI_SMPTEST428_1 = AVCOL_PRI_SMPTE428, - AVCOL_PRI_SMPTE431 = 11, ///< SMPTE ST 431-2 (2011) / DCI P3 - AVCOL_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3 - AVCOL_PRI_JEDEC_P22 = 22, ///< JEDEC P22 phosphors - AVCOL_PRI_NB ///< Not part of ABI - ); - -(** - * Color Transfer Characteristic. - * These values match the ones defined by ISO/IEC 23001-8_2013 § 7.2. - *) - TAVColorTransferCharacteristic = ( - AVCOL_TRC_RESERVED0 = 0, - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_RESERVED = 3, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC - AVCOL_TRC_SMPTE240M = 7, - AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" - AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" - AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" - AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 - AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut - AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) - AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10-bit system - AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12-bit system - AVCOL_TRC_SMPTE2084 = 16, ///< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems - AVCOL_TRC_SMPTEST2084 = AVCOL_TRC_SMPTE2084, - AVCOL_TRC_SMPTE428 = 17, ///< SMPTE ST 428-1 - AVCOL_TRC_SMPTEST428_1 = AVCOL_TRC_SMPTE428, - AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma" - AVCOL_TRC_NB ///< Not part of ABI - ); - -(** - * YUV colorspace type. - * These values match the ones defined by ISO/IEC 23001-8_2013 § 7.3. - *) - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_RESERVED = 3, - AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_SPC_SMPTE240M = 7, ///< functionally identical to above - AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 - AVCOL_SPC_YCOCG = AVCOL_SPC_YCGCO, - AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system - AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system - AVCOL_SPC_SMPTE2085 = 11, ///< SMPTE 2085, Y'D'zD'x - AVCOL_SPC_CHROMA_DERIVED_NCL = 12, ///< Chromaticity-derived non-constant luminance system - AVCOL_SPC_CHROMA_DERIVED_CL = 13, ///< Chromaticity-derived constant luminance system - AVCOL_SPC_ICTCP = 14, ///< ITU-R BT.2100-0, ICtCp - AVCOL_SPC_NB ///< Not part of ABI - ); - -type -(** - * MPEG vs JPEG YUV range. - *) - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * Location of chroma samples. - * - * Illustration showing the location of the first (top left) chroma sample of the - * image, the left shows only luma, the right - * shows the location of the chroma sample, the 2 could be imagined to overlay - * each other but are drawn separately due to limitations of ASCII - * - * 1st 2nd 1st 2nd horizontal luma sample positions - * v v v v - * ______ ______ - *1st luma line > |X X ... |3 4 X ... X are luma samples, - * | |1 2 1-6 are possible chroma positions - *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< MPEG-2/4 4:2:0, H.264 default for 4:2:0 - AVCHROMA_LOC_CENTER = 2, ///< MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0 - AVCHROMA_LOC_TOPLEFT = 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); diff --git a/src/lib/ffmpeg-3.4/libavutil/samplefmt.pas b/src/lib/ffmpeg-3.4/libavutil/samplefmt.pas deleted file mode 100644 index 85b11305..00000000 --- a/src/lib/ffmpeg-3.4/libavutil/samplefmt.pas +++ /dev/null @@ -1,287 +0,0 @@ -(* - * SampleFormat - * copyright (c) 2011 Karl-Michael Schindler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - * Conversion of libavutil/samplefmt.h - * avutil version 54.7.100 - * - *) - -type -(** - * @addtogroup lavu_audio - * @ - * - * @defgroup lavu_sampfmts Audio sample formats - * - * Audio sample format enumeration and related convenience functions. - * @ - *) - -(** - * Audio sample formats - * - * - The data described by the sample format is always in native-endian order. - * Sample values can be expressed by native C types, hence the lack of a signed - * 24-bit sample format even though it is a common raw audio data format. - * - * - The floating-point formats are based on full volume being in the range - * [-1.0, 1.0]. Any values outside this range are beyond full volume level. - * - * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg - * (such as AVFrame in libavcodec) is as follows: - * - * @par - * For planar sample formats, each audio channel is in a separate data plane, - * and linesize is the buffer size, in bytes, for a single plane. All data - * planes must be the same size. For packed sample formats, only the first data - * plane is used, and samples for each channel are interleaved. In this case, - * linesize is the buffer size, in bytes, for the 1 plane. - * - *) - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - - AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar - AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar - AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar - AV_SAMPLE_FMT_FLTP, ///< float, planar - AV_SAMPLE_FMT_DBLP, ///< double, planar - AV_SAMPLE_FMT_S64, ///< signed 64 bits - AV_SAMPLE_FMT_S64P, ///< signed 64 bits, planar - - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat) - 1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -(** - * Return the name of sample_fmt, or NULL if sample_fmt is not - * recognized. - *) -function av_get_sample_fmt_name(sample_fmt: TAVSampleFormat): {const} PAnsiChar; - cdecl; external av__util; - -(** - * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE - * on error. - *) -function av_get_sample_fmt(name: {const} PAnsiChar): TAVSampleFormat; - cdecl; external av__util; - -(** - * Return the planar<->packed alternative form of the given sample format, or - * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the - * requested planar/packed format, the format returned is the same as the - * input. - *) -function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the packed alternative form of the given sample format. - * - * If the passed sample_fmt is already in packed format, the format returned is - * the same as the input. - * - * @return the packed alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Get the planar alternative form of the given sample format. - * - * If the passed sample_fmt is already in planar format, the format returned is - * the same as the input. - * - * @return the planar alternative form of the given sample format or - AV_SAMPLE_FMT_NONE on error. - *) -function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat; - cdecl; external av__util; - -(** - * Generate a string corresponding to the sample format with - * sample_fmt, or a header if sample_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param sample_fmt the number of the sample format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - * @return the pointer to the filled buffer or NULL if sample_fmt is - * unknown or in case of other errors - *) -function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TAVSampleFormat): PAnsiChar; - cdecl; external av__util; - -(** - * Return number of bytes per sample. - * - * @param sample_fmt the sample format - * @return number of bytes per sample or zero if unknown for the given - * sample format - *) -function av_get_bytes_per_sample(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -type - OctArrayOfPcuint8 = array[0..7] of Pcuint8; - OctArrayOfcint = array[0..7] of cint; - -(** - * Check if the sample format is planar. - * - * @param sample_fmt the sample format to inspect - * @return 1 if the sample format is planar, 0 if it is interleaved - *) -function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Get the required buffer size for the given audio parameters. - * - * @param[out] linesize calculated linesize, may be NULL - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return required buffer size, or negative error code on failure - *) -function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * @ - * - * @defgroup lavu_sampmanip Samples manipulation - * - * Functions that manipulate audio samples - * @ - *) - -(** - * Fill plane data pointers and linesize for samples with sample - * format sample_fmt. - * - * The audio_data array is filled with the pointers to the samples data planes: - * for planar, set the start point of each channel's data within the buffer, - * for packed, set the start point of the entire buffer only. - * - * The value pointed to by linesize is set to the aligned size of each - * channel's data buffer for planar layout, or to the aligned size of the - * buffer for all channels for packed layout. - * - * The buffer in buf must be big enough to contain all the samples - * (use av_samples_get_buffer_size() to compute its minimum size), - * otherwise the audio_data pointers will point to invalid data. - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize calculated linesize, may be NULL - * @param buf the pointer to a buffer containing the samples - * @param nb_channels the number of channels - * @param nb_samples the number of samples in a single channel - * @param sample_fmt the sample format - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return minimum size in bytes required for the buffer in case - * of success at the next bump - *) -function av_samples_fill_arrays(var audio_data: Pcuint8; linesize: Pcint; - buf: Pcuint8; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a samples buffer for nb_samples samples, and fill data pointers and - * linesize accordingly. - * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) - * - * @see enum AVSampleFormat - * The documentation for AVSampleFormat describes the data layout. - * - * @param[out] audio_data array to be filled with the pointer for each channel - * @param[out] linesize aligned size for audio buffer(s), may be NULL - * @param nb_channels number of audio channels - * @param nb_samples number of samples per channel - * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return >=0 on success or a negative error code on failure - * @todo return the size of the allocated buffer in case of success at the next bump - * @see av_samples_fill_arrays() - * @see av_samples_alloc_array_and_samples() - *) -function av_samples_alloc(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Allocate a data pointers array, samples buffer for nb_samples - * samples, and fill data pointers and linesize accordingly. - * - * This is the same as av_samples_alloc(), but also allocates the data - * pointers array. - * - * @see av_samples_alloc() - *) -function av_samples_alloc_array_and_samples(var audio_data: Pcuint8; linesize: Pcint; - nb_channels: cint; nb_samples: cint; - sample_fmt: TAVSampleFormat; align: cint): cint; - cdecl; external av__util; - -(** - * Copy samples from src to dst. - * - * @param dst destination array of pointers to data planes - * @param src source array of pointers to data planes - * @param dst_offset offset in samples at which the data will be written to dst - * @param src_offset offset in samples at which the data will be read from src - * @param nb_samples number of samples to be copied - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint; - src_offset: cint; nb_samples: cint; nb_channels: cint; - sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; - -(** - * Fill an audio buffer with silence. - * - * @param audio_data array of pointers to data planes - * @param offset offset in samples at which to start filling - * @param nb_samples number of samples to fill - * @param nb_channels number of audio channels - * @param sample_fmt audio sample format - *) -function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint; - nb_channels: cint; sample_fmt: TAVSampleFormat): cint; - cdecl; external av__util; diff --git a/src/lib/ffmpeg-3.4/rational.pas b/src/lib/ffmpeg-3.4/rational.pas deleted file mode 100644 index d7fcb5b2..00000000 --- a/src/lib/ffmpeg-3.4/rational.pas +++ /dev/null @@ -1,270 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil version 54.7.100 - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -(** - * @addtogroup lavu_math - * @{ - *) - -type -(** - * Rational number (pair of numerator and denominator). - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< Numerator - den: cint; ///< Denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Create an AVRational. - * - * Useful for compilers that do not support compound literals. - * - * @note The return value is not reduced. - * @see av_reduce() - */ -static inline AVRational av_make_q(int num, int den) -{ - AVRational r = { num, den }; - return r; -} - -/**) - -(** - * Create an AVRational. - * - * Useful for compilers that do not support compound literals. - * - * @note The return value is not reduced. - * @see av_reduce() - *) -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Compare two rationals. - * - * @param a First rational - * @param b Second rational - * - * @return One of the following values: - * - 0 if `a == b` - * - 1 if `a > b` - * - -1 if `a < b` - * - `INT_MIN` if one of the values is of the form `0 / 0` - *) -function av_cmp_q(a: TAVRational; b: TAVRational): cint; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Convert an AVRational to a `double`. - * @param a AVRational to convert - * @return `a` in floating-point form - * @see av_d2q() - *) -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Reduce a fraction. - * - * This is useful for framerate calculations. - * - * @param[out] dst_num Destination numerator - * @param[out] dst_den Destination denominator - * @param[in] num Source numerator - * @param[in] den Source denominator - * @param[in] max Maximum allowed values for `dst_num` & `dst_den` - * @return 1 if the operation is exact, 0 otherwise - *) -function av_reduce(dst_num: PCint; dst_den: PCint; num: cint64; den: cint64; max: cint64): cint; - cdecl; external av__util; - -(** - * Multiply two rationals. - * @param b First rational - * @param c Second rational - * @return b*c - *) -function av_mul_q(b: TAVRational; c: TAVRational): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Divide one rational by another. - * @param b First rational - * @param c Second rational - * @return b/c - *) -function av_div_q(b: TAVRational; c: TAVRational): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Add two rationals. - * @param b First rational - * @param c Second rational - * @return b+c - *) -function av_add_q(b: TAVRational; c: TAVRational): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Subtract one rational from another. - * @param b First rational - * @param c Second rational - * @return b-c - *) -function av_sub_q(b: TAVRational; c: TAVRational): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Invert a rational. - * @param q value - * @return 1 / q - *) -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Convert a double precision floating point number to a rational. - * - * In case of infinity, the returned value is expressed as `{1, 0}` or - * `{-1, 0}` depending on the sign. - * - * @param d `double` to convert - * @param max Maximum allowed numerator and denominator - * @return `d` in AVRational form - * @see av_q2d() - *) -function av_d2q(d: cdouble; max: cint): TAVRational; - cdecl; external av__util; {av_const} - -(** - * Find which of the two rationals is closer to another rational. - * - * @param q Rational to be compared against - * @param q1,q2 Rationals to be tested - * @return One of the following values: - * - 1 if `q1` is nearer to `q` than `q2` - * - -1 if `q2` is nearer to `q` than `q1` - * - 0 if they have the same distance - *) -function av_nearer_q(q, q1, q2: TAVRational): cint; - cdecl; external av__util; - -(** - * Find the value in a list of rationals nearest a given reference rational. - * - * @param q Reference rational - * @param q_list Array of rationals terminated by `{0, 0}` - * @return Index of the nearest value found in the array - *) -function av_find_nearest_q_idx(q: TAVRational; q_list: {const} PAVRationalArray): cint; - cdecl; external av__util; - -(** - * Convert an AVRational to a IEEE 32-bit `float` expressed in fixed-point - * format. - * - * @param q Rational to be converted - * @return Equivalent floating-point value, expressed as an unsigned 32-bit - * integer. - * @note The returned value is platform-indepedant. - *) -function av_q2intfloat(q: TAVRational): cuint32; - cdecl; external av__util; - -implementation - -function av_cmp_q (a: TAVRational; b: TAVRational): cint; {$IFDEF HasInline}inline;{$ENDIF} -var - tmp: cint64; -begin - tmp := a.num * cint64(b.den) - b.num * cint64(a.den); - -{ old version - if (tmp <> 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; -} -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} - - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) shr 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num shr 31) - (b.num shr 31) - else - Result := low(cint); - -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -function av_inv_q(q: TAVRational): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := q.den; - Result.den := q.num; -end; - -function av_make_q(num, den: cint): TAVRational; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result.num := num; - Result.den := den; -end; - -end. diff --git a/src/lib/ffmpeg-3.4/swresample.pas b/src/lib/ffmpeg-3.4/swresample.pas deleted file mode 100644 index 6be09155..00000000 --- a/src/lib/ffmpeg-3.4/swresample.pas +++ /dev/null @@ -1,467 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of - * - * libswresample/swresample.h: - * version: 0.18.100 - * - *) - - -unit swresample; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib swresample} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Supported version by this header *) - LIBSWRESAMPLE_MAX_VERSION_MAJOR = 2; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 9; - LIBSWRESAMPLE_MAX_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBSWRESAMPLE_MIN_VERSION_MAJOR = 2; - LIBSWRESAMPLE_MIN_VERSION_MINOR = 9; - LIBSWRESAMPLE_MIN_VERSION_RELEASE = 100; - LIBSWRESAMPLE_MIN_VERSION = (LIBSWRESAMPLE_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWRESAMPLE_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBSWRESAMPLE_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWRESAMPLE_VERSION < LIBSWRESAMPLE_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} -{$IFEND} - -{$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} - SWR_CH_MAX = 32; (* < Maximum number of channels *) -{$ENDIF} - SWR_FLAG_RESAMPLE = 1; (* < Force resampling even if equal sample rate *) - -type -(** Dithering algorithms *) - TSwrDitherType = ( - SWR_DITHER_NONE = 0, - SWR_DITHER_RECTANGULAR, - SWR_DITHER_TRIANGULAR, - SWR_DITHER_TRIANGULAR_HIGHPASS, - - SWR_DITHER_NS = 64, (* < not part of API/ABI *) - SWR_DITHER_NS_LIPSHITZ, - SWR_DITHER_NS_F_WEIGHTED, - SWR_DITHER_NS_MODIFIED_E_WEIGHTED, - SWR_DITHER_NS_IMPROVED_E_WEIGHTED, - SWR_DITHER_NS_SHIBATA, - SWR_DITHER_NS_LOW_SHIBATA, - SWR_DITHER_NS_HIGH_SHIBATA, - SWR_DITHER_NB (* < not part of API/ABI *) - ); - -(** Resampling Engines *) - TSwrEngine = ( - SWR_ENGINE_SWR, (* < SW Resampler *) - SWR_ENGINE_SOXR, (* < SoX Resampler *) - SWR_ENGINE_NB (* < not part of API/ABI *) - ); - -(** Resampling Filter Types *) - TSwrFilterType = ( - SWR_FILTER_TYPE_CUBIC, (* < Cubic *) - SWR_FILTER_TYPE_BLACKMAN_NUTTALL, (* < Blackman Nuttall windowed sinc *) - SWR_FILTER_TYPE_KAISER (* < Kaiser windowed sinc *) - ); - -(** - * The libswresample context. Unlike libavcodec and libavformat, this structure - * is opaque. This means that if you would like to set options, you must use - * the @ref avoptions API and cannot directly set values to members of the - * structure. - *) - PPSwrContext= ^PSwrContext; - PSwrContext = ^TSwrContext; - TSwrContext = record - end; - -{$INCLUDE libavcodec/audioconvert.pas} - -(** - * Get the AVClass for swrContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function swr_get_class(): PAVClass; - cdecl; external sw__resample; - -(** - * Allocate SwrContext. - * - * If you use this function you will need to set the parameters (manually or - * with swr_alloc_set_opts()) before calling swr_init(). - * - * @see swr_alloc_set_opts(), swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc(): PSwrContext; - cdecl; external sw__resample; - -(** - * Initialize context after user parameters have been set. - * - * @see av_opt_set_int() - * @see av_opt_set_dict() - * - * @param[in,out] s Swr context to initialize - * @return AVERROR error code in case of failure. - *) -function swr_init(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Check whether an swr context has been initialized or not. - * - * @param[in] s Swr context to check - * @see swr_init() - * @return positive if it has been initialized, 0 if not initialized - *) -function swr_is_initialized(s: PSwrContext): cint; - cdecl; external sw__resample; - -(** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_* ) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_* ). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_* ) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_* ). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - *) -function swr_alloc_set_opts(s: PSwrContext; - out_ch_layout: cint64; out_sample_fmt: TAVSampleFormat; out_sample_rate: cint; - in_ch_layout: cint64; in_sample_fmt: TAVSampleFormat; in_sample_rate: cint; - log_offset: cint; log_ctx: pointer): PSwrContext; - cdecl; external sw__resample; - -(** - * Free the given SwrContext and set the pointer to NULL. - * - * @param[in] s a pointer to a pointer to Swr context - *) -procedure swr_free(s: PPSwrContext); - cdecl; external sw__resample; - -(** - * Closes the context so that swr_is_initialized() returns 0. - * - * The context can be brought back to life by running swr_init(), - * swr_init() can also be used without swr_close(). - * This function is mainly provided for simplifying the usecase - * where one tries to support libavresample and libswresample. - * - * @param[in,out] s Swr context to be closed - *) -procedure swr_close(s: PSwrContext); - cdecl; external sw__resample; - -(** - * Convert audio. - * - * in and in_count can be set to 0 to flush the last few samples out at the - * end. - * - * If more input is provided than output space, then the input will be buffered. - * You can avoid this buffering by using swr_get_out_samples() to retrieve an - * upper bound on the required number of output samples for the given number of - * input samples. Conversion will run directly without copying whenever possible. - * - * @param s allocated Swr context, with parameters set - * @param out output buffers, only the first one need be set in case of packed audio - * @param out_count amount of space available for output in samples per channel - * @param in input buffers, only the first one need to be set in case of packed audio - * @param in_count number of input samples available in one channel - * - * @return number of samples output per channel, negative value on error - *) -function swr_convert(s: PSwrContext; var out_: PByte; out_count: cint; - var in_: {const} PByte; in_count: cint): cint; - cdecl; external sw__resample; - -(** - * Convert the next timestamp from input to output - * timestamps are in 1/(in_sample_rate * out_sample_rate) units. - * - * @note There are 2 slightly differently behaving modes. - * First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) - * in this case timestamps will be passed through with delays compensated - * Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX) - * in this case the output timestamps will match output sample numbers - * - * @param pts timestamp for the next input sample, INT64_MIN if unknown - * @return the output timestamp for the next output sample - *) -function swr_next_pts(s: PSwrContext; pts: cint64): cint64; - cdecl; external sw__resample; - -(** - * Activate resampling compensation ("soft" compensation). This function is - * internally called when needed in swr_next_pts(). - * - * @param[in,out] s allocated Swr context. If it is not initialized, - * or SWR_FLAG_RESAMPLE is not set, swr_init() is - * called with the flag set. - * @param[in] sample_delta delta in PTS per sample - * @param[in] compensation_distance number of samples to compensate for - * @return >= 0 on success, AVERROR error codes if: - * @li @c s is NULL, - * @li @c compensation_distance is less than 0, - * @li @c compensation_distance is 0 but sample_delta is not, - * @li compensation unsupported by resampler, or - * @li swr_init() fails when called. - *) -function swr_set_compensation(s: PSwrContext; sample_delta: cint; compensation_distance: cint): cint; - cdecl; external sw__resample; - -(** - * Set a customized input channel mapping. - * - * @param[in,out] s allocated Swr context, not yet initialized - * @param[in] channel_map customized input channel mapping (array of channel - * indexes, -1 for a muted channel) - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_channel_mapping(s: PSwrContext; {const} channel_map: pcint): cint; - cdecl; external sw__resample; - -(** - * Generate a channel mixing matrix. - * - * This function is the one used internally by libswresample for building the - * default mixing matrix. It is made public just as a utility function for - * building custom matrices. - * - * @param in_layout input channel layout - * @param out_layout output channel layout - * @param center_mix_level mix level for the center channel - * @param surround_mix_level mix level for the surround channel(s) - * @param lfe_mix_level mix level for the low-frequency effects channel - * @param rematrix_maxval if 1.0, coefficients will be normalized to prevent - * overflow. if INT_MAX, coefficients will not be - * normalized. - * @param[out] matrix mixing coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o. - * @param stride distance between adjacent input channels in the - * matrix array - * @param matrix_encoding matrixed stereo downmix mode (e.g. dplii) - * @param log_ctx parent logging context, can be NULL - * @return 0 on success, negative AVERROR code on failure - *) -function swr_build_matrix(in_layout: Pcuint64; out_layout: Pcuint64; - center_mix_level: cdouble; surround_mix_level: cdouble; - lfe_mix_level: cdouble; rematrix_maxval: cdouble; - rematrix_volume: cdouble; matrix: Pcdouble; - stride: cint; matrix_encoding: TAVMatrixEncoding; - log_ctx: pointer): cint; - cdecl; external sw__resample; - -(** - * Set a customized remix matrix. - * - * @param s allocated Swr context, not yet initialized - * @param matrix remix coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o - * @param stride offset between lines of the matrix - * @return >= 0 on success, or AVERROR error code in case of failure. - *) -function swr_set_matrix(s: PSwrContext; {const} matrix: pcdouble; stride: cint): cint; - cdecl; external sw__resample; - -(** - * Drops the specified number of output samples. - * - * This function, along with swr_inject_silence(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_drop_output(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Injects the specified number of silence samples. - * - * This function, along with swr_drop_output(), is called by swr_next_pts() - * if needed for "hard" compensation. - * - * @param s allocated Swr context - * @param count number of samples to be dropped - * - * @return >= 0 on success, or a negative AVERROR code on failure - *) -function swr_inject_silence(s: PSwrContext; count: cint): cint; - cdecl; external sw__resample; - -(** - * Gets the delay the next input sample will experience relative to the next output sample. - * - * Swresample can buffer data if more input has been provided than available - * output space, also converting between sample rates needs a delay. - * This function returns the sum of all such delays. - * The exact delay is not necessarily an integer value in either input or - * output sample rate. Especially when downsampling by a large value, the - * output sample rate may be a poor choice to represent the delay, similarly - * for upsampling and the input sample rate. - * - * @param s swr context - * @param base timebase in which the returned delay will be: - * @li if it's set to 1 the returned delay is in seconds - * @li if it's set to 1000 the returned delay is in milliseconds - * @li if it's set to the input sample rate then the returned - * delay is in input samples - * @li if it's set to the output sample rate then the returned - * delay is in output samples - * @li if it's the least common multiple of in_sample_rate and - * out_sample_rate then an exact rounding-free delay will be - * returned - * @returns the delay in 1 / @c base units. - *) -function swr_get_delay(s: PSwrContext; base: cint64): cint64; - cdecl; external sw__resample; - -(** - * Find an upper bound on the number of samples that the next swr_convert - * call will output, if called with in_samples of input samples. This - * depends on the internal state, and anything changing the internal state - * (like further swr_convert() calls) will may change the number of samples - * swr_get_out_samples() returns for the same number of input samples. - * - * @param in_samples number of input samples. - * @note any call to swr_inject_silence(), swr_convert(), swr_next_pts() - * or swr_set_compensation() invalidates this limit - * @note it is recommended to pass the correct available buffer size - * to all functions like swr_convert() even if swr_get_out_samples() - * indicates that less would be used. - * @returns an upper bound on the number of samples that the next swr_convert - * will output or a negative value to indicate an error - *) -function swr_get_out_samples(s: PSwrContext; in_samples: cint): cint; - cdecl; external sw__resample; - -(** - * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. - * - * This is useful to check if the build-time libswresample has the same version - * as the run-time one. - * - * @returns the unsigned int-typed version - *) -function swresample_version(): cuint; - cdecl; external sw__resample; - -(** - * Return the swr build-time configuration. - * - * @returns the build-time @c ./configure flags - *) -function swresample_configuration(): PAnsiChar; - cdecl; external sw__resample; - -(** - * Return the swr license. - * - * @returns the license of libswresample, determined at build-time - *) -function swresample_license(): PAnsiChar; - cdecl; external sw__resample; - -implementation - -end. - diff --git a/src/lib/ffmpeg-3.4/swscale.pas b/src/lib/ffmpeg-3.4/swscale.pas deleted file mode 100644 index 0a1950d7..00000000 --- a/src/lib/ffmpeg-3.4/swscale.pas +++ /dev/null @@ -1,439 +0,0 @@ -(* - * Copyright (C) 2001-2011 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * version: 3.0.100 - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MACRO ON} (* Turn macro support on *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for ffmpeg defines *) -{$I ff_api-defines.inc} (* FF_API_* defines *) - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 4; - LIBSWSCALE_MAX_VERSION_MINOR = 8; - LIBSWSCALE_MAX_VERSION_RELEASE = 100; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -(** - * Return the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; - -(** - * Return the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Return the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominance subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - SWS_CS_BT2020 = 9; - -(** - * Return a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -(** - * Return a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Return a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * @param[in] pix_fmt the pixel format - * @return a positive value if an endianness conversion for pix_fmt is - * supported, 0 otherwise. - *) -function sws_isSupportedEndiannessConversion(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Allocate an empty SwsContext. This must be filled and passed to - * sws_init_context(). For filling see AVOptions, options.c and - * sws_setColorspaceDetails(). - *) -function sws_alloc_context(): PSwsContext; - cdecl; external sw__scale; - -(** - * Initialize the swscaler context sws_context. - * - * @return zero or positive value on success, a negative value on - * error - *) -function sws_init_context(sws_context: PSwsContext; srcFilter: PSwsFilter; dstFilter: PSwsFilter): cint; - cdecl; external sw__scale; - -(** - * Free the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocate and return a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @param param extra parameters to tune the used scaler - * For SWS_BICUBIC param[0] and [1] tune the shape of the basis - * function, param[0] tunes f(1) and param[1] f??(1) - * For SWS_GAUSS param[0] tunes the exponent and thus cutoff - * frequency - * For SWS_LANCZOS param[0] tunes the width of the window function - * @return a pointer to an allocated context, or NULL in case of error - * @note this function is to be removed after a saner alternative is - * written - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: {const} PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scale the image slice in srcSlice and put the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param c the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -(** - * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) - * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) - * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] - * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] - * @param brightness 16.16 fixed point brightness correction - * @param contrast 16.16 fixed point contrast correction - * @param saturation 16.16 fixed point saturation correction - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Allocate and return an uninitialized vector with length coefficients. - *) -function sws_allocVec(length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Return a normalized Gaussian curve used to filter stuff - * quality = 3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scale all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -{$IFDEF FF_API_SWS_VECTOR} -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; deprecated; -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; deprecated; -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; deprecated; -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; deprecated; -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; deprecated; -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; deprecated; -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; deprecated; -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; deprecated; -{$ENDIF} - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Check if context can be reused, otherwise reallocates a new one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Convert an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: cint; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Get the AVClass for swsContext. It can be used in combination with - * AV_OPT_SEARCH_FAKE_OBJ for examining options. - * - * @see av_opt_find(). - *) -function sws_get_class(): {const} PAVClass; - cdecl; external sw__scale; - -implementation - -end. diff --git a/src/lib/ffmpeg-4.0/avcodec.pas b/src/lib/ffmpeg-4.0/avcodec.pas index cef8b16e..d1cf9c46 100644 --- a/src/lib/ffmpeg-4.0/avcodec.pas +++ b/src/lib/ffmpeg-4.0/avcodec.pas @@ -19,7 +19,6 @@ * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team * * Conversion of libavcodec/avcodec.h * version: 56.1.100 @@ -84,7 +83,7 @@ interface (* Supported version by this header *) LIBAVCODEC_MAX_VERSION_MAJOR = 58; - LIBAVCODEC_MAX_VERSION_MINOR = 54; + LIBAVCODEC_MAX_VERSION_MINOR = 91; LIBAVCODEC_MAX_VERSION_RELEASE = 100; LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -92,7 +91,7 @@ interface (* Min. supported version by this header *) LIBAVCODEC_MIN_VERSION_MAJOR = 58; - LIBAVCODEC_MIN_VERSION_MINOR = 18; + LIBAVCODEC_MIN_VERSION_MINOR = 54; LIBAVCODEC_MIN_VERSION_RELEASE = 100; LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + diff --git a/src/lib/ffmpeg-4.0/avformat.pas b/src/lib/ffmpeg-4.0/avformat.pas index b6609e1f..81f041b1 100644 --- a/src/lib/ffmpeg-4.0/avformat.pas +++ b/src/lib/ffmpeg-4.0/avformat.pas @@ -63,7 +63,7 @@ interface *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 58; - LIBAVFORMAT_MAX_VERSION_MINOR = 29; + LIBAVFORMAT_MAX_VERSION_MINOR = 45; LIBAVFORMAT_MAX_VERSION_RELEASE = 100; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -71,7 +71,7 @@ interface (* Min. supported version by this header *) LIBAVFORMAT_MIN_VERSION_MAJOR = 58; - LIBAVFORMAT_MIN_VERSION_MINOR = 12; + LIBAVFORMAT_MIN_VERSION_MINOR = 29; LIBAVFORMAT_MIN_VERSION_RELEASE = 100; LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + diff --git a/src/lib/ffmpeg-4.0/avutil.pas b/src/lib/ffmpeg-4.0/avutil.pas index c3b17d29..0a2587b9 100644 --- a/src/lib/ffmpeg-4.0/avutil.pas +++ b/src/lib/ffmpeg-4.0/avutil.pas @@ -58,7 +58,7 @@ interface const (* Max. supported version by this header *) LIBAVUTIL_MAX_VERSION_MAJOR = 56; - LIBAVUTIL_MAX_VERSION_MINOR = 31; + LIBAVUTIL_MAX_VERSION_MINOR = 51; LIBAVUTIL_MAX_VERSION_RELEASE = 100; LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -66,7 +66,7 @@ interface (* Min. supported version by this header *) LIBAVUTIL_MIN_VERSION_MAJOR = 56; - LIBAVUTIL_MIN_VERSION_MINOR = 14; + LIBAVUTIL_MIN_VERSION_MINOR = 31; LIBAVUTIL_MIN_VERSION_RELEASE = 100; LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + diff --git a/src/lib/ffmpeg-4.0/libavutil/frame.pas b/src/lib/ffmpeg-4.0/libavutil/frame.pas index f10e2ff2..eb97e27b 100644 --- a/src/lib/ffmpeg-4.0/libavutil/frame.pas +++ b/src/lib/ffmpeg-4.0/libavutil/frame.pas @@ -705,7 +705,7 @@ function av_frame_alloc(): PAVFrame; * @param frame frame to be freed. The pointer will be set to NULL. *) procedure av_frame_free(frame: PPAVFrame); - cdecl; external av__codec; + cdecl; external av__util; (** * Set up a new reference to the data described by the source frame. diff --git a/src/lib/ffmpeg-4.0/swresample.pas b/src/lib/ffmpeg-4.0/swresample.pas index 87d30a9f..13107de6 100644 --- a/src/lib/ffmpeg-4.0/swresample.pas +++ b/src/lib/ffmpeg-4.0/swresample.pas @@ -83,7 +83,7 @@ interface (* Supported version by this header *) LIBSWRESAMPLE_MAX_VERSION_MAJOR = 3; - LIBSWRESAMPLE_MAX_VERSION_MINOR = 5; + LIBSWRESAMPLE_MAX_VERSION_MINOR = 7; LIBSWRESAMPLE_MAX_VERSION_RELEASE = 100; LIBSWRESAMPLE_MAX_VERSION = (LIBSWRESAMPLE_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWRESAMPLE_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -106,7 +106,7 @@ interface {$IF (LIBSWRESAMPLE_VERSION > LIBSWRESAMPLE_MAX_VERSION)} {$MESSAGE Error 'Linked version of libswresample is not yet supported!'} {$IFEND} - + {$IF LIBSWRESAMPLE_VERSION_MAJOR < 1} SWR_CH_MAX = 32; (* < Maximum number of channels *) {$ENDIF} @@ -200,7 +200,7 @@ function swr_init(s: PSwrContext): cint; *) function swr_is_initialized(s: PSwrContext): cint; cdecl; external sw__resample; - + (** * Allocate SwrContext if needed and set/reset common parameters. * @@ -464,4 +464,3 @@ function swresample_license(): PAnsiChar; implementation end. - diff --git a/src/lib/ffmpeg-4.0/swscale.pas b/src/lib/ffmpeg-4.0/swscale.pas index 55c74c6c..66a81d5d 100644 --- a/src/lib/ffmpeg-4.0/swscale.pas +++ b/src/lib/ffmpeg-4.0/swscale.pas @@ -21,7 +21,7 @@ * Conversion of libswscale/swscale.h * version: 3.0.100 *) - + unit swscale; {$IFDEF FPC} @@ -72,12 +72,12 @@ interface * You can accelerate this process by posting a patch with the git changes * translated to Pascal to our bug tracker (please join our IRC chat before * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. + * fix. *) (* Max. supported version by this header *) LIBSWSCALE_MAX_VERSION_MAJOR = 5; - LIBSWSCALE_MAX_VERSION_MINOR = 5; + LIBSWSCALE_MAX_VERSION_MINOR = 7; LIBSWSCALE_MAX_VERSION_RELEASE = 100; LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -164,7 +164,7 @@ function swscale_license(): PAnsiChar; *) function sws_getCoefficients(colorspace: cint): Pcint; cdecl; external sw__scale; - + type // when used for filters they must have an odd number of elements @@ -289,7 +289,7 @@ function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; * @return the height of the output slice *) function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; - {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; + {const} srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; cdecl; external sw__scale; @@ -303,7 +303,7 @@ function sws_scale(c: PSwsContext; {const} srcSlice: PPCuint8Array; * @param saturation 16.16 fixed point saturation correction * @return -1 if not supported *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; +function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; srcRange: cint; table: PQuadCintArray; dstRange: cint; brightness: cint; contrast: cint; saturation: cint): cint; cdecl; external sw__scale; @@ -365,7 +365,7 @@ procedure sws_printVec2(a: PSwsVector; procedure sws_freeVec(a: PSwsVector); cdecl; external sw__scale; -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; +function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; lumaSharpen: cfloat; chromaSharpen: cfloat; chromaHShift: cfloat; chromaVShift: cfloat; verbose: cint): PSwsFilter; @@ -376,20 +376,20 @@ procedure sws_freeFilter(filter: PSwsFilter); (** * Check if context can be reused, otherwise reallocates a new one. - * + * * If context is NULL, just calls sws_getContext() to get a new * context. Otherwise, checks if the parameters are the ones already * saved in context. If that is the case, returns the current * context. Otherwise, frees context and gets a new context with * the new parameters. - * + * * Be warned that srcFilter and dstFilter are not checked, they * are assumed to remain the same. *) function sws_getCachedContext(context: PSwsContext; srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; + flags: cint; srcFilter: PSwsFilter; dstFilter: PSwsFilter; param: PCdouble): PSwsContext; cdecl; external sw__scale; diff --git a/src/lib/ffmpeg/avcodec.pas b/src/lib/ffmpeg/avcodec.pas deleted file mode 100644 index ea6a45dc..00000000 --- a/src/lib/ffmpeg/avcodec.pas +++ /dev/null @@ -1,5008 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/avcodec.h - * Min. version: 51.16.0, revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.86.1, revision 24882, Wed Aug 23 07:00:00 2010 CET - * - *) - -unit avcodec; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavcodec} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - rational, - opt, - SysUtils, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Max. supported version by this header *) - LIBAVCODEC_MAX_VERSION_MAJOR = 52; - LIBAVCODEC_MAX_VERSION_MINOR = 86; - LIBAVCODEC_MAX_VERSION_RELEASE = 1; - LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVCODEC_MIN_VERSION_MAJOR = 51; - LIBAVCODEC_MIN_VERSION_MINOR = 16; - LIBAVCODEC_MIN_VERSION_RELEASE = 0; - LIBAVCODEC_MIN_VERSION = (LIBAVCODEC_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVCODEC_VERSION < LIBAVCODEC_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is too old!'} -{$IFEND} - -(* Check if linked version is supported *) -{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavcodec is not yet supported!'} -{$IFEND} - -{$IFNDEF FPC} -type - // defines for Delphi - size_t = cardinal; -{$ENDIF} - -const - AV_NOPTS_VALUE: cint64 = $8000000000000000; - AV_TIME_BASE = 1000000; - AV_TIME_BASE_Q: TAVRational = (num: 1; den: AV_TIME_BASE); - -(** - * Identify the syntax and semantics of the bitstream. - * The principle is roughly: - * Two decoders with the same ID can decode the same streams. - * Two encoders with the same ID can encode compatible streams. - * There may be slight deviations from the principle due to implementation - * details. - * - * If you add a codec ID to this list, add it so that - * 1. no value of a existing codec ID changes (that would break ABI), - * 2. it is as close as possible to similar codecs. - *) -type - TCodecID = ( - CODEC_ID_NONE, - - (* video codecs *) - CODEC_ID_MPEG1VIDEO, - CODEC_ID_MPEG2VIDEO, //* prefered ID for MPEG Video 1/2 decoding */ - CODEC_ID_MPEG2VIDEO_XVMC, - CODEC_ID_H261, - CODEC_ID_H263, - CODEC_ID_RV10, - CODEC_ID_RV20, - CODEC_ID_MJPEG, - CODEC_ID_MJPEGB, - CODEC_ID_LJPEG, - CODEC_ID_SP5X, - CODEC_ID_JPEGLS, - CODEC_ID_MPEG4, - CODEC_ID_RAWVIDEO, - CODEC_ID_MSMPEG4V1, - CODEC_ID_MSMPEG4V2, - CODEC_ID_MSMPEG4V3, - CODEC_ID_WMV1, - CODEC_ID_WMV2, - CODEC_ID_H263P, - CODEC_ID_H263I, - CODEC_ID_FLV1, - CODEC_ID_SVQ1, - CODEC_ID_SVQ3, - CODEC_ID_DVVIDEO, - CODEC_ID_HUFFYUV, - CODEC_ID_CYUV, - CODEC_ID_H264, - CODEC_ID_INDEO3, - CODEC_ID_VP3, - CODEC_ID_THEORA, - CODEC_ID_ASV1, - CODEC_ID_ASV2, - CODEC_ID_FFV1, - CODEC_ID_4XM, - CODEC_ID_VCR1, - CODEC_ID_CLJR, - CODEC_ID_MDEC, - CODEC_ID_ROQ, - CODEC_ID_INTERPLAY_VIDEO, - CODEC_ID_XAN_WC3, - CODEC_ID_XAN_WC4, - CODEC_ID_RPZA, - CODEC_ID_CINEPAK, - CODEC_ID_WS_VQA, - CODEC_ID_MSRLE, - CODEC_ID_MSVIDEO1, - CODEC_ID_IDCIN, - CODEC_ID_8BPS, - CODEC_ID_SMC, - CODEC_ID_FLIC, - CODEC_ID_TRUEMOTION1, - CODEC_ID_VMDVIDEO, - CODEC_ID_MSZH, - CODEC_ID_ZLIB, - CODEC_ID_QTRLE, - CODEC_ID_SNOW, - CODEC_ID_TSCC, - CODEC_ID_ULTI, - CODEC_ID_QDRAW, - CODEC_ID_VIXL, - CODEC_ID_QPEG, -{$IF LIBAVCODEC_VERSION_MAJOR < 53} - CODEC_ID_XVID, -{$IFEND} - CODEC_ID_PNG, - CODEC_ID_PPM, - CODEC_ID_PBM, - CODEC_ID_PGM, - CODEC_ID_PGMYUV, - CODEC_ID_PAM, - CODEC_ID_FFVHUFF, - CODEC_ID_RV30, - CODEC_ID_RV40, - CODEC_ID_VC1, - CODEC_ID_WMV3, - CODEC_ID_LOCO, - CODEC_ID_WNV1, - CODEC_ID_AASC, - CODEC_ID_INDEO2, - CODEC_ID_FRAPS, - CODEC_ID_TRUEMOTION2, - CODEC_ID_BMP, - CODEC_ID_CSCD, - CODEC_ID_MMVIDEO, - CODEC_ID_ZMBV, - CODEC_ID_AVS, - CODEC_ID_SMACKVIDEO, - CODEC_ID_NUV, - CODEC_ID_KMVC, - CODEC_ID_FLASHSV, - CODEC_ID_CAVS, - CODEC_ID_JPEG2000, - CODEC_ID_VMNC, - CODEC_ID_VP5, - CODEC_ID_VP6, - CODEC_ID_VP6F, - CODEC_ID_TARGA, - CODEC_ID_DSICINVIDEO, - CODEC_ID_TIERTEXSEQVIDEO, - CODEC_ID_TIFF, - CODEC_ID_GIF, - CODEC_ID_FFH264, - CODEC_ID_DXA, - CODEC_ID_DNXHD, - CODEC_ID_THP, - CODEC_ID_SGI, - CODEC_ID_C93, - CODEC_ID_BETHSOFTVID, - CODEC_ID_PTX, - CODEC_ID_TXD, - CODEC_ID_VP6A, - CODEC_ID_AMV, - CODEC_ID_VB, - CODEC_ID_PCX, - CODEC_ID_SUNRAST, - CODEC_ID_INDEO4, - CODEC_ID_INDEO5, - CODEC_ID_MIMIC, - CODEC_ID_RL2, - CODEC_ID_8SVX_EXP, - CODEC_ID_8SVX_FIB, - CODEC_ID_ESCAPE124, - CODEC_ID_DIRAC, - CODEC_ID_BFI, - CODEC_ID_CMV, - CODEC_ID_MOTIONPIXELS, - CODEC_ID_TGV, - CODEC_ID_TGQ, -{$IF LIBAVCODEC_VERSION >= 52012000} // >= 52.12.0 - CODEC_ID_TQI, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52022002} // >= 52.22.2 - CODEC_ID_AURA, - CODEC_ID_AURA2, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52027000} // >= 52.27.0 - CODEC_ID_V210X, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52028000} // >= 52.28.0 - CODEC_ID_TMV, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52029000} // >= 52.29.0 - CODEC_ID_V210, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52030002} // >= 52.30.2 - CODEC_ID_DPX, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52031002} // >= 52.31.2 - CODEC_ID_MAD, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52037000} // >= 52.37.0 - CODEC_ID_FRWU, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52041000} // >= 52.41.0 - CODEC_ID_FLASHSV2, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52043000} // >= 52.43.0 - CODEC_ID_CDGRAPHICS, - CODEC_ID_R210, -{$IFEND} - CODEC_ID_ANM, -{$IF LIBAVCODEC_VERSION >= 52049000} // >= 52.49.0 - CODEC_ID_BINKVIDEO, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52052000} // >= 52.52.0 - CODEC_ID_IFF_ILBM, - CODEC_ID_IFF_BYTERUN1, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52058000} // >= 52.58.0 - CODEC_ID_KGV1, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52062000} // >= 52.62.0 - CODEC_ID_YOP, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52067002} // >= 52.67.2 - CODEC_ID_VP8, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52075001} // >= 52.75.1 - CODEC_ID_PICTOR, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52084000} // >= 52.84.0 - CODEC_ID_ANSI, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52086001} // >= 52.86.1 - CODEC_ID_A64_MULTI, - CODEC_ID_A64_MULTI5, -{$IFEND} - - //* various PCM "codecs" */ - CODEC_ID_PCM_S16LE= $10000, - CODEC_ID_PCM_S16BE, - CODEC_ID_PCM_U16LE, - CODEC_ID_PCM_U16BE, - CODEC_ID_PCM_S8, - CODEC_ID_PCM_U8, - CODEC_ID_PCM_MULAW, - CODEC_ID_PCM_ALAW, - CODEC_ID_PCM_S32LE, - CODEC_ID_PCM_S32BE, - CODEC_ID_PCM_U32LE, - CODEC_ID_PCM_U32BE, - CODEC_ID_PCM_S24LE, - CODEC_ID_PCM_S24BE, - CODEC_ID_PCM_U24LE, - CODEC_ID_PCM_U24BE, - CODEC_ID_PCM_S24DAUD, - CODEC_ID_PCM_ZORK, - CODEC_ID_PCM_S16LE_PLANAR, - CODEC_ID_PCM_DVD, - CODEC_ID_PCM_F32BE, - CODEC_ID_PCM_F32LE, - CODEC_ID_PCM_F64BE, - CODEC_ID_PCM_F64LE, -{$IF LIBAVCODEC_VERSION >= 52034000} // >= 52.34.0 - CODEC_ID_PCM_BLURAY, -{$IFEND} - - //* various ADPCM codecs */ - CODEC_ID_ADPCM_IMA_QT= $11000, - CODEC_ID_ADPCM_IMA_WAV, - CODEC_ID_ADPCM_IMA_DK3, - CODEC_ID_ADPCM_IMA_DK4, - CODEC_ID_ADPCM_IMA_WS, - CODEC_ID_ADPCM_IMA_SMJPEG, - CODEC_ID_ADPCM_MS, - CODEC_ID_ADPCM_4XM, - CODEC_ID_ADPCM_XA, - CODEC_ID_ADPCM_ADX, - CODEC_ID_ADPCM_EA, - CODEC_ID_ADPCM_G726, - CODEC_ID_ADPCM_CT, - CODEC_ID_ADPCM_SWF, - CODEC_ID_ADPCM_YAMAHA, - CODEC_ID_ADPCM_SBPRO_4, - CODEC_ID_ADPCM_SBPRO_3, - CODEC_ID_ADPCM_SBPRO_2, - CODEC_ID_ADPCM_THP, - CODEC_ID_ADPCM_IMA_AMV, - CODEC_ID_ADPCM_EA_R1, - CODEC_ID_ADPCM_EA_R3, - CODEC_ID_ADPCM_EA_R2, - CODEC_ID_ADPCM_IMA_EA_SEAD, - CODEC_ID_ADPCM_IMA_EA_EACS, - CODEC_ID_ADPCM_EA_XAS, - CODEC_ID_ADPCM_EA_MAXIS_XA, - CODEC_ID_ADPCM_IMA_ISS, - - //* AMR */ - CODEC_ID_AMR_NB= $12000, - CODEC_ID_AMR_WB, - - //* RealAudio codecs*/ - CODEC_ID_RA_144= $13000, - CODEC_ID_RA_288, - - //* various DPCM codecs */ - CODEC_ID_ROQ_DPCM= $14000, - CODEC_ID_INTERPLAY_DPCM, - CODEC_ID_XAN_DPCM, - CODEC_ID_SOL_DPCM, - - (* audio codecs *) - CODEC_ID_MP2= $15000, - CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - CODEC_ID_AAC, - {$IF LIBAVCODEC_VERSION < 52000000} // < 52.0.0 - _CODEC_ID_MPEG4AAC, // will be redefined to CODEC_ID_AAC below - {$IFEND} - CODEC_ID_AC3, - CODEC_ID_DTS, - CODEC_ID_VORBIS, - CODEC_ID_DVAUDIO, - CODEC_ID_WMAV1, - CODEC_ID_WMAV2, - CODEC_ID_MACE3, - CODEC_ID_MACE6, - CODEC_ID_VMDAUDIO, - CODEC_ID_SONIC, - CODEC_ID_SONIC_LS, - CODEC_ID_FLAC, - CODEC_ID_MP3ADU, - CODEC_ID_MP3ON4, - CODEC_ID_SHORTEN, - CODEC_ID_ALAC, - CODEC_ID_WESTWOOD_SND1, - CODEC_ID_GSM, ///< as in Berlin toast format - CODEC_ID_QDM2, - CODEC_ID_COOK, - CODEC_ID_TRUESPEECH, - CODEC_ID_TTA, - CODEC_ID_SMACKAUDIO, - CODEC_ID_QCELP, - CODEC_ID_WAVPACK, - CODEC_ID_DSICINAUDIO, - CODEC_ID_IMC, - CODEC_ID_MUSEPACK7, - CODEC_ID_MLP, - CODEC_ID_GSM_MS, { as found in WAV } - CODEC_ID_ATRAC3, - CODEC_ID_VOXWARE, - CODEC_ID_APE, - CODEC_ID_NELLYMOSER, - CODEC_ID_MUSEPACK8, - CODEC_ID_SPEEX, - CODEC_ID_WMAVOICE, - CODEC_ID_WMAPRO, - CODEC_ID_WMALOSSLESS, - CODEC_ID_ATRAC3P, - CODEC_ID_EAC3, - CODEC_ID_SIPR, - CODEC_ID_MP1, -{$IF LIBAVCODEC_VERSION >= 52020000} // >= 52.20.0 - CODEC_ID_TWINVQ, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52022000} // >= 52.22.0 - CODEC_ID_TRUEHD, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52026000} // >= 52.26.0 - CODEC_ID_MP4ALS, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52035000} // >= 52.35.0 - CODEC_ID_ATRAC1, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52049000} // >= 52.49.0 - CODEC_ID_BINKAUDIO_RDFT, - CODEC_ID_BINKAUDIO_DCT, -{$IFEND} - - //* subtitle codecs */ - CODEC_ID_DVD_SUBTITLE= $17000, - CODEC_ID_DVB_SUBTITLE, - CODEC_ID_TEXT, ///< raw UTF-8 text - CODEC_ID_XSUB, - CODEC_ID_SSA, - CODEC_ID_MOV_TEXT, -{$IF LIBAVCODEC_VERSION >= 52033000} // >= 52.33.0 - CODEC_ID_HDMV_PGS_SUBTITLE, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52037001} // >= 52.37.1 - CODEC_ID_DVB_TELETEXT, -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52084001} // >= 52.84.1 - CODEC_ID_SRT, -{$IFEND} - - (* other specific kind of codecs (generally used for attachments) *) - CODEC_ID_TTF= $18000, - - CODEC_ID_PROBE= $19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it - - CODEC_ID_MPEG2TS= $20000, {*< _FAKE_ codec to indicate a raw MPEG-2 TS - * stream (only used by libavformat) *} - __CODEC_ID_4BYTE = $FFFFF // ensure 4-byte enum - ); - -{$IF LIBAVCODEC_VERSION < 52000000} // < 52.0.0 -{* CODEC_ID_MP3LAME is obsolete *} -const - CODEC_ID_MP3LAME = CODEC_ID_MP3; - CODEC_ID_MPEG4AAC = CODEC_ID_AAC; -{$IFEND} - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} // < 53.0.0 -type - TCodecType = ( - CODEC_TYPE_UNKNOWN = -1, - CODEC_TYPE_VIDEO, - CODEC_TYPE_AUDIO, - CODEC_TYPE_DATA, - CODEC_TYPE_SUBTITLE, - CODEC_TYPE_ATTACHMENT, - CODEC_TYPE_NB - ); -{$IFEND} - -{ - TAVMediaType moved to avutil in LIBAVUTIL_VERSION 50.14.0 - but moving it in the pascal headers was not really necessary - but caused problems. So, I (KMS) left it here. -} -{$IF LIBAVCODEC_VERSION >= 52064000} // >= 52.64.0 -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, - AVMEDIA_TYPE_NB - ); -{$IFEND} - -{** - * all in native endian - *} -type - TAVSampleFormat = ( - AV_SAMPLE_FMT_NONE = -1, - AV_SAMPLE_FMT_U8, ///< unsigned 8 bits - AV_SAMPLE_FMT_S16, ///< signed 16 bits - AV_SAMPLE_FMT_S32, ///< signed 32 bits - AV_SAMPLE_FMT_FLT, ///< float - AV_SAMPLE_FMT_DBL, ///< double - AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if dynamically linking to libavcodec - ); - TAVSampleFormatArray = array [0 .. MaxInt div SizeOf(TAVSampleFormat)-1] of TAVSampleFormat; - PAVSampleFormatArray = ^TAVSampleFormatArray; - -const - {* Audio channel masks *} - CH_FRONT_LEFT = $00000001; - CH_FRONT_RIGHT = $00000002; - CH_FRONT_CENTER = $00000004; - CH_LOW_FREQUENCY = $00000008; - CH_BACK_LEFT = $00000010; - CH_BACK_RIGHT = $00000020; - CH_FRONT_LEFT_OF_CENTER = $00000040; - CH_FRONT_RIGHT_OF_CENTER = $00000080; - CH_BACK_CENTER = $00000100; - CH_SIDE_LEFT = $00000200; - CH_SIDE_RIGHT = $00000400; - CH_TOP_CENTER = $00000800; - CH_TOP_FRONT_LEFT = $00001000; - CH_TOP_FRONT_CENTER = $00002000; - CH_TOP_FRONT_RIGHT = $00004000; - CH_TOP_BACK_LEFT = $00008000; - CH_TOP_BACK_CENTER = $00010000; - CH_TOP_BACK_RIGHT = $00020000; - CH_STEREO_LEFT = $20000000; ///< Stereo downmix. - CH_STEREO_RIGHT = $40000000; ///< See CH_STEREO_LEFT. -{** Channel mask value used for AVCodecContext.request_channel_layout - * to indicate that the user requests the channel order of the decoder output - * to be the native codec channel order. - *} -{$IF LIBAVCODEC_VERSION >= 52038001} // >= 52.38.1 - CH_LAYOUT_NATIVE = $8000000000000000; -{$IFEND} - - {* Audio channel convenience macros *} - CH_LAYOUT_MONO = (CH_FRONT_CENTER); - CH_LAYOUT_STEREO = (CH_FRONT_LEFT or CH_FRONT_RIGHT); - CH_LAYOUT_SURROUND = (CH_LAYOUT_STEREO or CH_FRONT_CENTER); -{$IF LIBAVCODEC_VERSION >= 52027000} // >= 52.27.0 - CH_LAYOUT_2_1 = (CH_LAYOUT_STEREO or CH_BACK_CENTER); - CH_LAYOUT_4POINT0 = (CH_LAYOUT_SURROUND or CH_BACK_CENTER); - CH_LAYOUT_2_2 = (CH_LAYOUT_STEREO or CH_SIDE_LEFT or CH_SIDE_RIGHT); -{$IFEND} - CH_LAYOUT_QUAD = (CH_LAYOUT_STEREO or CH_BACK_LEFT or CH_BACK_RIGHT); - CH_LAYOUT_5POINT0 = (CH_LAYOUT_SURROUND or CH_SIDE_LEFT or CH_SIDE_RIGHT); - CH_LAYOUT_5POINT1 = (CH_LAYOUT_5POINT0 or CH_LOW_FREQUENCY); -{$IF LIBAVCODEC_VERSION >= 52025000} // >= 52.25.0 - CH_LAYOUT_5POINT0_BACK = (CH_LAYOUT_SURROUND or CH_BACK_LEFT or - CH_BACK_RIGHT); - CH_LAYOUT_5POINT1_BACK = (CH_LAYOUT_5POINT0_BACK or CH_LOW_FREQUENCY); -{$IFEND} -{$IF LIBAVCODEC_VERSION >= 52034000} // >= 52.34.0 - CH_LAYOUT_7POINT0 = (CH_LAYOUT_5POINT0 or CH_BACK_LEFT or CH_BACK_RIGHT); -{$IFEND} - CH_LAYOUT_7POINT1 = (CH_LAYOUT_5POINT1 or CH_BACK_LEFT or CH_BACK_RIGHT); -{$IF LIBAVCODEC_VERSION < 52025000} // < 52.25.0 - CH_LAYOUT_7POINT1_WIDE = (CH_LAYOUT_SURROUND or CH_LOW_FREQUENCY or - CH_BACK_LEFT or CH_BACK_RIGHT or -{$ELSE} - CH_LAYOUT_7POINT1_WIDE = (CH_LAYOUT_5POINT1_BACK or -{$IFEND} - CH_FRONT_LEFT_OF_CENTER or - CH_FRONT_RIGHT_OF_CENTER); - CH_LAYOUT_STEREO_DOWNMIX = (CH_STEREO_LEFT or CH_STEREO_RIGHT); - -{* in bytes *} - AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio - -{$IF LIBAVCODEC_VERSION <= 52056000} // <= 52.56.0 -{** - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *} - FF_INPUT_BUFFER_PADDING_SIZE = 8; -{$ELSEIF LIBAVCODEC_VERSION < 52058000} // < 52.58.0 -{** - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * The first 8 bytes are needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end. The remainder is to give - * decoders a reasonable amount of distance to work with before checking for - * buffer overreads.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *} - FF_INPUT_BUFFER_PADDING_SIZE = 64; -{$ELSE} // >= 52.58.0} -{** - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * This is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end.
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged - * MPEG bitstreams could cause overread and segfault. - *} - FF_INPUT_BUFFER_PADDING_SIZE = 8; -{$IFEND} - -{** - * minimum encoding buffer size. - * Used to avoid some checks during header writing. - *} - FF_MIN_BUFFER_SIZE = 16384; - -type -{* - * motion estimation type. - *} - TMotion_Est_ID = ( - ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed - ME_FULL, - ME_LOG, - ME_PHODS, - ME_EPZS, ///< enhanced predictive zonal search - ME_X1, ///< reserved for experiments - ME_HEX, ///< hexagon based search - ME_UMH, ///< uneven multi-hexagon search - ME_ITER, ///< iterative search - ME_TESA ///< transformed exhaustive search algorithm - ); - - TAVDiscard = ( - {* We leave some space between them for extensions (drop some - * keyframes for intra-only or drop just some bidir frames). - *} - AVDISCARD_NONE = -16, ///< discard nothing - AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi - AVDISCARD_NONREF = 8, ///< discard all non reference - AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames - AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes - AVDISCARD_ALL = 48 ///< discard all - ); - -{$IF LIBAVCODEC_VERSION >= 52028000} // >= 52.28.0 - TAVColorPrimaries = ( - AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM - AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC - AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB ///< Not part of ABI - ); - - TAVColorTransferCharacteristic = ( - AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM - AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG - AVCOL_TRC_NB ///< Not part of ABI - ); - - TAVColorSpace = ( - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 - AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_NB ///< Not part of ABI - ); - - TAVColorRange = ( - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges - AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges - AVCOL_RANGE_NB ///< Not part of ABI - ); - -(** - * X X 3 4 X X are luma samples, - * 1 2 1-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position - *) - TAVChromaLocation = ( - AVCHROMA_LOC_UNSPECIFIED = 0, - AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default - AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 - AVCHROMA_LOC_TOPLEFT = 3, ///< DV - AVCHROMA_LOC_TOP = 4, - AVCHROMA_LOC_BOTTOMLEFT = 5, - AVCHROMA_LOC_BOTTOM = 6, - AVCHROMA_LOC_NB ///< Not part of ABI - ); -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52083000} // >= 52.83.0 -(** - * LPC analysis type - *) - TAVLPCType = ( - AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type - AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients - AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients - AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion - AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization - AV_LPC_TYPE_NB ///< Not part of ABI - ); -{$IFEND} - - PRcOverride = ^TRcOverride; - TRcOverride = record {16} - start_frame: cint; - end_frame: cint; - qscale: cint; // if this is 0 then quality_factor will be used instead - quality_factor: cfloat; - end; - -const - FF_MAX_B_FRAMES = 16; - -{* encoding support - These flags can be passed in AVCodecContext.flags before initialization. - Note: Not everything is supported yet. -*} - - CODEC_FLAG_QSCALE = $0002; ///< Use fixed qscale. - CODEC_FLAG_4MV = $0004; ///< 4 MV per MB allowed / advanced prediction for H263. - CODEC_FLAG_QPEL = $0010; ///< use qpel MC. - CODEC_FLAG_GMC = $0020; ///< use GMC. - CODEC_FLAG_MV0 = $0040; ///< always try a MB with MV=<0,0>. - CODEC_FLAG_PART = $0080; ///< Use data partitioning. - {** - * The parent program guarantees that the input for B-frames containing - * streams is not written to for at least s->max_b_frames+1 frames, if - * this is not set the input will be copied. - *} - CODEC_FLAG_INPUT_PRESERVED = $0100; - CODEC_FLAG_PASS1 = $0200; ///< use internal 2pass ratecontrol in first pass mode - CODEC_FLAG_PASS2 = $0400; ///< use internal 2pass ratecontrol in second pass mode - CODEC_FLAG_EXTERN_HUFF = $1000; ///< use external huffman table (for mjpeg) - CODEC_FLAG_GRAY = $2000; ///< only decode/encode grayscale - CODEC_FLAG_EMU_EDGE = $4000; ///< don't draw edges - CODEC_FLAG_PSNR = $8000; ///< error[?] variables will be set during encoding - CODEC_FLAG_TRUNCATED = $00010000; //** input bitstream might be truncated at a random location instead - // of only at frame boundaries */ - CODEC_FLAG_NORMALIZE_AQP = $00020000; ///< normalize adaptive quantization - CODEC_FLAG_INTERLACED_DCT = $00040000; ///< use interlaced dct - CODEC_FLAG_LOW_DELAY = $00080000; ///< force low delay - CODEC_FLAG_ALT_SCAN = $00100000; ///< use alternate scan - {$IF LIBAVCODEC_VERSION < 52000000} // < 52.0.0 - CODEC_FLAG_TRELLIS_QUANT = $00200000; ///< use trellis quantization - {$IFEND} - CODEC_FLAG_GLOBAL_HEADER = $00400000; ///< place global headers in extradata instead of every keyframe - CODEC_FLAG_BITEXACT = $00800000; ///< use only bitexact stuff (except (i)dct) - {* Fx : Flag for h263+ extra options *} - {$IF LIBAVCODEC_VERSION < 52000000} // < 52.0.0 - CODEC_FLAG_H263P_AIC = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction (remove this) - {$IFEND} - CODEC_FLAG_AC_PRED = $01000000; ///< H263 Advanced intra coding / MPEG4 AC prediction - CODEC_FLAG_H263P_UMV = $02000000; ///< Unlimited motion vector - CODEC_FLAG_CBP_RD = $04000000; ///< use rate distortion optimization for cbp - CODEC_FLAG_QP_RD = $08000000; ///< use rate distortion optimization for qp selectioon - CODEC_FLAG_H263P_AIV = $00000008; ///< H263 Alternative inter vlc - CODEC_FLAG_OBMC = $00000001; ///< OBMC - CODEC_FLAG_LOOP_FILTER = $00000800; ///< loop filter - CODEC_FLAG_H263P_SLICE_STRUCT = $10000000; - CODEC_FLAG_INTERLACED_ME = $20000000; ///< interlaced motion estimation - CODEC_FLAG_SVCD_SCAN_OFFSET = $40000000; ///< will reserve space for SVCD scan offset user data - CODEC_FLAG_CLOSED_GOP = $80000000; - CODEC_FLAG2_FAST = $00000001; ///< allow non spec compliant speedup tricks - CODEC_FLAG2_STRICT_GOP = $00000002; ///< strictly enforce GOP size - CODEC_FLAG2_NO_OUTPUT = $00000004; ///< skip bitstream encoding - CODEC_FLAG2_LOCAL_HEADER = $00000008; ///< place global headers at every keyframe instead of in extradata - CODEC_FLAG2_BPYRAMID = $00000010; ///< H.264 allow b-frames to be used as references - CODEC_FLAG2_WPRED = $00000020; ///< H.264 weighted biprediction for b-frames - CODEC_FLAG2_MIXED_REFS = $00000040; ///< H.264 multiple references per partition - CODEC_FLAG2_8X8DCT = $00000080; ///< H.264 high profile 8x8 transform - CODEC_FLAG2_FASTPSKIP = $00000100; ///< H.264 fast pskip - CODEC_FLAG2_AUD = $00000200; ///< H.264 access unit delimiters - CODEC_FLAG2_BRDO = $00000400; ///< b-frame rate-distortion optimization - CODEC_FLAG2_INTRA_VLC = $00000800; ///< use MPEG-2 intra VLC table - CODEC_FLAG2_MEMC_ONLY = $00001000; ///< only do ME/MC (I frames -> ref, P frame -> ME+MC) - CODEC_FLAG2_DROP_FRAME_TIMECODE = $00002000; ///< timecode is in drop frame format. - CODEC_FLAG2_SKIP_RD = $00004000; ///< RD optimal MB level residual skipping - CODEC_FLAG2_CHUNKS = $00008000; ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. - CODEC_FLAG2_NON_LINEAR_QUANT = $00010000; ///< Use MPEG-2 nonlinear quantizer. - CODEC_FLAG2_BIT_RESERVOIR = $00020000; ///< Use a bit reservoir when encoding if possible - {$IF LIBAVCODEC_VERSION >= 52043000} // >= 52.43.0 - CODEC_FLAG2_MBTREE = $00040000; ///< Use macroblock tree ratecontrol (x264 only) - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52061000} // >= 52.61.0 - CODEC_FLAG2_PSY = $00080000; ///< Use psycho visual optimizations. - CODEC_FLAG2_SSIM = $00100000; ///< Compute SSIM during encoding, error[] values are undefined. - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52067000} // >= 52.67.0 - CODEC_FLAG2_INTRA_REFRESH = $00200000; ///< Use periodic insertion of intra blocks instead of keyframes. - {$IFEND} - -(* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independant Segment Decoding *) -(* /Fx *) -(* codec capabilities *) - - CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback - (** - * Codec uses get_buffer() for allocating buffers and supports custom allocators. - * If not set, it might not use get_buffer() at all or use operations that - * assume the buffer was allocated by avcodec_default_get_buffer. - *) - CODEC_CAP_DR1 = $0002; - (* if 'parse_only' field is true, then avcodec_parse_frame() can be used *) - CODEC_CAP_PARSE_ONLY = $0004; - CODEC_CAP_TRUNCATED = $0008; - (* codec can export data for HW decoding (XvMC) *) - CODEC_CAP_HWACCEL = $0010; - (** - * codec has a non zero delay and needs to be feeded with NULL at the end to get the delayed data. - * if this is not set, the codec is guranteed to never be feeded with NULL data - *) - CODEC_CAP_DELAY = $0020; - (** - * Codec can be fed a final frame with a smaller size. - * This can be used to prevent truncation of the last audio samples. - *) - CODEC_CAP_SMALL_LAST_FRAME = $0040; - - (** - * Codec can export data for HW decoding (VDPAU). - *) - CODEC_CAP_HWACCEL_VDPAU = $0080; - - {$IF LIBAVCODEC_VERSION >= 52035000} // >= 52.35.0 - (** - * Codec can output multiple frames per AVPacket - * Normally demuxers return one frame at a time, demuxers which do not do - * are connected to a parser to split what they return into proper frames. - * This flag is reserved to the very rare category of codecs which have a - * bitstream that cannot be split into frames without timeconsuming - * operations like full decoding. Demuxers carring such bitstreams thus - * may return multiple frames in a packet. This has many disadvantages like - * prohibiting stream copy in many cases thus it should only be considered - * as a last resort. - *) - CODEC_CAP_SUBFRAMES = $0100; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52071000} // >= 52.71.0 - (** - * Codec is experimental and is thus avoided in favor of non experimental - * encoders - *) - CODEC_CAP_EXPERIMENTAL = $0200; - {$IFEND} - - //the following defines may change, don't expect compatibility if you use them - MB_TYPE_INTRA4x4 = $001; - MB_TYPE_INTRA16x16 = $002; //FIXME h264 specific - MB_TYPE_INTRA_PCM = $004; //FIXME h264 specific - MB_TYPE_16x16 = $008; - MB_TYPE_16x8 = $010; - MB_TYPE_8x16 = $020; - MB_TYPE_8x8 = $040; - MB_TYPE_INTERLACED = $080; - MB_TYPE_DIRECT2 = $100; //FIXME - MB_TYPE_ACPRED = $200; - MB_TYPE_GMC = $400; - MB_TYPE_SKIP = $800; - MB_TYPE_P0L0 = $1000; - MB_TYPE_P1L0 = $2000; - MB_TYPE_P0L1 = $4000; - MB_TYPE_P1L1 = $8000; - MB_TYPE_L0 = (MB_TYPE_P0L0 or MB_TYPE_P1L0); - MB_TYPE_L1 = (MB_TYPE_P0L1 or MB_TYPE_P1L1); - MB_TYPE_L0L1 = (MB_TYPE_L0 or MB_TYPE_L1); - MB_TYPE_QUANT = $0010000; - MB_TYPE_CBP = $0020000; - //Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) - -type -(** - * Pan Scan area. - * This specifies the area which should be displayed. - * Note there may be multiple such areas for one frame. - *) - PAVPanScan = ^TAVPanScan; - TAVPanScan = record {24} - (*** id. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - id: cint; - - (*** width and height in 1/16 pel - * - encoding: set by user. - * - decoding: set by libavcodec. *) - width: cint; - height: cint; - - (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. - * - encoding: set by user. - * - decoding: set by libavcodec. *) - position: array [0..2] of array [0..1] of smallint; - end; - -const - FF_QSCALE_TYPE_MPEG1 = 0; - FF_QSCALE_TYPE_MPEG2 = 1; - FF_QSCALE_TYPE_H264 = 2; - {$IF LIBAVCODEC_VERSION >= 52049000} // >= 52.49.0 - FF_QSCALE_TYPE_VP56 = 3; - {$IFEND} - - FF_BUFFER_TYPE_INTERNAL = 1; - FF_BUFFER_TYPE_USER = 2; ///< Direct rendering buffers (image is (de)allocated by user) - FF_BUFFER_TYPE_SHARED = 4; ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared - FF_BUFFER_TYPE_COPY = 8; ///< just a (modified) copy of some other buffer, don't dealloc anything. - - - FF_I_TYPE = 1; ///< Intra - FF_P_TYPE = 2; ///< Predicted - FF_B_TYPE = 3; ///< Bi-dir predicted - FF_S_TYPE = 4; ///< S(GMC)-VOP MPEG4 - FF_SI_TYPE = 5; ///< Switching Intra - FF_SP_TYPE = 6; ///< Switching Predicted - FF_BI_TYPE = 7; - - FF_BUFFER_HINTS_VALID = $01; // Buffer hints value is meaningful (if 0 ignore) - FF_BUFFER_HINTS_READABLE = $02; // Codec will read from buffer - FF_BUFFER_HINTS_PRESERVE = $04; // User must not alter buffer content - FF_BUFFER_HINTS_REUSABLE = $08; // Codec will reuse the buffer (update) - -const - {$IF LIBAVCODEC_VERSION < 52000000} // < 52.0.0 - DEFAULT_FRAME_RATE_BASE = 1001000; - {$IFEND} - - FF_ASPECT_EXTENDED = 15; - - FF_RC_STRATEGY_XVID = 1; - - FF_BUG_AUTODETECT = 1; ///< autodetection - FF_BUG_OLD_MSMPEG4 = 2; - FF_BUG_XVID_ILACE = 4; - FF_BUG_UMP4 = 8; - FF_BUG_NO_PADDING = 16; - FF_BUG_AMV = 32; - FF_BUG_AC_VLC = 0; ///< will be removed, libavcodec can now handle these non compliant files by default - FF_BUG_QPEL_CHROMA = 64; - FF_BUG_STD_QPEL = 128; - FF_BUG_QPEL_CHROMA2 = 256; - FF_BUG_DIRECT_BLOCKSIZE = 512; - FF_BUG_EDGE = 1024; - FF_BUG_HPEL_CHROMA = 2048; - FF_BUG_DC_CLIP = 4096; - FF_BUG_MS = 8192; ///< workaround various bugs in microsofts broken decoders - {$IF LIBAVCODEC_VERSION >= 52054000} // >= 52.54.0 - FF_BUG_TRUNCATED = 16384; - {$IFEND} - //FF_BUG_FAKE_SCALABILITY = 16 //Autodetection should work 100%. - - FF_COMPLIANCE_VERY_STRICT = 2; ///< strictly conform to an older more strict version of the spec or reference software - FF_COMPLIANCE_STRICT = 1; ///< strictly conform to all the things in the spec no matter what consequences - FF_COMPLIANCE_NORMAL = 0; - {$IF LIBAVCODEC_VERSION_MAJOR < 53} // < 53 - FF_COMPLIANCE_INOFFICIAL = -1; ///< Allow inofficial extensions - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52079001} // >= 52.79.1 - FF_COMPLIANCE_UNOFFICIAL = -1; ///< Allow unofficial extensions - {$IFEND} - - FF_COMPLIANCE_EXPERIMENTAL = -2; ///< allow non standarized experimental things - - FF_ER_CAREFUL = 1; - FF_ER_COMPLIANT = 2; - FF_ER_AGGRESSIVE = 3; - FF_ER_VERY_AGGRESSIVE = 4; - - FF_DCT_AUTO = 0; - FF_DCT_FASTINT = 1; - FF_DCT_INT = 2; - FF_DCT_MMX = 3; - FF_DCT_MLIB = 4; - FF_DCT_ALTIVEC = 5; - FF_DCT_FAAN = 6; - - FF_IDCT_AUTO = 0; - FF_IDCT_INT = 1; - FF_IDCT_SIMPLE = 2; - FF_IDCT_SIMPLEMMX = 3; - FF_IDCT_LIBMPEG2MMX = 4; - FF_IDCT_PS2 = 5; - FF_IDCT_MLIB = 6; - FF_IDCT_ARM = 7; - FF_IDCT_ALTIVEC = 8; - FF_IDCT_SH4 = 9; - FF_IDCT_SIMPLEARM = 10; - FF_IDCT_H264 = 11; - FF_IDCT_VP3 = 12; - FF_IDCT_IPP = 13; - FF_IDCT_XVIDMMX = 14; - FF_IDCT_CAVS = 15; - FF_IDCT_SIMPLEARMV5TE= 16; - FF_IDCT_SIMPLEARMV6 = 17; - FF_IDCT_SIMPLEVIS = 18; - FF_IDCT_WMV2 = 19; - FF_IDCT_FAAN = 20; - FF_IDCT_EA = 21; - FF_IDCT_SIMPLENEON = 22; - FF_IDCT_SIMPLEALPHA = 23; - {$IF LIBAVCODEC_VERSION >= 52055000} // >= 52.55.0 - FF_IDCT_BINK = 24; - {$IFEND} - - FF_EC_GUESS_MVS = 1; - FF_EC_DEBLOCK = 2; - - FF_MM_FORCE = $80000000; (* force usage of selected flags (OR) *) - (* lower 16 bits - CPU features *) - FF_MM_MMX = $0001; ///< standard MMX - FF_MM_3DNOW = $0004; ///< AMD 3DNOW - {$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} - FF_MM_MMXEXT = $0002; ///< SSE integer functions or AMD MMX ext - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52024000} // >= 52.24.0 - FF_MM_MMX2 = $0002; ///< SSE integer functions or AMD MMX ext - {$IFEND} - FF_MM_SSE = $0008; ///< SSE functions - FF_MM_SSE2 = $0010; ///< PIV SSE2 functions - {$IF LIBAVCODEC_VERSION >= 52084000} // >= 52.84.0 - FF_MM_SSE2SLOW = $40000000; ///< SSE2 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - {$IFEND} - FF_MM_3DNOWEXT = $0020; ///< AMD 3DNowExt - FF_MM_SSE3 = $0040; ///< Prescott SSE3 functions - {$IF LIBAVCODEC_VERSION >= 52084000} // >= 52.84.0 - FF_MM_SSE3SLOW = $20000000; ///< SSE3 supported, but usually not faster - ///< than regular MMX/SSE (e.g. Core1) - {$IFEND} - FF_MM_SSSE3 = $0080; ///< Conroe SSSE3 functions - {$IF LIBAVCODEC_VERSION >= 52022003} // >= 52.22.3 - FF_MM_SSE4 = $0100; ///< Penryn SSE4.1 functions - FF_MM_SSE42 = $0200; ///< Nehalem SSE4.2 functions - {$IFEND} - FF_MM_IWMMXT = $0100; ///< XScale IWMMXT - FF_MM_ALTIVEC = $0001; ///< standard AltiVec - - FF_PRED_LEFT = 0; - FF_PRED_PLANE = 1; - FF_PRED_MEDIAN = 2; - - FF_DEBUG_PICT_INFO = 1; - FF_DEBUG_RC = 2; - FF_DEBUG_BITSTREAM = 4; - FF_DEBUG_MB_TYPE = 8; - FF_DEBUG_QP = 16; - FF_DEBUG_MV = 32; - FF_DEBUG_DCT_COEFF = $00000040; - FF_DEBUG_SKIP = $00000080; - FF_DEBUG_STARTCODE = $00000100; - FF_DEBUG_PTS = $00000200; - FF_DEBUG_ER = $00000400; - FF_DEBUG_MMCO = $00000800; - FF_DEBUG_BUGS = $00001000; - FF_DEBUG_VIS_QP = $00002000; - FF_DEBUG_VIS_MB_TYPE = $00004000; - FF_DEBUG_BUFFERS = $00008000; - - FF_DEBUG_VIS_MV_P_FOR = $00000001; //visualize forward predicted MVs of P frames - FF_DEBUG_VIS_MV_B_FOR = $00000002; //visualize forward predicted MVs of B frames - FF_DEBUG_VIS_MV_B_BACK = $00000004; //visualize backward predicted MVs of B frames - - FF_CMP_SAD = 0; - FF_CMP_SSE = 1; - FF_CMP_SATD = 2; - FF_CMP_DCT = 3; - FF_CMP_PSNR = 4; - FF_CMP_BIT = 5; - FF_CMP_RD = 6; - FF_CMP_ZERO = 7; - FF_CMP_VSAD = 8; - FF_CMP_VSSE = 9; - FF_CMP_NSSE = 10; - FF_CMP_W53 = 11; - FF_CMP_W97 = 12; - FF_CMP_DCTMAX = 13; - FF_CMP_DCT264 = 14; - FF_CMP_CHROMA = 256; - - FF_DTG_AFD_SAME = 8; - FF_DTG_AFD_4_3 = 9; - FF_DTG_AFD_16_9 = 10; - FF_DTG_AFD_14_9 = 11; - FF_DTG_AFD_4_3_SP_14_9 = 13; - FF_DTG_AFD_16_9_SP_14_9 = 14; - FF_DTG_AFD_SP_4_3 = 15; - - FF_DEFAULT_QUANT_BIAS = 999999; - - FF_LAMBDA_SHIFT = 7; - FF_LAMBDA_SCALE = (1 shl FF_LAMBDA_SHIFT); - FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda - FF_LAMBDA_MAX = (256 * 128 - 1); - - FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove - - FF_CODER_TYPE_VLC = 0; - FF_CODER_TYPE_AC = 1; - FF_CODER_TYPE_RAW = 2; - FF_CODER_TYPE_RLE = 3; - FF_CODER_TYPE_DEFLATE = 4; - - SLICE_FLAG_CODED_ORDER = $0001; ///< draw_horiz_band() is called in coded order instead of display - SLICE_FLAG_ALLOW_FIELD = $0002; ///< allow draw_horiz_band() with field slices (MPEG2 field pics) - SLICE_FLAG_ALLOW_PLANE = $0004; ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - - FF_MB_DECISION_SIMPLE = 0; ///< uses mb_cmp - FF_MB_DECISION_BITS = 1; ///< chooses the one which needs the fewest bits - FF_MB_DECISION_RD = 2; ///< rate distortion - - FF_AA_AUTO = 0; - FF_AA_FASTINT = 1; //not implemented yet - FF_AA_INT = 2; - FF_AA_FLOAT = 3; - - FF_PROFILE_UNKNOWN = -99; - FF_PROFILE_AAC_MAIN = 0; - FF_PROFILE_AAC_LOW = 1; - FF_PROFILE_AAC_SSR = 2; - FF_PROFILE_AAC_LTP = 3; - - FF_LEVEL_UNKNOWN = -99; - - X264_PART_I4X4 = $001; (* Analyse i4x4 *) - X264_PART_I8X8 = $002; (* Analyse i8x8 (requires 8x8 transform) *) - X264_PART_P8X8 = $010; (* Analyse p16x8, p8x16 and p8x8 *) - X264_PART_P4X4 = $020; (* Analyse p8x4, p4x8, p4x4 *) - X264_PART_B8X8 = $100; (* Analyse b16x8, b8x16 and b8x8 *) - - FF_COMPRESSION_DEFAULT = -1; - -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} -const - AVPALETTE_SIZE = 1024; - AVPALETTE_COUNT = 256; - -type -(** - * AVPaletteControl - * This structure defines a method for communicating palette changes - * between and demuxer and a decoder. - * - * @deprecated Use AVPacket to send palette changes instead. - * This is totally broken. - *) - PAVPaletteControl = ^TAVPaletteControl; - TAVPaletteControl = record - (* demuxer sets this to 1 to indicate the palette has changed; - * decoder resets to 0 *) - palette_changed: cint; - - (* 4-byte ARGB palette entries, stored in native byte order; note that - * the individual palette components should be on a 8-bit scale; if - * the palette data comes from a IBM VGA native format, the component - * data is probably 6 bits in size and needs to be scaled *) - palette: array [0..AVPALETTE_COUNT - 1] of cuint; - end; {deprecated;} -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52023000} // >= 52.23.0 -type - PAVPacket = ^TAVPacket; - TAVPacket = record -(* - * Presentation timestamp in AVStream->time_base units; the time at which - * the decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation cannot happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; -(* - * Decompression timestamp in AVStream->time_base units; the time at which - * the packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - flags: cint; -(* - * Duration of this packet in AVStream->time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (para1: PAVPacket); cdecl; - priv: pointer; - pos: cint64; // byte position in stream, -1 if unknown - -(* - * Time difference in AVStream->time_base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - end; - -const - {$IF LIBAVCODEC_VERSION < 52030002} // < 52.30.2 - PKT_FLAG_KEY = $0001; - {$ELSE} - AV_PKT_FLAG_KEY = $0001; - {$IF LIBAVCODEC_VERSION_MAJOR < 53} - PKT_FLAG_KEY = AV_PKT_FLAG_KEY; - {$IFEND} - {$IFEND} -{$IFEND} - -type - PAVClass = ^TAVClass; {const} - PAVCodecContext = ^TAVCodecContext; - - PAVCodec = ^TAVCodec; - -{$IF LIBAVCODEC_VERSION >= 52018000} // >= 52.18.0 - PAVHWAccel = ^TAVHWAccel; -{$IFEND} - - // int[4] - PQuadIntArray = ^TQuadIntArray; - TQuadIntArray = array [0..3] of cint; - // int (*func)(struct AVCodecContext *c2, void *arg) - TExecuteFunc = function(c2: PAVCodecContext; arg: Pointer): cint; cdecl; -{$IF LIBAVCODEC_VERSION >= 52037000} // >= 52.37.0 - // int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr) - TExecute2Func = function(c2: PAVCodecContext; arg: Pointer; jobnr: cint; threadnr: cint): cint; cdecl; -{$IFEND} - - TAVClass = record - class_name: PAnsiChar; - (* actually passing a pointer to an AVCodecContext - or AVFormatContext, which begin with an AVClass. - Needed because av_log is in libavcodec and has no visibility - of AVIn/OutputFormat *) - item_name: function(ctx: pointer): PAnsiChar; cdecl; - option: PAVOption; - -{$IF LIBAVUTIL_VERSION >= 50015000} // 50.15.0 - (** - * LIBAVUTIL_VERSION with which this structure was created. - * This is used to allow fields to be added without requiring major - * version bumps everywhere. - *) - version: cint; -{$IFEND} - -{$IF LIBAVUTIL_VERSION >= 50015002} // 50.15.2 - (** - * Offset in the structure where log_level_offset is stored. - * 0 means there is no such variable - *) - log_level_offset_offset: cint; -{$IFEND} - -{$IF LIBAVUTIL_VERSION >= 50015003} // 50.15.3 - (** - * Offset in the structure where a pointer to the parent context for loging is stored. - * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such - * parent context. And a av_log() implementation could then display the parent context - * can be NULL of course - *) - parent_log_context_offset: cint; -{$IFEND} - end; - - {** - * Audio Video Frame. - * New fields can be added to the end of FF_COMMON_FRAME with minor version - * bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. No fields should be added into AVFrame before or after - * FF_COMMON_FRAME! - * sizeof(AVFrame) must not be used outside libav*. - *} - PAVFrame = ^TAVFrame; - TAVFrame = record {200} - (** - * pointer to the picture planes. - * This might be different from the first allocated byte - * - encoding: - * - decoding: - *) - data: array [0..3] of pbyte; - linesize: array [0..3] of cint; - (** - * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer. - * This isn't used by libavcodec unless the default get/release_buffer() is used. - * - encoding: - * - decoding: - *) - base: array [0..3] of pbyte; - (** - * 1 -> keyframe, 0-> not - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - key_frame: cint; - (** - * Picture type of the frame, see ?_TYPE below. - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - pict_type: cint; - (** - * presentation timestamp in time_base units (time when frame should be shown to user) - * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - pts: cint64; - (** - * picture number in bitstream order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - coded_picture_number: cint; - (** - * picture number in display order - * - encoding: set by - * - decoding: Set by libavcodec. - *) - display_picture_number: cint; - (** - * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) - * - encoding: Set by libavcodec. for coded_picture (and set by user for input). - * - decoding: Set by libavcodec. - *) - quality: cint; - (** - * buffer age (1->was last buffer and dint change, 2->..., ...). - * Set to INT_MAX if the buffer has not been used yet. - * - encoding: unused - * - decoding: MUST be set by get_buffer(). - *) - age: cint; - (** - * is this picture used as reference - * The values for this are the same as the MpegEncContext.picture_structure - * variable, that is 1->top field, 2->bottom field, 3->frame/both fields. - * Set to 4 for delayed, non-reference frames. - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - reference: cint; - (** - * QP table - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qscale_table: PShortint; - (** - * QP store stride - * - encoding: unused - * - decoding: Set by libavcodec. - *) - qstride: cint; - (** - * mbskip_table[mb]>=1 if MB didn't change - * stride= mb_width = (width+15)>>4 - * - encoding: unused - * - decoding: Set by libavcodec. - *) - mbskip_table: pbyte; - (** - * motion vector table - * @code - * example: - * int mv_sample_log2= 4 - motion_subsample_log2; - * int mb_width= (width+15)>>4; - * int mv_stride= (mb_width << mv_sample_log2) + 1; - * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; - * @endcode - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - //int16_t (*motion_val[2])[2]; - motion_val: array [0..1] of pointer; - (** - * macroblock type table - * mb_type_base + mb_width + 2 - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - mb_type: PCuint; - (** - * log2 of the size of the block which a single vector in motion_val represents: - * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - motion_subsample_log2: byte; - (** - * for some private data of the user - * - encoding: unused - * - decoding: Set by user. - *) - opaque: pointer; - (** - * error - * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..3] of cuint64; - (** - * type of the buffer (to keep track of who has to deallocate data[*]) - * - encoding: Set by the one who allocates it. - * - decoding: Set by the one who allocates it. - * Note: User allocated (direct rendering) & internal buffers cannot coexist currently. - *) - type_: cint; - (** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) - * - encoding: unused - * - decoding: Set by libavcodec. - *) - repeat_pict: cint; - (** - * - *) - qscale_type: cint; - (** - * The content of the picture is interlaced. - * - encoding: Set by user. - * - decoding: Set by libavcodec. (default 0) - *) - interlaced_frame: cint; - (** - * If the content is interlaced, is top field displayed first. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - top_field_first: cint; - (** - * Pan scan. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - pan_scan: PAVPanScan; - (** - * Tell user application that palette has changed from previous frame. - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by libavcodec. (default 0). - *) - palette_has_changed: cint; - (** - * codec suggestion on buffer type if != 0 - * - encoding: unused - * - decoding: Set by libavcodec. (before get_buffer() call)). - *) - buffer_hints: cint; - (** - * DCT coefficients - * - encoding: unused - * - decoding: Set by libavcodec. - *) - dct_coeff: PsmallInt; - (** - * motion reference frame index - * the order in which these are stored can depend on the codec. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - ref_index: array [0..1] of PShortint; - - {$IF LIBAVCODEC_VERSION >= 51068000} // >= 51.68.0 - (** - * reordered opaque 64bit number (generally a PTS) from AVCodecContext.reordered_opaque - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Read by user. - *) - reordered_opaque: cint64; - {$IFEND} - - {$IF LIBAVCODEC_VERSION = 52021000} // = 52.21.0 - (** - * hardware accelerator private data (FFmpeg allocated) - * - encoding: unused - * - decoding: Set by libavcodec - *) - hwaccel_data_private: pointer; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52022000} // >= 52.22.0 - hwaccel_picture_private: pointer; - {$IFEND} - - end; - - (** - * main external API structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVCodecContext) must not be used outside libav*. - *) - TAVCodecContext = record {720} - (** - * information on struct for av_log - * - set by avcodec_alloc_context - *) - av_class: PAVClass; - (** - * the average bitrate - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. - *) - bit_rate: cint; - - (** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - *) - bit_rate_tolerance: cint; - - (** - * CODEC_FLAG_*. - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags: cint; - - (** - * Some codecs need additional format info. It is stored here. - * If any muxer uses this then ALL demuxers/parsers AND encoders for the - * specific codec MUST set it correctly otherwise stream copy breaks. - * In general use of this field by muxers is not recommanded. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. (FIXME: Is this OK?) - *) - sub_id: cint; - - (** - * Motion estimation algorithm used for video coding. - * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), - * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] - * - encoding: MUST be set by user. - * - decoding: unused - *) - me_method: cint; - - (** - * some codecs need / can use extradata like Huffman tables. - * mjpeg: Huffman tables - * rv10: additional flags - * mpeg4: global headers (they can be in the bitstream or here) - * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger - * than extradata_size to avoid prolems if it is read with the bitstream reader. - * The bytewise contents of extradata must not depend on the architecture or CPU endianness. - * - encoding: Set/allocated/freed by libavcodec. - * - decoding: Set/allocated/freed by user. - *) - extradata: pbyte; - extradata_size: cint; - - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identically 1. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - *) - time_base: TAVRational; - - (* video only *) - (** - * picture width / height. - * - encoding: MUST be set by user. - * - decoding: Set by libavcodec. - * Note: For compatibility it is possible to set this instead of - * coded_width/height before decoding. - *) - width, height: cint; - - (** - * the number of pictures in a group of pictures, or 0 for intra_only - * - encoding: Set by user. - * - decoding: unused - *) - gop_size: cint; - - (** - * Pixel format, see PIX_FMT_xxx. - * May be set by the demuxer if known from headers. - * May be overriden by the decoder if it knows better. - * - encoding: Set by user. - * - decoding: Set by user if known, overridden by libavcodec if known - *) - pix_fmt: TAVPixelFormat; - - (** - * Frame rate emulation. If not zero, the lower layer (i.e. format handler) - * has to read frames at native frame rate. - * - encoding: Set by user. - * - decoding: unused - *) - rate_emu: cint; - - (** - * If non NULL, 'draw_horiz_band' is called by the libavcodec - * decoder to draw a horizontal band. It improves cache usage. Not - * all codecs can do that. You must check the codec capabilities - * beforehand. - * The function is also used by hardware acceleration APIs. - * It is called at least once during frame decoding to pass - * the data needed for hardware render. - * In that mode instead of pixel data, AVFrame points to - * a structure specific to the acceleration API. The application - * reads the structure and can change some fields to indicate progress - * or mark state. - * - encoding: unused - * - decoding: Set by user. - * @param height the height of the slice - * @param y the y position of the slice - * @param type 1->top field, 2->bottom field, 3->frame - * @param offset offset into the AVFrame.data from which the slice should be read - *) - draw_horiz_band: procedure (s: PAVCodecContext; - src: {const} PAVFrame; offset: PQuadIntArray; - y: cint; type_: cint; height: cint); cdecl; - - (* audio only *) - sample_rate: cint; ///< samples per second - channels: cint; ///< number of audio channels - - (** - * audio sample format - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_fmt: TAVSampleFormat; ///< sample format - - (* The following data should not be initialized. *) - (** - * Samples per packet, initialized when calling 'init'. - *) - frame_size: cint; - frame_number: cint; ///< audio or video frame number -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} - real_pict_num: cint; ///< returns the real picture number of previous encoded frame -{$IFEND} - - (** - * Number of frames the decoded output will be delayed relative to - * the encoded input. - * - encoding: Set by libavcodec. - * - decoding: unused - *) - delay: cint; - - (* - encoding parameters *) - qcompress: cfloat; ///< amount of qscale change between easy & hard scenes (0.0-1.0) - qblur: cfloat; ///< amount of qscale smoothing over time (0.0-1.0) - - (** - * minimum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmin: cint; - - (** - * maximum quantizer - * - encoding: Set by user. - * - decoding: unused - *) - qmax: cint; - - (** - * maximum quantizer difference between frames - * - encoding: Set by user. - * - decoding: unused - *) - max_qdiff: cint; - - (** - * maximum number of B-frames between non-B-frames - * Note: The output will be delayed by max_b_frames+1 relative to the input. - * - encoding: Set by user. - * - decoding: unused - *) - max_b_frames: cint; - - (** - * qscale factor between IP and B-frames - * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_factor: cfloat; - - (** obsolete FIXME remove *) - rc_strategy: cint; - - b_frame_strategy: cint; - - (** - * hurry up amount - * - encoding: unused - * - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header - * @deprecated Deprecated in favor of skip_idct and skip_frame. - *) - hurry_up: cint; - - codec: PAVCodec; - - priv_data: pointer; - - {$IF LIBAVCODEC_VERSION < 52000000} // 52.0.0 - (* unused, FIXME remove*) - rtp_mode: cint; - {$IFEND} - - rtp_payload_size: cint; (* The size of the RTP payload: the coder will *) - (* do it's best to deliver a chunk with size *) - (* below rtp_payload_size, the chunk will start *) - (* with a start code on some codecs like H.263 *) - (* This doesn't take account of any particular *) - (* headers inside the transmited RTP payload *) - - - (* The RTP callback: This function is called *) - (* every time the encoder has a packet to send *) - (* Depends on the encoder if the data starts *) - (* with a Start Code (it should) H.263 does. *) - (* mb_nb contains the number of macroblocks *) - (* encoded in the RTP payload *) - rtp_callback: procedure (avctx: PAVCodecContext; data: pointer; - size: cint; mb_nb: cint); cdecl; - - (* statistics, used for 2-pass encoding *) - mv_bits: cint; - header_bits: cint; - i_tex_bits: cint; - p_tex_bits: cint; - i_count: cint; - p_count: cint; - skip_count: cint; - misc_bits: cint; - - (** - * number of bits used for the previously encoded frame - * - encoding: Set by libavcodec. - * - decoding: unused - *) - frame_bits: cint; - - (** - * Private data of the user, can be used to carry app specific stuff. - * - encoding: Set by user. - * - decoding: Set by user. - *) - opaque: pointer; - - codec_name: array [0..31] of AnsiChar; -{$IF LIBAVCODEC_VERSION < 52064000} // < 52.64.0 - codec_type: TCodecType; (* see CODEC_TYPE_xxx *) -{$ELSE} - codec_type: TAVMediaType; (* see AVMEDIA_TYPE_xxx *) -{$IFEND} - codec_id: TCodecID; (* see CODEC_ID_xxx *) - - (** - * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * A demuxer should set this to what is stored in the field used to identify the codec. - * If there are multiple such fields in a container then the demuxer should choose the one - * which maximizes the information about the used codec. - * If the codec tag field in a container is larger then 32 bits then the demuxer should - * remap the longer ID to 32 bits with a table or other structure. Alternatively a new - * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated - * first. - * - encoding: Set by user, if not then the default based on codec_id will be used. - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - codec_tag: cuint; - - (** - * Work around bugs in encoders which sometimes cannot be detected automatically. - * - encoding: Set by user - * - decoding: Set by user - *) - workaround_bugs: cint; - - (** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - luma_elim_threshold: cint; - - (** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - *) - chroma_elim_threshold: cint; - - (** - * strictly follow the standard (MPEG4, ...). - * - encoding: Set by user. - * - decoding: Set by user. - * Setting this to STRICT or higher means the encoder and decoder will - * generally do stupid things, whereas setting it to unofficial or lower - * will mean the encoder might produce output that is not supported by all - * spec-compliant decoders. Decoders don't differentiate between normal, - * unofficial and experimental (that is, they always try to decode things - * when they can) unless they are explicitly asked to behave stupidly - * (=strictly conform to the specs) - *) - strict_std_compliance: cint; - - (** - * qscale offset between IP and B-frames - * - encoding: Set by user. - * - decoding: unused - *) - b_quant_offset: cfloat; - - (** - * Error recognization; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - *) - error_recognition: cint; - - (** - * Called at the beginning of each frame to get a buffer for it. - * If pic.reference is set then the frame will be read later by libavcodec. - * avcodec_align_dimensions2() should be used to find the required width and - * height, as they normally need to be rounded up to the next multiple of 16. - * if CODEC_CAP_DR1 is not set then get_buffer() must call - * avcodec_default_get_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - get_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Called to release buffers which were allocated with get_buffer. - * A released buffer can be reused in get_buffer(). - * pic.data[*] must be set to NULL. - * - encoding: unused - * - decoding: Set by libavcodec, user can override. - *) - release_buffer: procedure (c: PAVCodecContext; pic: PAVFrame); cdecl; - - (** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - has_b_frames: cint; - - (** - * number of bytes per packet if constant and known or 0 - * Used by some WAV based audio codecs. - *) - block_align: cint; - - parse_only: cint; (* - decoding only: if true, only parsing is done - (function avcodec_parse_frame()). The frame - data is returned. Only MPEG codecs support this now. *) - - (** - * 0-> h263 quant 1-> mpeg quant - * - encoding: Set by user. - * - decoding: unused - *) - mpeg_quant: cint; - - (** - * pass1 encoding statistics output buffer - * - encoding: Set by libavcodec. - * - decoding: unused - *) - stats_out: PByteArray; - - (** - * pass2 encoding statistics input buffer - * Concatenated stuff from stats_out of pass1 should be placed here. - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - stats_in: PByteArray; - - (** - * ratecontrol qmin qmax limiting method - * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax. - * - encoding: Set by user. - * - decoding: unused - *) - rc_qsquish: cfloat; - - rc_qmod_amp: cfloat; - rc_qmod_freq: cint; - - (** - * ratecontrol override, see RcOverride - * - encoding: Allocated/set/freed by user. - * - decoding: unused - *) - rc_override: PRcOverride; - rc_override_count: cint; - - (** - * rate control equation - * - encoding: Set by user - * - decoding: unused - *) - rc_eq: {const} PByteArray; - - (** - * maximum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_max_rate: cint; - - (** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - *) - rc_min_rate: cint; - - (** - * decoder bitstream buffer size - * - encoding: Set by user. - * - decoding: unused - *) - rc_buffer_size: cint; - rc_buffer_aggressivity: cfloat; - - (** - * qscale factor between P and I-frames - * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). - * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_factor: cfloat; - - (** - * qscale offset between P and I-frames - * - encoding: Set by user. - * - decoding: unused - *) - i_quant_offset: cfloat; - - (** - * initial complexity for pass1 ratecontrol - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_cplx: cfloat; - - (** - * DCT algorithm, see FF_DCT_* below - * - encoding: Set by user. - * - decoding: unused - *) - dct_algo: cint; - - (** - * luminance masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - lumi_masking: cfloat; - - (** - * temporary complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - temporal_cplx_masking: cfloat; - - (** - * spatial complexity masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - spatial_cplx_masking: cfloat; - - (** - * p block masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - p_masking: cfloat; - - (** - * darkness masking (0-> disabled) - * - encoding: Set by user. - * - decoding: unused - *) - dark_masking: cfloat; - - {$IF LIBAVCODEC_VERSION < 52000000} // 52.0.0 - (* for binary compatibility *) - unused: cint; - {$IFEND} - - (** - * IDCT algorithm, see FF_IDCT_* below. - * - encoding: Set by user. - * - decoding: Set by user. - *) - idct_algo: cint; - - (** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - *) - slice_count: cint; - - (** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - *) - slice_offset: PCint; - - (** - * error concealment flags - * - encoding: unused - * - decoding: Set by user. - *) - error_concealment: cint; - - (** - * dsp_mask could be add used to disable unwanted CPU features - * CPU features (i.e. MMX, SSE. ...) - * - * With the FORCE flag you may instead enable given CPU features. - * (Dangerous: Usable in case of misdetection, improper usage however will - * result into program crash.) - *) - dsp_mask: cuint; - - (** - * bits per sample/pixel from the demuxer (needed for huffyuv). - * - encoding: Set by libavcodec. - * - decoding: Set by user. - *) - bits_per_coded_sample: cint; - - (** - * prediction method (needed for huffyuv) - * - encoding: Set by user. - * - decoding: unused - *) - prediction_method: cint; - - (** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - sample_aspect_ratio: TAVRational; - - (** - * the picture in the bitstream - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - *) - coded_frame: PAVFrame; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug: cint; - - (** - * debug - * - encoding: Set by user. - * - decoding: Set by user. - *) - debug_mv: cint; - - (** - * error - * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. - * - decoding: unused - *) - error: array [0..3] of cuint64; - - (** - * minimum MB quantizer - * - encoding: unused - * - decoding: unused - *) - mb_qmin: cint; - - (** - * maximum MB quantizer - * - encoding: unused - * - decoding: unused - *) - mb_qmax: cint; - - (** - * motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_cmp: cint; - - (** - * subpixel motion estimation comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_sub_cmp: cint; - (** - * macroblock comparison function (not supported yet) - * - encoding: Set by user. - * - decoding: unused - *) - mb_cmp: cint; - (** - * interlaced DCT comparison function - * - encoding: Set by user. - * - decoding: unused - *) - ildct_cmp: cint; - - (** - * ME diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - dia_size: cint; - - (** - * amount of previous MV predictors (2a+1 x 2a+1 square) - * - encoding: Set by user. - * - decoding: unused - *) - last_predictor_count: cint; - - (** - * prepass for motion estimation - * - encoding: Set by user. - * - decoding: unused - *) - pre_me: cint; - - (** - * motion estimation prepass comparison function - * - encoding: Set by user. - * - decoding: unused - *) - me_pre_cmp: cint; - - (** - * ME prepass diamond size & shape - * - encoding: Set by user. - * - decoding: unused - *) - pre_dia_size: cint; - - (** - * subpel ME quality - * - encoding: Set by user. - * - decoding: unused - *) - me_subpel_quality: cint; - - (** - * callback to negotiate the pixelFormat - * @param fmt is the list of formats which are supported by the codec, - * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. - * The first is always the native one. - * @return the chosen format - * - encoding: unused - * - decoding: Set by user, if not set the native format will be chosen. - *) - get_format: function (s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; - - (** - * DTG active format information (additional aspect ratio - * information only used in DVB MPEG-2 transport streams) - * 0 if not set. - * - * - encoding: unused - * - decoding: Set by decoder. - *) - dtg_active_format: cint; - - (** - * maximum motion estimation search range in subpel units - * If 0 then no limit. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_range: cint; - - (** - * intra quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - intra_quant_bias: cint; - - (** - * inter quantizer bias - * - encoding: Set by user. - * - decoding: unused - *) - inter_quant_bias: cint; - - (** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - *) - color_table_id: cint; - - (** - * internal_buffer count - * Don't touch, used by libavcodec default_get_buffer(). - *) - internal_buffer_count: cint; - - (** - * internal_buffers - * Don't touch, used by libavcodec default_get_buffer(). - *) - internal_buffer: pointer; - - (** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - *) - global_quality: cint; - - (** - * coder type - * - encoding: Set by user. - * - decoding: unused - *) - coder_type: cint; - - (** - * context model - * - encoding: Set by user. - * - decoding: unused - *) - context_model: cint; - - { - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - realloc: function (s: PAVCodecContext; buf: Pbyte; buf_size: cint): Pbyte; cdecl; - } - - (** - * slice flags - * - encoding: unused - * - decoding: Set by user. - *) - slice_flags: cint; - - (** - * XVideo Motion Acceleration - * - encoding: forbidden - * - decoding: set by decoder - *) - xvmc_acceleration: cint; - - (** - * macroblock decision mode - * - encoding: Set by user. - * - decoding: unused - *) - mb_decision: cint; - - (** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - intra_matrix: PWord; - - (** - * custom inter quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: Set by libavcodec. - *) - inter_matrix: PWord; - - (** - * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). - * This is used to work around some encoder bugs. - * - encoding: unused - * - decoding: Set by user, will be converted to uppercase by libavcodec during init. - *) - stream_codec_tag: array [0..3] of AnsiChar; //cuint; - - (** - * scene change detection threshold - * 0 is default, larger means fewer detected scene changes. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_threshold: cint; - - (** - * minimum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmin: cint; - - (** - * maximum Lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - lmax: cint; - - (** - * palette control structure - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by user. - *) - palctrl: PAVPaletteControl; - - (** - * noise reduction strength - * - encoding: Set by user. - * - decoding: unused - *) - noise_reduction: cint; - - (** - * Called at the beginning of a frame to get cr buffer for it. - * Buffer type (size, hints) must be the same. libavcodec won't check it. - * libavcodec will pass previous buffer in pic, function should return - * same buffer or new buffer with old frame "painted" into it. - * If pic.data[0] == NULL must behave like get_buffer(). - * if CODEC_CAP_DR1 is not set then reget_buffer() must call - * avcodec_default_reget_buffer() instead of providing buffers allocated by - * some other means. - * - encoding: unused - * - decoding: Set by libavcodec, user can override - *) - reget_buffer: function (c: PAVCodecContext; pic: PAVFrame): cint; cdecl; - - (** - * Number of bits which should be loaded into the rc buffer before decoding starts. - * - encoding: Set by user. - * - decoding: unused - *) - rc_initial_buffer_occupancy: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - inter_threshold: cint; - - (** - * CODEC_FLAG2_* - * - encoding: Set by user. - * - decoding: Set by user. - *) - flags2: cint; - - (** - * Simulates errors in the bitstream to test error concealment. - * - encoding: Set by user. - * - decoding: unused - *) - error_rate: cint; - - (** - * MP3 antialias algorithm, see FF_AA_* below. - * - encoding: unused - * - decoding: Set by user. - *) - antialias_algo: cint; - - (** - * quantizer noise shaping - * - encoding: Set by user. - * - decoding: unused - *) - quantizer_noise_shaping: cint; - - (** - * thread count - * is used to decide how many independent tasks should be passed to execute() - * - encoding: Set by user. - * - decoding: Set by user. - *) - thread_count: cint; - - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * @param count the number of things to execute - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - {$IF LIBAVCODEC_VERSION < 52004000} // < 52.4.0 - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: PPointer; ret: PCint; count: cint): cint; cdecl; - {$ELSE} - execute: function (c: PAVCodecContext; func: TExecuteFunc; arg: Pointer; ret: PCint; count: cint; size: cint): cint; cdecl; - {$IFEND} - - (** - * thread opaque - * Can be used by execute() to store some per AVCodecContext stuff. - * - encoding: set by execute() - * - decoding: set by execute() - *) - thread_opaque: pointer; - - (** - * Motion estimation threshold below which no motion estimation is - * performed, but instead the user specified motion vectors are used. - * - * - encoding: Set by user. - * - decoding: unused - *) - me_threshold: cint; - - (** - * Macroblock threshold below which the user specified macroblock types will be used. - * - encoding: Set by user. - * - decoding: unused - *) - mb_threshold: cint; - - (** - * precision of the intra DC coefficient - 8 - * - encoding: Set by user. - * - decoding: unused - *) - intra_dc_precision: cint; - - (** - * noise vs. sse weight for the nsse comparsion function - * - encoding: Set by user. - * - decoding: unused - *) - nsse_weight: cint; - - (** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_top: cint; - - (** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - *) - skip_bottom: cint; - - (** - * profile - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - profile: cint; - - (** - * level - * - encoding: Set by user. - * - decoding: Set by libavcodec. - *) - level: cint; - - (** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - *) - lowres: cint; - - (** - * Bitstream width / height, may be different from width/height if lowres - * or other things are used. - * - encoding: unused - * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. - *) - coded_width, coded_height: cint; - - (** - * frame skip threshold - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_threshold: cint; - - (** - * frame skip factor - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_factor: cint; - - (** - * frame skip exponent - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_exp: cint; - - (** - * frame skip comparison function - * - encoding: Set by user. - * - decoding: unused - *) - frame_skip_cmp: cint; - - (** - * Border processing masking, raises the quantizer for mbs on the borders - * of the picture. - * - encoding: Set by user. - * - decoding: unused - *) - border_masking: cfloat; - - (** - * minimum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmin: cint; - - (** - * maximum MB lagrange multipler - * - encoding: Set by user. - * - decoding: unused - *) - mb_lmax: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - me_penalty_compensation: cint; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_loop_filter: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_idct: TAVDiscard; - - (** - * - * - encoding: unused - * - decoding: Set by user. - *) - skip_frame: TAVDiscard; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - bidir_refine: cint; - - (** - * - * - encoding: Set by user. - * - decoding: unused - *) - brd_scale: cint; - - (** - * constant rate factor - quality-based VBR - values ~correspond to qps - * - encoding: Set by user. - * - decoding: unused - *) - {$IF LIBAVCODEC_VERSION >= 51021000} // 51.21.0 - crf: cfloat; - {$ELSE} - crf: cint; - {$IFEND} - - (** - * constant quantization parameter rate control method - * - encoding: Set by user. - * - decoding: unused - *) - cqp: cint; - - (** - * minimum GOP size - * - encoding: Set by user. - * - decoding: unused - *) - keyint_min: cint; - - (** - * number of reference frames - * - encoding: Set by user. - * - decoding: Set by lavc. - *) - refs: cint; - - (** - * chroma qp offset from luma - * - encoding: Set by user. - * - decoding: unused - *) - chromaoffset: cint; - - (** - * Influences how often B-frames are used. - * - encoding: Set by user. - * - decoding: unused - *) - bframebias: cint; - - (** - * trellis RD quantization - * - encoding: Set by user. - * - decoding: unused - *) - trellis: cint; - - (** - * Reduce fluctuations in qp (before curve compression). - * - encoding: Set by user. - * - decoding: unused - *) - complexityblur: cfloat; - - (** - * in-loop deblocking filter alphac0 parameter - * alpha is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockalpha: cint; - - (** - * in-loop deblocking filter beta parameter - * beta is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - *) - deblockbeta: cint; - - (** - * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4 - * - encoding: Set by user. - * - decoding: unused - *) - partitions: cint; - - (** - * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto) - * - encoding: Set by user. - * - decoding: unused - *) - directpred: cint; - - (** - * Audio cutoff bandwidth (0 means "automatic") - * - encoding: Set by user. - * - decoding: unused - *) - cutoff: cint; - - (** - * Multiplied by qscale for each frame and added to scene_change_score. - * - encoding: Set by user. - * - decoding: unused - *) - scenechange_factor: cint; - - (** - * - * Note: Value depends upon the compare function used for fullpel ME. - * - encoding: Set by user. - * - decoding: unused - *) - mv0_threshold: cint; - - (** - * Adjusts sensitivity of b_frame_strategy 1. - * - encoding: Set by user. - * - decoding: unused - *) - b_sensitivity: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - compression_level: cint; - - {$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} - (** - * Sets whether to use LPC mode - used by FLAC encoder. - * - encoding: Set by user. - * - decoding: unused - * @deprecated Deprecated in favor of lpc_type and lpc_passes. - *) - use_lpc: cint; - {$IFEND} - - (** - * LPC coefficient precision - used by FLAC encoder - * - encoding: Set by user. - * - decoding: unused - *) - lpc_coeff_precision: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_prediction_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_prediction_order: cint; - - (** - * search method for selecting prediction order - * - encoding: Set by user. - * - decoding: unused - *) - prediction_order_method: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - min_partition_order: cint; - - (** - * - encoding: Set by user. - * - decoding: unused - *) - max_partition_order: cint; - - {$IF LIBAVCODEC_VERSION >= 51026000} // 51.26.0 - (** - * GOP timecode frame start number, in non drop frame format - * - encoding: Set by user. - * - decoding: unused - *) - timecode_frame_start: cint64; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 51042000} // 51.42.0 - {$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} - (** - * Decoder should decode to this many channels if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated Deprecated in favor of request_channel_layout. - *) - request_channels: cint; - {$IFEND} - {$IFEND} - - {$IF LIBAVCODEC_VERSION > 51049000} // > 51.49.0 - (** - * Percentage of dynamic range compression to be applied by the decoder. - * The default value is 1.0, corresponding to full compression. - * - encoding: unused - * - decoding: Set by user. - *) - drc_scale: cfloat; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 51068000} // 51.68.0 - (** - * opaque 64bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: unused - * - decoding: Set by user. - *) - reordered_opaque: cint64; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 51069000} // 51.69.0 - (** - * Bits per sample/pixel of internal libavcodec pixel/sample format. - * This field is applicable only when sample_fmt is SAMPLE_FMT_S32. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - bits_per_raw_sample: cint; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52002000} // 52.2.0 - (** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by libavcodec. - *) - channel_layout: cint64; - - (** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - *) - request_channel_layout: cint64; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52004000} // >= 52.4.0 - (** - * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_max_available_vbv_use: cfloat; - - (** - * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. - * - encoding: Set by user. - * - decoding: unused. - *) - rc_min_vbv_overflow_use: cfloat; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52018000} // >= 52.18.0 - (** - * Hardware accelerator in use - * - encoding: unused. - * - decoding: Set by libavcodec - *) - hwaccel: PAVHWAccel; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52020000} // >= 52.20.0 - (** - * For some codecs, the time base is closer to the field rate than the frame rate. - * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration - * if no telecine is used ... - * - * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. - *) - ticks_per_frame: cint; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52021000} // >= 52.21.0 - (** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. - * - encoding: unused - * - decoding: Set by user - *) - hwaccel_context: pointer; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52028000} // >= 52.28.0 - (** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_primaries: TAVColorPrimaries; - - (** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_trc: TAVColorTransferCharacteristic; - - (** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - colorspace: TAVColorSpace; - - (** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - color_range: TAVColorRange; - - (** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - *) - chroma_sample_location: TAVChromaLocation; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52037000} // >= 52.37.0 - (** - * The codec may call this to execute several independent things. - * It will return only after finishing all tasks. - * The user may replace this with some multithreaded implementation, - * the default implementation will execute the parts serially. - * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. - * @param c context passed also to func - * @param count the number of things to execute - * @param arg2 argument passed unchanged to func - * @param ret return values of executed functions, must have space for "count" values. May be NULL. - * @param func function that will be called count times, with jobnr from 0 to count-1. - * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no - * two instances of func executing at the same time will have the same threadnr. - * @return always 0 currently, but code should handle a future improvement where when any call to func - * returns < 0 no further calls to func may be done and < 0 is returned. - * - encoding: Set by libavcodec, user can override. - * - decoding: Set by libavcodec, user can override. - *) - execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52042000} // >= 52.42.0 - (** - * explicit P-frame weighted prediction analysis method - * 0: off - * 1: fast blind weighting (one reference duplicate with -1 offset) - * 2: smart weighting (full fade detection analysis) - * - encoding: Set by user. - * - decoding: unused - *) - weighted_p_pred: cint; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52061000} // >= 52.61.0 - (** - * AQ mode - * 0: Disabled - * 1: Variance AQ (complexity mask) - * 2: Auto-variance AQ (experimental) - * - encoding: Set by user - * - decoding: unused - *) - aq_mode: cint; - - (** - * AQ strength - * Reduces blocking and blurring in flat and textured areas. - * - encoding: Set by user - * - decoding: unused - *) - aq_strength: cfloat; - - (** - * PSY RD - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_rd: cfloat; - - (** - * PSY trellis - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - *) - psy_trellis: cfloat; - - (** - * RC lookahead - * Number of frames for frametype and ratecontrol lookahead - * - encoding: Set by user - * - decoding: unused - *) - rc_lookahead: cint; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52067000} // >= 52.67.0 - (** - * Constant rate factor maximum - * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse - * than crf_max, even if doing so would violate VBV restrictions. - * - encoding: Set by user. - * - decoding: unused - *) - crf_max: cfloat; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52067002} // >= 52.67.2 - log_level_offset: cint; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52083000} // >= 52.83.0 - (** - * Determines which LPC analysis algorithm to use. - * - encoding: Set by user - * - decoding: unused - *) - lpc_type: TAVLPCType; - - (** - * Number of passes to use for Cholesky factorization during LPC analysis - * - encoding: Set by user - * - decoding: unused - *) - lpc_passes: cint; - {$IFEND} - end; {TAVCodecContext} - -(** - * AVCodec. - *) - TAVCodec = record - name: PAnsiChar; -{$IF LIBAVCODEC_VERSION < 52064000} // < 52.64.0 - type_: TCodecType; -{$ELSE} - type_: TAVMediaType; -{$IFEND} - id: TCodecID; - priv_data_size: cint; - init: function (avctx: PAVCodecContext): cint; cdecl; (* typo corretion by the Creative CAT *) - encode: function (avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; data: pointer): cint; cdecl; - close: function (avctx: PAVCodecContext): cint; cdecl; - decode: function (avctx: PAVCodecContext; outdata: pointer; var outdata_size: cint; - {$IF LIBAVCODEC_VERSION < 52025000} // 52.25.0 - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - {$ELSE} - avpkt: PAVPacket): cint; cdecl; - {$IFEND} - (** - * Codec capabilities. - * see CODEC_CAP_* - *) - capabilities: cint; - next: PAVCodec; - (** - * Flush buffers. - * Will be called when seeking - *) - flush: procedure (avctx: PAVCodecContext); cdecl; - supported_framerates: {const} PAVRational; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - pix_fmts: {const} PAVPixelFormat; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - {$IF LIBAVCODEC_VERSION >= 51055000} // 51.55.0 - (** - * Descriptive name for the codec, meant to be more human readable than name. - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. - *) - long_name: {const} PAnsiChar; - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 51056000} // 51.56.0 - supported_samplerates: {const} PCint; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 51062000} // 51.62.0 - sample_fmts: {const} PAVSampleFormatArray; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52002000} // 52.2.0 - channel_layouts: {const} PCint64; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52080000} // 52.80.0 - max_lowres: byte; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 - {$IFEND} - end; - -{$IF LIBAVCODEC_VERSION >= 52018000} // 52.18.0 -(** - * AVHWAccel. - *) - TAVHWAccel = record - (** - * Name of the hardware accelerated codec. - * The name is globally unique among encoders and among decoders (but an - * encoder and a decoder can share the same name). - *) - name: PAnsiChar; - -{$IF LIBAVCODEC_VERSION < 52064000} // < 52.64.0 - (** - * Type of codec implemented by the hardware accelerator. - * - * See CODEC_TYPE_xxx - *) - type_: TCodecType; -{$ELSE} - (** - * Type of codec implemented by the hardware accelerator. - * - * See AVMediaType_xxx - *) - type_: TAVMediaType; -{$IFEND} - - - (** - * Codec implemented by the hardware accelerator. - * - * See CODEC_ID_xxx - *) - id: TCodecID; - - (** - * Supported pixel format. - * - * Only hardware accelerated formats are supported here. - *) - pix_fmt: {const} PAVPixelFormat; - - (** - * Hardware accelerated codec capabilities. - * see FF_HWACCEL_CODEC_CAP_* - *) - capabilities: cint; - - next: PAVCodec; - - (** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - *) - start_frame: function (avctx: PAVCodecContext; - buf: PByteArray; - buf_size: cint): cint; cdecl; - - (** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - *) - decode_slice: function (avctx: PAVCodecContext; - buf: PByteArray; - buf_size: cint): cint; cdecl; - - (** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - *) - end_frame: function (avctx: PAVCodecContext): cint; cdecl; - -{$IF LIBAVCODEC_VERSION >= 52021000} // >= 52.21.0 - (** - * Size of HW accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - *) - priv_data_size: cint; -{$IFEND} - - end; -{$IFEND} - -(** - * four components are given, that's all. - * the last component is alpha - *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..3] of PByteArray; - linesize: array [0..3] of cint; ///< number of bytes per line - end; - -type - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); - -type - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - {$IF LIBAVCODEC_VERSION < 52010000} // < 52.10.0 - TAVSubtitleRect = record - x: cuint16; - y: cuint16; - w: cuint16; - h: cuint16; - nb_colors: cuint16; - linesize: cint; - rgba_palette: PCuint32; - bitmap: PCuint8; - end; - {$ELSE} - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The pressentation of this is unaffected by the other values in this - * struct. - *) - ass: PByteArray; - end; - {$IFEND} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - {$IF LIBAVCODEC_VERSION < 52010000} // < 52.10.0 - rects: PAVSubtitleRect; - {$ELSE} - rects: PPAVSubtitleRect; - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52032000} // >= 52.32.0 - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - {$IFEND} - end; - -{$IF LIBAVCODEC_VERSION >= 52025000} // 52.25.0 -{ packet functions } - -(** - * @deprecated use NULL instead - *) -procedure av_destruct_packet_nofree(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Default packet destructor. - *) -procedure av_destruct_packet(pkt: PAVPacket); - cdecl; external av__codec; - -(* - * Initialize optional fields of a packet with default values. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); - cdecl; external av__codec; - -(* - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(pkt: PAVPacket; size: cint): cint; - cdecl; external av__codec; - -(* - * Reduce packet size, correctly zeroing padding - * - * @param pkt packet - * @param size new size - *) -procedure av_shrink_packet(pkt: PAVPacket; size: cint); - cdecl; external av__codec; - -(* - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__codec; - -(* - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); -{$IF LIBAVCODEC_VERSION >= 52028000} // 52.28.0 - cdecl; external av__codec; -{$IFEND} -{$IFEND} - -(* resample.c *) -type - PReSampleContext = pointer; - PAVResampleContext = pointer; - PImgReSampleContext = pointer; - -function audio_resample_init (output_channels: cint; input_channels: cint; - output_rate: cint; input_rate: cint): PReSampleContext; - cdecl; external av__codec; - -function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; - cdecl; external av__codec; - -procedure audio_resample_close (s: PReSampleContext); - cdecl; external av__codec; - -(** - * Initialize an audio resampler. - * Note, if either rate is not an integer then simply scale both rates up so they are. - * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq - * @param log2_phase_count log2 of the number of entries in the polyphase filterbank - * @param linear If 1 then the used FIR filter will be linearly interpolated - between the 2 closest, if 0 the closest will be used - * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate - *) -function av_resample_init (out_rate: cint; in_rate: cint; filter_length: cint; - log2_phase_count: cint; linear: cint; cutoff: cdouble): PAVResampleContext; - cdecl; external av__codec; - -(** - * Resample an array of samples using a previously configured context. - * @param src an array of unconsumed samples - * @param consumed the number of samples of src which have been consumed are returned here - * @param src_size the number of unconsumed samples available - * @param dst_size the amount of space in samples available in dst - * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. - * @return the number of samples written in dst or -1 if an error occurred - *) -function av_resample (c: PAVResampleContext; dst: PSmallint; src: PSmallint; var consumed: cint; - src_size: cint; dst_size: cint; update_ctx: cint): cint; - cdecl; external av__codec; - -(** - * Compensate samplerate/timestamp drift. The compensation is done by changing - * the resampler parameters, so no audible clicks or similar distortions occur - * @param compensation_distance distance in output samples over which the compensation should be performed - * @param sample_delta number of output samples which should be output less - * - * example: av_resample_compensate(c, 10, 500) - * here instead of 510 samples only 500 samples would be output - * - * note, due to rounding the actual compensation might be slightly different, - * especially if the compensation_distance is large and the in_rate used during init is small - *) -procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; - compensation_distance: cint); - cdecl; external av__codec; - -procedure av_resample_close (c: PAVResampleContext); - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION < 52000000} // 52.0.0 -(* YUV420 format is assumed ! *) - -(** - * @deprecated Use the software scaler (swscale) instead. - *) -function img_resample_init (output_width: cint; output_height: cint; - input_width: cint; input_height: cint): PImgReSampleContext; - cdecl; external av__codec; deprecated; - -(** - * @deprecated Use the software scaler (swscale) instead. - *) -function img_resample_full_init (owidth: cint; oheight: cint; - iwidth: cint; iheight: cint; - topBand: cint; bottomBand: cint; - leftBand: cint; rightBand: cint; - padtop: cint; padbottom: cint; - padleft: cint; padright: cint): PImgReSampleContext; - cdecl; external av__codec; deprecated; - -(** - * @deprecated Use the software scaler (swscale) instead. - *) -procedure img_resample (s: PImgReSampleContext; output: PAVPicture; input: {const} PAVPicture); - cdecl; external av__codec; deprecated; - -(** - * @deprecated Use the software scaler (swscale) instead. - *) -procedure img_resample_close (s: PImgReSampleContext); - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Allocate memory for a picture. Call avpicture_free to free it. - * - * @param picture the picture to be filled in. - * @param pix_fmt the format of the picture. - * @param width the width of the picture. - * @param height the height of the picture. - * @return Zero if successful, a negative value if not. - *) -function avpicture_alloc (picture: PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; - -(** - * Free a picture previously allocated by avpicture_alloc(). - * - * @param picture the AVPicture to be freed - *) -procedure avpicture_free (picture: PAVPicture); - cdecl; external av__codec; - -(** - * Fill in the AVPicture fields. - * The fields of the given AVPicture are filled in by using the 'ptr' address - * which points to the image data buffer. Depending on the specified picture - * format, one or multiple image data pointers and line sizes will be set. - * If a planar format is specified, several pointers will be set pointing to - * the different picture planes and the line sizes of the different planes - * will be stored in the lines_sizes array. - * Call with ptr == NULL to get the required size for the ptr buffer. - * - * @param picture AVPicture whose fields are to be filled in - * @param ptr Buffer which will contain or contains the actual image data - * @param pix_fmt The format in which the picture data is stored. - * @param width the width of the image in pixels - * @param height the height of the image in pixels - * @return size of the image data in bytes - *) -function avpicture_fill (picture: PAVPicture; ptr: pcuint8; - pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -function avpicture_layout (src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint; - dest: PByteArray; dest_size: cint): cint; - cdecl; external av__codec; - -(** - * Calculate the size in bytes that a picture of the given width and height - * would occupy if stored in the given picture format. - * Note that this returns the size of a compact representation as generated - * by avpicture_layout, which can be smaller than the size required for e.g. - * avpicture_fill. - * - * @param pix_fmt the given picture format - * @param width the width of the image - * @param height the height of the image - * @return Image data size in bytes or -1 on error (e.g. too large dimensions). - *) -function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; - cdecl; external av__codec; - -procedure avcodec_get_chroma_sub_sample (pix_fmt: TAVPixelFormat; var h_shift: cint; var v_shift: cint); - cdecl; external av__codec; - -(** - * Return the pixel format corresponding to the name name. - * - * If there is no pixel format with name name, then look for a - * pixel format with the name corresponding to the native endian - * format of name. - * For example in a little-endian system, first look for "gray16", - * then for "gray16le". - * - * Finally if no pixel format has been found, return PIX_FMT_NONE. - *) -function avcodec_get_pix_fmt_name(pix_fmt: TAVPixelFormat): PAnsiChar; - cdecl; external av__codec; - -procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); - cdecl; external av__codec; - -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} -(** - * Return the pixel format corresponding to the name name. - * - * If there is no pixel format with name name, then looks for a - * pixel format with the name corresponding to the native endian - * format of name. - * For example in a little-endian system, first looks for "gray16", - * then for "gray16le". - * - * Finally if no pixel format has been found, returns PIX_FMT_NONE.* - * @deprecated Deprecated in favor of av_get_pix_fmt(). - *) -function avcodec_get_pix_fmt(name: {const} PAnsiChar): TAVPixelFormat; - cdecl; external av__codec; -{$IF LIBAVCODEC_VERSION >= 52049000} // >= 52.49.0 - deprecated; -{$IFEND} -{$IFEND} - -(** - * Return a value representing the fourCC code associated to the - * pixel format pix_fmt, or 0 if no associated fourCC code can be - * found. - *) -function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION >= 52073000} // 52.73.0 -(** - * Put a string representing the codec tag codec_tag in buf. - * - * @param buf_size size in bytes of buf - * @return the length of the string that would have been generated if - * enough space had been available, excluding the trailing null - *) -function av_get_codec_tag_string(buf: PAnsiChar; buf_size: size_t; codec_tag: cuint): size_t; - cdecl; external av__codec; -{$IFEND} - -const - FF_LOSS_RESOLUTION = $0001; {**< loss due to resolution change *} - FF_LOSS_DEPTH = $0002; {**< loss due to color depth change *} - FF_LOSS_COLORSPACE = $0004; {**< loss due to color space conversion *} - FF_LOSS_ALPHA = $0008; {**< loss of alpha bits *} - FF_LOSS_COLORQUANT = $0010; {**< loss due to color quantization *} - FF_LOSS_CHROMA = $0020; {**< loss of chroma (e.g. RGB to gray conversion) *} - -(** - * Compute what kind of losses will occur when converting from one specific - * pixel format to another. - * When converting from one pixel format to another, information loss may occur. - * For example, when converting from RGB24 to GRAY, the color information will - * be lost. Similarly, other losses occur when converting from some formats to - * other formats. These losses can involve loss of chroma, but also loss of - * resolution, loss of color depth, loss due to the color space conversion, loss - * of the alpha bits or loss due to color quantization. - * avcodec_get_fix_fmt_loss() informs you about the various types of losses - * which will occur when converting from one pixel format to another. - * - * @param[in] dst_pix_fmt destination pixel format - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @return Combination of flags informing you what kind of losses will occur. - *) -function avcodec_get_pix_fmt_loss (dst_pix_fmt: TAVPixelFormat; src_pix_fmt: TAVPixelFormat; - has_alpha: cint): cint; - cdecl; external av__codec; - -(** - * Find the best pixel format to convert to given a certain source pixel - * format. When converting from one pixel format to another, information loss - * may occur. For example, when converting from RGB24 to GRAY, the color - * information will be lost. Similarly, other losses occur when converting from - * some formats to other formats. avcodec_find_best_pix_fmt() searches which of - * the given pixel formats should be used to suffer the least amount of loss. - * The pixel formats from which it chooses one, are determined by the - * pix_fmt_mask parameter. - * - * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24); - * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); - * @endcode - * - * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from - * @param[in] src_pix_fmt source pixel format - * @param[in] has_alpha Whether the source pixel format alpha channel is used. - * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. - * @return The best pixel format to convert to or -1 if none was found. - *) -{$IF LIBAVCODEC_VERSION >= 52000000} // 52.0.0 -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint64; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): cint; - cdecl; external av__codec; -{$ELSEIF LIBAVCODEC_VERSION < 52022001} -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): cint; - cdecl; external av__codec; -{$ELSE} -function avcodec_find_best_pix_fmt(pix_fmt_mask: cint; src_pix_fmt: TAVPixelFormat; - has_alpha: cint; loss_ptr: PCint): TAVPixelFormat; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 51041000} // 51.41.0 -(** - * Print in buf the string corresponding to the pixel format with - * number pix_fmt, or an header if pix_fmt is negative. - * - * @param[in] buf the buffer where to write the string - * @param[in] buf_size the size of buf - * @param[in] pix_fmt the number of the pixel format to print the corresponding info string, or - * a negative value to print the corresponding header. - * Meaningful values for obtaining a pixel format info vary from 0 to PIX_FMT_NB -1. - *) -{$IF LIBAVCODEC_VERSION < 52022001} // 52.22.1 -procedure avcodec_pix_fmt_string (buf: PAnsiChar; buf_size: cint; pix_fmt: cint); - cdecl; external av__codec; -{$ELSE} -procedure avcodec_pix_fmt_string (buf: PAnsiChar; buf_size: cint; pix_fmt: TAVPixelFormat); - cdecl; external av__codec; -{$IFEND} -{$IFEND} - -const - FF_ALPHA_TRANSP = $0001; {* image has some totally transparent pixels *} - FF_ALPHA_SEMI_TRANSP = $0002; {* image has some transparent pixels *} - -(** - * Tell if an image really has transparent alpha values. - * @return ored mask of FF_ALPHA_xxx constants - *) -function img_get_alpha_info (src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION < 52000000} // 52.0.0 -(** - * convert among pixel formats - * @deprecated Use the software scaler (swscale) instead. - *) -function img_convert (dst: PAVPicture; dst_pix_fmt: TAVPixelFormat; - src: {const} PAVPicture; pix_fmt: TAVPixelFormat; - width: cint; height: cint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(* deinterlace a picture *) -(* deinterlace - if not supported return -1 *) -function avpicture_deinterlace (dst: PAVPicture; - src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; - width: cint; - height: cint): cint; - cdecl; external av__codec; - -{* external high level API *} - -{$IF LIBAVCODEC_VERSION < 52000000} // 52.0.0 -{ -var - first_avcodec: PAVCodec; external av__codec; -} -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 51049000} // 51.49.0 -(** - * If c is NULL, returns the first registered codec, - * if c is non-NULL, returns the next registered codec after c, - * or NULL if c is the last one. - *) -function av_codec_next(c: PAVCodec): PAVCodec; - cdecl; external av__codec; -{$IFEND} - -(** - * Return the LIBAVCODEC_VERSION_INT constant. - *) -function avcodec_version(): cuint; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION < 52008000} // 52.8.0 -(* returns LIBAVCODEC_BUILD constant *) -function avcodec_build(): cuint; - cdecl; external av__codec; deprecated; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52041000} // 52.41.0 -(** - * Return the libavcodec build-time configuration. - *) -function avcodec_configuration(): PAnsiChar; - cdecl; external av__codec; - -(** - * Return the libavcodec license. - *) -function avcodec_license(): PAnsiChar; - cdecl; external av__codec; -{$IFEND} - -(** - * Initialize libavcodec. - * - * @warning This function must be called before any other libavcodec - * function. - *) -procedure avcodec_init(); - cdecl; external av__codec; - -(** - * Register the codec codec and initialize libavcodec. - * - * @see avcodec_init() - *) -{$IF LIBAVCODEC_VERSION >= 52014000} // 52.14.0 -procedure avcodec_register(codec: PAVCodec); - cdecl; external av__codec; -// Deprecated in favor of avcodec_register. -procedure register_avcodec(codec: PAVCodec); - cdecl; external av__codec; deprecated; -{$ELSEIF LIBAVCODEC_VERSION_MAJOR < 53} -procedure register_avcodec(codec: PAVCodec); - cdecl; external av__codec; -{$IFEND} -(** - * Find a registered encoder with a matching codec ID. - * - * @param id CodecID of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered encoder with the specified name. - * - * @param name name of the requested encoder - * @return An encoder if one was found, NULL otherwise. - *) -function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; - -(** - * Findsa registered decoder with a matching codec ID. - * - * @param id CodecID of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder(id: TCodecID): PAVCodec; - cdecl; external av__codec; - -(** - * Find a registered decoder with the specified name. - * - * @param name name of the requested decoder - * @return A decoder if one was found, NULL otherwise. - *) -function avcodec_find_decoder_by_name(name: PAnsiChar): PAVCodec; - cdecl; external av__codec; -procedure avcodec_string(buf: PAnsiChar; buf_size: cint; enc: PAVCodecContext; encode: cint); - cdecl; external av__codec; - -(** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - *) -procedure avcodec_get_context_defaults(s: PAVCodecContext); - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION >= 51039000} // 51.39.0 -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -{$IF LIBAVCODEC_VERSION < 52064000} // < 52.64.0 -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TCodecType); - cdecl; external av__codec; -{$ELSE} -procedure avcodec_get_context_defaults2(s: PAVCodecContext; ctype: TAVMediaType); - cdecl; external av__codec; -{$IFEND} -{$IFEND} - -(** - * Allocate an AVCodecContext and sets it fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - *) -function avcodec_alloc_context(): PAVCodecContext; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION >= 51039000} // 51.39.0 -(** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! *) -{$IF LIBAVCODEC_VERSION < 52064000} // < 52.64.0 -function avcodec_alloc_context2(ctype: TCodecType): PAVCodecContext; - cdecl; external av__codec; -{$ELSE} -function avcodec_alloc_context2(ctype: TAVMediaType): PAVCodecContext; - cdecl; external av__codec; -{$IFEND} -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52065000} // >= 52.65.0 -(** - * Copy the settings of the source AVCodecContext into the destination - * AVCodecContext. The resulting destination codec context will be - * unopened, i.e. you are required to call avcodec_open() before you - * can use this AVCodecContext to decode/encode video/audio data. - * - * @param dest target codec context, should be initialized with - * avcodec_alloc_context(), but otherwise uninitialized - * @param src source codec context - * @return AVERROR() on error (e.g. memory allocation error), 0 on success - *) -function avcodec_copy_context(dest: PAVCodecContext; src: {const} PAVCodecContext): cint; - cdecl; external av__codec; -{$IFEND} - -(** - * Set the fields of the given AVFrame to default values. - * - * @param pic The AVFrame of which the fields should be set to default values. - *) -procedure avcodec_get_frame_defaults (pic: PAVFrame); - cdecl; external av__codec; - -(** - * Allocate an AVFrame and set its fields to default values. The resulting - * struct can be deallocated by simply calling av_free(). - * - * @return An AVFrame filled with default values or NULL on failure. - * @see avcodec_get_frame_defaults - *) -function avcodec_alloc_frame(): PAVFrame; - cdecl; external av__codec; - -function avcodec_default_get_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; -procedure avcodec_default_release_buffer (s: PAVCodecContext; pic: PAVFrame); - cdecl; external av__codec; -function avcodec_default_reget_buffer (s: PAVCodecContext; pic: PAVFrame): cint; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION >= 52066000} // >= 52.66.0 -(** - * Return the amount of padding in pixels which the get_buffer callback must - * provide around the edge of the image for codecs which do not have the - * CODEC_FLAG_EMU_EDGE flag. - * - * @return Required padding in pixels. - *) -function avcodec_get_edge_width(): cuint; - cdecl; external av__codec; -{$IFEND} - -(** - * Modify width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you do not use any horizontal - * padding. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. - *) -procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} // < 53 -{$IF LIBAVCODEC_VERSION >= 52055000} // >= 52.55.0 -(** -{$IF LIBAVCODEC_VERSION >= 52084003} // >= 52.84.3 - * @deprecated Deprecated in favor of av_check_image_size(). -{$ELSE} - * Modifiy width and height values so that they will result in a memory - * buffer that is acceptable for the codec if you also ensure that all - * line sizes are a multiple of the respective linesize_align[i]. - * - * May only be used if a codec with CODEC_CAP_DR1 has been opened. - * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased - * according to avcodec_get_edge_width() before. -{$IFEND} - *) -procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; - linesize_align: PQuadIntArray); - cdecl; external av__codec; -{$IF LIBAVCODEC_VERSION >= 52084003} // >= 52.84.3 - deprecated; -{$IFEND} -{$IFEND} -{$IFEND} - -(** - * Check if the given dimension of a picture is valid, meaning that all - * bytes of the picture can be addressed with a signed int. - * - * @param[in] w Width of the picture. - * @param[in] h Height of the picture. - * @return Zero if valid, a negative value if invalid. - *) -function avcodec_check_dimensions(av_log_ctx: pointer; w: cuint; h: cuint): cint; - cdecl; external av__codec; - - -function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; - cdecl; external av__codec; - -function avcodec_thread_init(s: PAVCodecContext; thread_count: cint): cint; - cdecl; external av__codec; -procedure avcodec_thread_free(s: PAVCodecContext); - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION < 52004000} // < 52.4.0 -function avcodec_thread_execute(s: PAVCodecContext; func: TExecuteFunc; arg: PPointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -{$ELSEIF LIBAVCODEC_VERSION < 52059000} // < 52.59.0 -function avcodec_thread_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION < 52004000} // < 52.4.0 -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: PPointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -{$ELSE} -function avcodec_default_execute(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint; size: cint): cint; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52037000} // >= 52.37.0 -function avcodec_default_execute2(s: PAVCodecContext; func: TExecuteFunc; arg: Pointer; var ret: cint; count: cint): cint; - cdecl; external av__codec; -{$IFEND} -//FIXME func typedef - -(** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context(); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder - *) -function avcodec_open(avctx: PAVCodecContext; codec: PAVCodec): cint; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION < 52000000} // < 52.0.0 -(** - * @deprecated Use avcodec_decode_audio2 instead. - *) -function avcodec_decode_audio(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - buf: {const} PByteArray; buf_size: cint): cint; - cdecl; external av__codec; {deprecated;} -{$IFEND} - -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} -{$IF LIBAVCODEC_VERSION >= 51030000} // 51.30.0 -(** - * Decode an audio frame from buf into samples. - * Wrapper function which calls avcodec_decode_audio3. - * - * @deprecated Use avcodec_decode_audio3 instead. - * @param avctx the codec context - * @param[out] samples the output buffer, sample type in avctx->sample_fmt - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] buf the input buffer - * @param[in] buf_size the input buffer size in bytes - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_audio2(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - buf: {const} PByteArray; buf_size: cint): cint; - cdecl; external av__codec; {deprecated;} -{$IFEND} -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52025000} // 52.25.0 -(** - * Decode the audio frame of size avpkt->size from avpkt->data into samples. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. In this case, - * avcodec_decode_audio3 has to be called again with an AVPacket that contains - * the remaining data in order to decode the second frame etc. - * If no frame - * could be outputted, frame_size_ptr is zero. Otherwise, it is the - * decompressed frame size in bytes. - * - * @warning You must set frame_size_ptr to the allocated size of the - * output buffer before calling avcodec_decode_audio3(). - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data and output buffer - * samples. The alignment requirements depend on the CPU: On some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum and - * samples should be 16 byte aligned unless the CPU doesn't need it - * (AltiVec and SSE do). - * - * @note Some codecs have a delay between input and output, these need to be - * fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames. - * - * @param avctx the codec context - * @param[out] samples the output buffer - * @param[in,out] frame_size_ptr the output buffer size in bytes - * @param[in] avpkt The input AVPacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields. - * All decoders are designed to use the least fields possible though. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame data was decompressed (used) from the input AVPacket. - *) -function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint; - var frame_size_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} -(** - * Decode a video frame from buf into picture. - * Wrapper function which calls avcodec_decode_video2. - * - * @deprecated Use avcodec_decode_video2 instead. - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * Use avcodec_alloc_frame to get an AVFrame, the codec will - * allocate memory for the actual bitmap. - * with default get/release_buffer(), the decoder frees/reuses the bitmap as it sees fit. - * with overridden get/release_buffer() (needs CODEC_CAP_DR1) the user decides into what buffer the decoder - * decodes and the decoder tells the user once it does not need the data anymore, - * the user app can at this point free/reuse/keep the memory as it sees fit. - * - * @param[in] buf the input buffer - * @param[in] buf_size the size of the input buffer in bytes - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - buf: {const} PByteArray; buf_size: cint): cint; - cdecl; external av__codec; {deprecated;} -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52025000} // 52.25.0 -(** - * Decode the video frame of size avpkt->size from avpkt->data into picture. - * Some decoders may support multiple frames in a single AVPacket, such - * decoders would then just decode the first frame. - * - * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than - * the actual read bytes because some optimized bitstream readers read 32 or 64 - * bits at once and could read over the end. - * - * @warning The end of the input buffer buf should be set to 0 to ensure that - * no overreading happens for damaged MPEG streams. - * - * @note You might have to align the input buffer avpkt->data. - * The alignment requirements depend on the CPU: on some CPUs it isn't - * necessary at all, on others it won't work at all if not aligned and on others - * it will work but it will have an impact on performance. - * - * In practice, avpkt->data should have 4 byte alignment at minimum. - * - * @param avctx the codec context - * @param[out] picture The AVFrame in which the decoded video frame will be stored. - * @param[in] avpkt The input AVpacket containing the input buffer. - * You can create such packet with av_init_packet() and by then setting - * data and size, some decoders might in addition need other fields like - * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least - * fields possible. - * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. - * @return On error a negative value is returned, otherwise the number of bytes - * used or zero if no frame could be decompressed. - *) -function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame; - var got_picture_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} -(* Decode a subtitle message. Return -1 if error, otherwise return the - * number of bytes used. If no subtitle could be decompressed, - * got_sub_ptr is zero. Otherwise, the subtitle is stored in*sub. - *) -function avcodec_decode_subtitle(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - buf: {const} PByteArray; buf_size: cint): cint; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52025000} // 52.25.0 -(* Decode a subtitle message. - * Return a negative value on error, otherwise return the number of bytes used. - * If no subtitle could be decompressed, got_sub_ptr is zero. - * Otherwise, the subtitle is stored in *sub. - * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for - * simplicity, because the performance difference is expect to be negligible - * and reusing a get_buffer written for video codecs would probably perform badly - * due to a potentially very different allocation pattern. - * - * @param avctx the codec context - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be - freed with avsubtitle_free if *got_sub_ptr is set. - * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. - * @param[in] avpkt The input AVPacket containing the input buffer. - *) -function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; - var got_sub_ptr: cint; - avpkt: PAVPacket): cint; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52082000} // 52.82.0 -(** - * Frees all allocated data in the given subtitle struct. - * - * @param sub AVSubtitle to free. - *) -procedure avsubtitle_free(sub: PAVSubtitle); - cdecl; external av__codec; -{$IFEND} - -function avcodec_parse_frame(avctx: PAVCodecContext; pdata: PPointer; - data_size_ptr: PCint; - buf: PByteArray; buf_size: cint): cint; - cdecl; external av__codec; - -(** - * Encode an audio frame from samples into buf. - * - * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. - * However, for PCM audio the user will know how much space is needed - * because it depends on the value passed in buf_size as described - * below. In that case a lower value can be used. - * - * @param avctx the codec context - * @param[out] buf the output buffer - * @param[in] buf_size the output buffer size - * @param[in] samples the input buffer containing the samples - * The number of samples read from this buffer is frame_size*channels, - * both of which are defined in avctx. - * For PCM audio the number of samples read from samples is equal to - * buf_size * input_sample_size / output_sample_size. - * @return On error a negative value is returned, on success zero or the number - * of bytes used to encode the data read from the input buffer. - *) -function avcodec_encode_audio(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; samples: {const} PSmallint): cint; - cdecl; external av__codec; - -(** - * Encode a video frame from pict into buf. - * The input picture should be - * stored using a specific format, namely avctx.pix_fmt. - * - * @param avctx the codec context - * @param[out] buf the output buffer for the bitstream of encoded frame - * @param[in] buf_size the size of the output buffer in bytes - * @param[in] pict the input picture to encode - * @return On error a negative value is returned, on success zero or the number - * of bytes used from the output buffer. - *) -function avcodec_encode_video(avctx: PAVCodecContext; buf: PByte; - buf_size: cint; pict: PAVFrame): cint; - cdecl; external av__codec; -function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; - buf_size: cint; sub: {const} PAVSubtitle): cint; - cdecl; external av__codec; - -function avcodec_close(avctx: PAVCodecContext): cint; - cdecl; external av__codec; - -(** - * Register all the codecs, parsers and bitstream filters which were enabled at - * configuration time. If you do not call this function you can select exactly - * which formats you want to support, by using the individual registration - * functions. - * - * @see register_avcodec - * @see avcodec_register - * @see av_register_codec_parser - * @see av_register_bitstream_filter - *) -procedure avcodec_register_all(); - cdecl; external av__codec; - -(** - * Flush buffers, should be called when seeking or when switching to a different stream. - *) -procedure avcodec_flush_buffers(avctx: PAVCodecContext); - cdecl; external av__codec; - -procedure avcodec_default_free_buffers(s: PAVCodecContext); - cdecl; external av__codec; - -(* misc useful functions *) - -(** - * Return a single letter to describe the given picture type pict_type. - * - * @param[in] pict_type the picture type - * @return A single character representing the picture type. - *) -function av_get_pict_type_char(pict_type: cint): AnsiChar; - cdecl; external av__codec; - -(** - * Return codec bits per sample. - * - * @param[in] codec_id the codec - * @return Number of bits per sample or zero if unknown for the given codec. - *) -function av_get_bits_per_sample(codec_id: TCodecID): cint; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION >= 51041000} // 51.41.0 -(** - * Return sample format bits per sample. - * - * @param[in] sample_fmt the sample format - * @return Number of bits per sample or zero if unknown for the given sample format. - *) -function av_get_bits_per_sample_format(sample_fmt: TAVSampleFormat): cint; - cdecl; external av__codec; -{$IFEND} - -const - AV_PARSER_PTS_NB = 4; - PARSER_FLAG_COMPLETE_FRAMES = $0001; -{$IF LIBAVCODEC_VERSION >= 52070000} // 52.70.0 - PARSER_FLAG_ONCE = $0002; -{$IFEND} - -type - {* frame parsing *} - PAVCodecParserContext = ^TAVCodecParserContext; - PAVCodecParser = ^TAVCodecParser; - - TAVCodecParserContext = record - priv_data: pointer; - parser: PAVCodecParser; - frame_offset: cint64; (* offset of the current frame *) - cur_offset: cint64; (* current offset (incremented by each av_parser_parse()) *) - next_frame_offset: cint64; (* offset of the next frame *) - (* video info *) - pict_type: cint; (* XXX: put it back in AVCodecContext *) - (** - * This field is used for proper frame duration computation in lavf. - * It signals, how much longer the frame duration of the current frame - * is compared to normal frame duration. - * - * frame_duration = (1 + repeat_pict) * time_base - * - * It is used by codecs like H.264 to display telecined material. - *) - repeat_pict: cint; (* XXX: put it back in AVCodecContext *) - pts: cint64; (* pts of the current frame *) - dts: cint64; (* dts of the current frame *) - - (* private data *) - last_pts: cint64; - last_dts: cint64; - fetch_timestamp: cint; - - cur_frame_start_index: cint; - cur_frame_offset: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_pts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - cur_frame_dts: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - flags: cint; - - {$IF LIBAVCODEC_VERSION >= 51040003} // 51.40.3 - offset: cint64; ///< byte offset from starting packet start - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 51057001} // 51.57.1 - cur_frame_end: array [0..AV_PARSER_PTS_NB - 1] of cint64; - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52016000} // 52.16.0 - (*! - * Set by parser to 1 for key frames and 0 for non-key frames. - * It is initialized to -1, so if the parser doesn't set this flag, - * old-style fallback using FF_I_TYPE picture type as key frames - * will be used. - *) - key_frame: cint; - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52018000} // 52.18.0 - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY - * set. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - {$IFEND} - {$IF LIBAVCODEC_VERSION >= 52019000} // 52.19.0 - // Timestamp generation support: - (** - * Synchronization point for start of timestamp generation. - * - * Set to >0 for sync point, 0 for no sync point and <0 for undefined - * (default). - * - * For example, this corresponds to presence of H.264 buffering period - * SEI message. - *) - dts_sync_point: cint; - - (** - * Offset of the current timestamp against last timestamp sync point in - * units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain a valid timestamp offset. - * - * Note that the timestamp of sync point has usually a nonzero - * dts_ref_dts_delta, which refers to the previous sync point. Offset of - * the next frame after timestamp sync point will be usually 1. - * - * For example, this corresponds to H.264 cpb_removal_delay. - *) - dts_ref_dts_delta: cint; - - (** - * Presentation delay of current frame in units of AVCodecContext.time_base. - * - * Set to INT_MIN when dts_sync_point unused. Otherwise, it must - * contain valid non-negative timestamp delta (presentation time of a frame - * must not lie in the past). - * - * This delay represents the difference between decoding and presentation - * time of the frame. - * - * For example, this corresponds to H.264 dpb_output_delay. - *) - pts_dts_delta: cint; - {$IFEND} - - {$IF LIBAVCODEC_VERSION >= 52021000} // 52.21.0 - (** - * Position of the packet in file. - * - * Analogous to cur_frame_pts/dts - *) - cur_frame_pos: array [0..AV_PARSER_PTS_NB - 1] of cint64; - - (** - * Byte position of currently parsed frame in stream. - *) - pos: cint64; - - (** - * Previous frame byte position. - *) - last_pos: cint64; - {$IFEND} - end; - - TAVCodecParser = record - codec_ids: array [0..4] of cint; (* several codec IDs are permitted *) - priv_data_size: cint; - parser_init: function(s: PAVCodecParserContext): cint; cdecl; - parser_parse: function(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: {const} PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint): cint; cdecl; - parser_close: procedure(s: PAVCodecParserContext); cdecl; - split: function(avctx: PAVCodecContext; buf: {const} PByteArray; - buf_size: cint): cint; cdecl; - next: PAVCodecParser; - end; - - -{$IF LIBAVCODEC_VERSION < 52000000} // 52.0.0 -{ -var - av_first_parser: PAVCodecParser; external av__codec; -} -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 51049000} // 51.49.0 -function av_parser_next(c: PAVCodecParser): PAVCodecParser; - cdecl; external av__codec; -{$IFEND} - -procedure av_register_codec_parser(parser: PAVCodecParser); - cdecl; external av__codec; - -function av_parser_init(codec_id: cint): PAVCodecParserContext; - cdecl; external av__codec; - -{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53} -function av_parser_parse(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52021000} // 52.21.0 -(** - * Parse a packet. - * - * @param s parser context. - * @param avctx codec context. - * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. - * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. - * @param buf input buffer. - * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). - * @param pts input presentation timestamp. - * @param dts input decoding timestamp. - * @param pos input byte position in stream. - * @return the number of bytes of the input bitstream used. - * - * Example: - * @code - * while (in_len) do - * begin - * len := av_parser_parse2(myparser, AVCodecContext, data, size, - * in_data, in_len, - * pts, dts, pos); - * in_data := in_data + len; - * in_len := in_len - len; - * - * if (size) then - * decode_frame(data, size); - * end; - * @endcode - *) -function av_parser_parse2(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; - poutbuf_size: PCint; - buf: {const} PByteArray; - buf_size: cint; - pts: cint64; - dts: cint64; - pos: cint64): cint; - cdecl; external av__codec; -{$IFEND} - -function av_parser_change(s: PAVCodecParserContext; - avctx: PAVCodecContext; - poutbuf: PPointer; poutbuf_size: PCint; - buf: {const} PByteArray; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; -procedure av_parser_close(s: PAVCodecParserContext); - cdecl; external av__codec; - -type - PAVBitStreamFilterContext = ^TAVBitStreamFilterContext; - PAVBitStreamFilter = ^TAVBitStreamFilter; - - TAVBitStreamFilterContext = record - priv_data: pointer; - filter: PAVBitStreamFilter; - parser: PAVCodecParserContext; - next: PAVBitStreamFilterContext; - end; - - TAVBitStreamFilter = record - name: PAnsiChar; - priv_data_size: cint; - filter: function(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: PByteArray; - poutbuf: PPointer; poutbuf_size: PCint; - buf: PByte; buf_size: cint; keyframe: cint): cint; cdecl; - {$IF LIBAVCODEC_VERSION >= 51043000} // 51.43.0 - close: procedure(bsfc: PAVBitStreamFilterContext); - {$IFEND} - next: PAVBitStreamFilter; - end; - -procedure av_register_bitstream_filter(bsf: PAVBitStreamFilter); - cdecl; external av__codec; - -function av_bitstream_filter_init(name: PAnsiChar): PAVBitStreamFilterContext; - cdecl; external av__codec; - -function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext; - avctx: PAVCodecContext; args: PByteArray; - poutbuf: PPointer; poutbuf_size: PCint; - buf: PByte; buf_size: cint; keyframe: cint): cint; - cdecl; external av__codec; - -procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext); - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION >= 51049000} // 51.49.0 -function av_bitstream_filter_next(f: PAVBitStreamFilter): PAVBitStreamFilter; - cdecl; external av__codec; -{$IFEND} - -(* memory *) - -(** - * Reallocate the given block if it is not large enough, otherwise do nothing. - * - * @see av_realloc - *) -procedure av_fast_realloc(ptr: pointer; size: PCuint; min_size: cuint); - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION >= 52025000} // >= 52.25.0 -(** - * Allocate a buffer, reusing the given one if large enough. - * - * Contrary to av_fast_realloc the current buffer contents might not be - * preserved and on error the old buffer is freed, thus no special - * handling to avoid memleaks is necessary. - * - * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer - * @param size size of the buffer *ptr points to - * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and - * *size 0 if an error occurred. - *) -procedure av_fast_malloc(ptr: pointer; size: PCuint; min_size: cuint); - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION < 51057000} // 51.57.0 -(* for static data only *) - -(** - * Frees all static arrays and resets their pointers to 0. - * Call this function to release all statically allocated tables. - * - * @deprecated. Code which uses av_free_static is broken/misdesigned - * and should correctly use static arrays - * - *) -procedure av_free_static(); - cdecl; external av__codec; deprecated; - -(** - * Allocation of static arrays. - * - * @warning Do not use for normal allocation. - * - * @param[in] size The amount of memory you need in bytes. - * @return block of memory of the requested size - * @deprecated. Code which uses av_mallocz_static is broken/misdesigned - * and should correctly use static arrays - *) -procedure av_mallocz_static(size: cuint); - cdecl; external av__codec; deprecated; {av_malloc_attrib av_alloc_size(1)} -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52085000} // 52.85.0 -(** - * Copy image data in src_data to dst_data. - * - * @param dst_linesize linesizes for the image in dst_data - * @param src_linesize linesizes for the image in src_data - *) -type - PQuaduint8Array = ^TQuaduint8Array; - TQuaduint8Array = array [0..3] of cuint8; - -procedure av_picture_data_copy(dst_data: PQuaduint8Array; dst_linesize: TQuadIntArray; - src_data: PQuaduint8Array; src_linesize: TQuadIntArray; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION < 51035000} // 51.35.0 -procedure av_realloc_static(ptr: pointer; size: cuint); - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 51039000} // 51.39.0 -(** - * Copy image src to dst. Wraps av_picture_data_copy() above. - *) -procedure av_picture_copy(dst: PAVPicture; - src: {const} PAVPicture; -{$IF LIBAVCODEC_VERSION < 52022001} // 52.22.1 - pix_fmt: cint; -{$ELSE} - pix_fmt: TAVPixelFormat; -{$IFEND} - width: cint; - height: cint); - cdecl; external av__codec; - -(** - * Crop image top and left side. - *) -function av_picture_crop(dst: PAVPicture; - src: {const} PAVPicture; -{$IF LIBAVCODEC_VERSION < 52022001} // 52.22.1 - pix_fmt: cint; -{$ELSE} - pix_fmt: TAVPixelFormat; -{$IFEND} - top_band: cint; - left_band: cint): cint; - cdecl; external av__codec; - -(** - * Pad image. - *) -function av_picture_pad(dst: PAVPicture; - src: {const} PAVPicture; - height: cint; - width: cint; -{$IF LIBAVCODEC_VERSION < 52022001} // 52.22.1 - pix_fmt: cint; -{$ELSE} - pix_fmt: TAVPixelFormat; -{$IFEND} - padtop: cint; - padbottom: cint; - padleft: cint; - padright: - cint; - color: PCint): cint; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION < 52000000} // 52.0.0 -(** - * @deprecated Use the software scaler (swscale) instead. - *) -procedure img_copy(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; width: cint; height: cint); - cdecl; external av__codec; deprecated; - -(** - * @deprecated Use the software scaler (swscale) instead. - *) -function img_crop(dst: PAVPicture; src: {const} PAVPicture; - pix_fmt: TAVPixelFormat; top_band, left_band: cint): cint; - cdecl; external av__codec; deprecated; - -(** - * @deprecated Use the software scaler (swscale) instead. - *) -function img_pad(dst: PAVPicture; src: {const} PAVPicture; height, width: cint; - pix_fmt: TAVPixelFormat; padtop, padbottom, padleft, padright: cint; - color: PCint): cint; - cdecl; external av__codec; deprecated; -{$IFEND} - -(** - * Encode extradata length to a buffer. Used by xiph codecs. - * - * @param s buffer to write to; must be at least (v/255+1) bytes long - * @param v size of extradata in bytes - * @return number of bytes written to the buffer. - *) -function av_xiphlacing(s: PByte; v: cuint): cuint; - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} // < 53 -{$IF LIBAVCODEC_VERSION >= 51041000} // >= 51.41.0 -(** - * Parse str and put in width_ptr and height_ptr the detected values. - * -{$IF LIBAVCODEC_VERSION >= 52084001} // >= 52.84.1 - * @deprecated Deprecated in favor of av_parse_video_size(). -{$ELSE} - * @return 0 in case of a successful parsing, a negative value otherwise - * @param[in] str the string to parse: it has to be a string in the format - * width x height or a valid video frame size abbreviation. - * @param[in,out] width_ptr pointer to the variable which will contain the detected - * frame width value - * @param[in,out] height_ptr pointer to the variable which will contain the detected - * frame height value -{$IFEND} - *) -function av_parse_video_frame_size(width_ptr: PCint; height_ptr: PCint; str: {const} PAnsiChar): cint; - cdecl; external av__codec; -{$IF LIBAVCODEC_VERSION >= 52084001} // >= 52.84.1 - deprecated; -{$IFEND} - -(** - * Parse str and store the detected values in *frame_rate. - * -{$IF LIBAVCODEC_VERSION >= 52084001} // >= 52.84.1 - * @deprecated Deprecated in favor of av_parse_video_rate(). -{$ELSE} - * @return 0 in case of a successful parsing, a negative value otherwise - * @param[in] str the string to parse: it has to be a string in the format - * frame_rate_num / frame_rate_den, a float number or a valid video rate abbreviation - * @param[in,out] frame_rate pointer to the AVRational which will contain the detected - * frame rate -{$IFEND} - *) -function av_parse_video_frame_rate(frame_rate: PAVRational; str: {const} PAnsiChar): cint; - cdecl; external av__codec; -{$IF LIBAVCODEC_VERSION >= 52084001} // >= 52.84.1 - deprecated; -{$IFEND} -{$IFEND} -{$IFEND} - -{$IF LIBAVCODEC_VERSION < 52059000} // <52.59.0 - -{ - The following error codes are moved to libavutil/error.h on - revision 22501 Mar 13 2010 -} - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EINVAL > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - AVERROR_UNKNOWN = AVERROR_SIGN * EINVAL; (**< unknown error *) - AVERROR_IO = AVERROR_SIGN * EIO; (**< I/O error *) - AVERROR_NUMEXPECTED = AVERROR_SIGN * EDOM; (**< Number syntax expected in filename. *) - AVERROR_INVALIDDATA = AVERROR_SIGN * EINVAL; (**< invalid data found *) - AVERROR_NOMEM = AVERROR_SIGN * ENOMEM; (**< not enough memory *) - AVERROR_NOFMT = AVERROR_SIGN * EILSEQ; (**< unknown format *) - AVERROR_NOTSUPP = AVERROR_SIGN * ENOSYS; (**< Operation not supported. *) - AVERROR_NOENT = AVERROR_SIGN * ENOENT; (**< No such file or directory. *) -{$IF LIBAVCODEC_VERSION >= 52017000} // 52.17.0 - AVERROR_EOF = AVERROR_SIGN * EPIPE; (**< End of file. *) -{$IFEND} - // Note: function calls as constant-initializers are invalid - //AVERROR_PATCHWELCOME = -MKTAG('P','A','W','E'); {**< Not yet implemented in FFmpeg. Patches welcome. *} - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52032000} // >= 52.32.0 -(** - * Log a generic warning message about a missing feature. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] feature string containing the name of the missing feature - * @param[in] want_sample indicates if samples are wanted which exhibit this feature. - * If want_sample is non-zero, additional verbage will be added to the log - * message which tells the user how to report samples to the development - * mailing list. - *) -procedure av_log_missing_feature(avc: Pointer; feature: {const} Pchar; want_sample: cint); - cdecl; external av__codec; - -(** - * Log a generic warning message asking for a sample. This function is - * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) - * only, and would normally not be used by applications. - * @param[in] avc a pointer to an arbitrary struct of which the first field is - * a pointer to an AVClass struct - * @param[in] msg string containing an optional message, or NULL if no message - *) -procedure av_log_ask_for_sample(avc: Pointer; msg: {const} Pchar); - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52018000} // 52.18.0 -(** - * Register the hardware accelerator hwaccel. - *) -procedure av_register_hwaccel (hwaccel: PAVHWAccel) - cdecl; external av__codec; - -(** - * If hwaccel is NULL, returns the first registered hardware accelerator, - * if hwaccel is non-NULL, returns the next registered hardware accelerator - * after hwaccel, or NULL if hwaccel is the last one. - *) -function av_hwaccel_next (hwaccel: PAVHWAccel): PAVHWAccel; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52030000} // 52.30.0 -(** - * Lock operation used by lockmgr - *) -type - TAVLockOp = ( - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY ///< Free mutex resources - ); - -(** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. mutex points to a (void) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - *) -// ToDo: Implement and test this -//function av_lockmgr_register(cb: function (mutex: pointer; op: TAVLockOp)): cint; -// cdecl; external av__codec; -{$IFEND} - -implementation - -{$IF (LIBAVCODEC_VERSION >= 52025000) and (LIBAVCODEC_VERSION <= 52027000)} // 52.25.0 - 52.27.0 -procedure av_free_packet(pkt: PAVPacket);{$IFDEF HASINLINE} inline; {$ENDIF} -begin - if assigned(pkt) then - begin - if assigned(pkt^.destruct) then - pkt^.destruct(pkt); - pkt^.data := NIL; - pkt^.size := 0; - end; -end; -{$IFEND} - -end. diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas deleted file mode 100644 index bd13c70e..00000000 --- a/src/lib/ffmpeg/avformat.pas +++ /dev/null @@ -1,2100 +0,0 @@ -(* - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avformat.h - * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.78.3, revision 24841, Thu Aug 26 02:00:00 2010 CET - *) - -unit avformat; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} (* for the HasInline define *) - -{$IFDEF DARWIN} - {$linklib libavformat} -{$ENDIF} - -interface - -uses - ctypes, - avcodec, - avutil, - avio, - rational, - SysUtils, - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Max. supported version by this header *) - LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 78; - LIBAVFORMAT_MAX_VERSION_RELEASE = 3; - LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVFORMAT_MIN_VERSION_MAJOR = 50; - LIBAVFORMAT_MIN_VERSION_MINOR = 5; - LIBAVFORMAT_MIN_VERSION_RELEASE = 0; - LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is too old!'} -{$IFEND} - -(* Check if linked versions are supported *) -{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52078003} // >= 52.78.3 -(** - * Those FF_API_* defines are not part of public API. - * They may change, break or disappear at any time. - *) -const - {$IF LIBAVFORMAT_VERSION_MAJOR < 53} - FF_API_MAX_STREAMS = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_OLD_METADATA = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_REGISTER_PROTOCOL = (LIBAVFORMAT_VERSION_MAJOR < 53); - FF_API_URL_RESETBUF = (LIBAVFORMAT_VERSION_MAJOR < 53); - {$ELSE} - FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); - {$IFEND} -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52020000} // 52.20.0 -(** - * I return the LIBAVFORMAT_VERSION_INT constant. You got - * a fucking problem with that, douchebag? - *) -function avformat_version(): cuint; - cdecl; external av__format; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52039002} // 52.39.2 -(** - * Return the libavformat build-time configuration. - *) -function avformat_configuration(): {const} PansiChar; - cdecl; external av__format; - -(** - * Return the libavformat license. - *) -function avformat_license(): {const} PansiChar; - cdecl; external av__format; -{$IFEND} - -type - PAVFile = Pointer; - -(* - * Public Metadata API. - * The metadata API allows libavformat to export metadata tags to a client - * application using a sequence of key/value pairs. Like all strings in FFmpeg, - * metadata must be stored as UTF-8 encoded Unicode. Note that metadata - * exported by demuxers isn't checked to be valid UTF-8 in most cases. - * Important concepts to keep in mind: - * 1. Keys are unique; there can never be 2 tags with the same key. This is - * also meant semantically, i.e., a demuxer should not knowingly produce - * several keys that are literally different but semantically identical. - * E.g., key=Author5, key=Author6. In this example, all authors must be - * placed in the same tag. - * 2. Metadata is flat, not hierarchical; there are no subtags. If you - * want to store, e.g., the email address of the child of producer Alice - * and actor Bob, that could have key=alice_and_bobs_childs_email_address. - * 3. A tag whose value is localized for a particular language is appended - * with a dash character ('-') and the ISO 639-2/B 3-letter language code. - * For example: Author-ger=Michael, Author-eng=Mike - * The original/default language is in the unqualified "Author" tag. - * A demuxer should set a default if it sets any translated tag. - *) -const - AV_METADATA_MATCH_CASE = 1; - AV_METADATA_IGNORE_SUFFIX = 2; -{$IF LIBAVFORMAT_VERSION >= 52043000} // >= 52.43.0 - AV_METADATA_DONT_STRDUP_KEY = 4; - AV_METADATA_DONT_STRDUP_VAL = 8; -{$IFEND} -{$IF LIBAVFORMAT_VERSION >= 52061000} // >= 52.61.0 - AV_METADATA_DONT_OVERWRITE = 16; -{$IFEND} - -type - PAVMetadataTag = ^TAVMetadataTag; - TAVMetadataTag = record - key: PAnsiChar; - value: PAnsiChar; - end; - - PAVMetadata = Pointer; - -{$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 -(** - * Get a metadata element with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found tag or NULL, changing key or value leads to undefined behavior. - *) -function av_metadata_get(m: PAVMetadata; key: {const} PAnsiChar; - prev: {const} PAVMetadataTag ; flags: cint): PAVMetadataTag; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 -(** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped) - * @param value tag value to add to *pm (will be av_strduped) - * @return >= 0 on success otherwise an error code <0 - * @deprecated Use av_metadata_set2() instead. - *) -function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar): cint; - cdecl; external av__format; - {$IF LIBAVFORMAT_VERSION >= 52061000} // >= 52.61.0 - deprecated; - {$IFEND} -{$ELSE} - {$IFDEF FF_API_OLD_METADATA} -(** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped) - * @param value tag value to add to *pm (will be av_strduped) - * @return >= 0 on success otherwise an error code <0 - * @deprecated Use av_metadata_set2() instead. - *) -function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar): cint; - cdecl; external av__format; deprecated; - {$ENDIF} -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52043000} // >= 52.43.0 -(** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped depending on flags) - * @param value tag value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - *) -function av_metadata_set2(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar; flags: cint): cint; - cdecl; external av__format; -{$IFEND} - -(** - * Free all the memory allocated for an AVMetadata struct. - *) -procedure av_metadata_free(var m: PAVMetadata); - cdecl; external av__format; -{$IFEND} - -(* packet functions *) - -{$IF LIBAVFORMAT_VERSION < 52032000} // < 52.32.0 -type - PAVPacket = ^TAVPacket; - TAVPacket = record - (** - * Presentation timestamp in time_base units; the time at which the - * decompressed packet will be presented to the user. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - * pts MUST be larger or equal to dts as presentation can not happen before - * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different. Such timestamps - * must be converted to true pts/dts before they are stored in AVPacket. - *) - pts: cint64; - (** - * Decompression timestamp in time_base units; the time at which the - * packet is decompressed. - * Can be AV_NOPTS_VALUE if it is not stored in the file. - *) - dts: cint64; - data: PByteArray; - size: cint; - stream_index: cint; - flags: cint; - (** - * Duration of this packet in time_base units, 0 if unknown. - * Equals next_pts - this_pts in presentation order. - *) - duration: cint; - destruct: procedure (p: PAVPacket); cdecl; - priv: pointer; - pos: cint64; ///< byte position in stream, -1 if unknown - - {$IF LIBAVFORMAT_VERSION >= 52022000} // 52.22.0 - (** - * Time difference in stream time base units from the pts of this - * packet to the point at which the output from the decoder has converged - * independent from the availability of previous frames. That is, the - * frames are virtually identical no matter if decoding started from - * the very first frame or from this keyframe. - * Is AV_NOPTS_VALUE if unknown. - * This field is not the display duration of the current packet. - * - * The purpose of this field is to allow seeking in streams that have no - * keyframes in the conventional sense. It corresponds to the - * recovery point SEI in H.264 and match_time_delta in NUT. It is also - * essential for some types of subtitle streams to ensure that all - * subtitles are correctly displayed after seeking. - *) - convergence_duration: cint64; - {$IFEND} - end; - -const - PKT_FLAG_KEY = $0001; - -procedure av_destruct_packet_nofree(var pkt: TAVPacket); - cdecl; external av__format; - -(** - * Default packet destructor. - *) -procedure av_destruct_packet(var pkt: TAVPacket); - cdecl; external av__format; - -(** - * Initialize optional fields of a packet with default values. - * - * @param pkt packet - *) -procedure av_init_packet(var pkt: TAVPacket); -{$IF LIBAVFORMAT_VERSION >= 51012002} // 51.12.2 - cdecl; external av__format; -{$IFEND} - -(** - * Allocate the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size wanted payload size - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_new_packet(var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate and read the payload of a packet and initialize its fields with - * default values. - * - * @param pkt packet - * @param size desired payload size - * @return >0 (read size) if OK, AVERROR_xxx otherwise - *) -function av_get_packet(s: PByteIOContext; var pkt: TAVPacket; size: cint): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION < 52032000} // < 52.32.0 -(** - * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated. - *) -function av_dup_packet(pkt: PAVPacket): cint; - cdecl; external av__format; - -(** - * Free a packet. - * - * @param pkt packet to free - *) -procedure av_free_packet(pkt: PAVPacket); {$IFDEF HasInline}inline;{$ENDIF} -{$IFEND} - -(*************************************************) -(* fractional numbers for exact pts handling *) - -type - (** - * The exact value of the fractional number is: 'val + num / den'. - * num is assumed to be 0 <= num < den. - *) - PAVFrac = ^TAVFrac; - TAVFrac = record - val, num, den: cint64; - end; - -(*************************************************) -(* input/output formats *) - -type - (** - * This structure contains the data a format has to probe a file. - *) - TAVProbeData = record - filename: PAnsiChar; - buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) - buf_size: cint; (**< Size of buf except extra allocated bytes *) - end; - -const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection - AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - - //! Demuxer will use url_fopen, no opened file should be provided by the caller. - AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) - AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) - AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for - raw picture data. *) - AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) - AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) - AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) - AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) - {$IF LIBAVFORMAT_VERSION >= 52029002} // 52.29.2 - AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52052000} // 52.52.0 - AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) - {$IFEND} - - // used by AVIndexEntry - AVINDEX_KEYFRAME = $0001; - - AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present - (streams are added dynamically) *) - -{$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 - {$IF LIBAVFORMAT_VERSION_MAJOR < 53} - MAX_STREAMS = 20; - {$ELSE} - {$IF LIBAVFORMAT_VERSION < 52068000} // < 52.68.0 - MAX_STREAMS = 100; - {$IFEND} - {$IFEND} -{$ELSE} - {$IFDEF FF_API_MAX_STREAMS} - MAX_STREAMS = 20; - {$ENDIF} -{$IFEND} - - - AVFMT_NOOUTPUTLOOP = -1; - AVFMT_INFINITEOUTPUTLOOP = 0; - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. - AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. -{$IF LIBAVFORMAT_VERSION >= 52048000} // >= 52.48.0 - AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS -{$IFEND} -{$IF LIBAVFORMAT_VERSION >= 52060000} // >= 52.60.0 - AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container - AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled -{$IFEND} -{$IF LIBAVFORMAT_VERSION >= 52063000} // >= 52.63.0 - AVFMT_FLAG_RTP_HINT = $0040; ///< Add RTP hinting to the output file -{$IFEND} - - // used by AVStream - MAX_REORDER_DELAY = 16; - - // used by TAVProgram - AV_PROGRAM_RUNNING = 1; - - - AV_DISPOSITION_DEFAULT = $0001; - AV_DISPOSITION_DUB = $0002; - AV_DISPOSITION_ORIGINAL = $0004; - AV_DISPOSITION_COMMENT = $0008; - AV_DISPOSITION_LYRICS = $0010; - AV_DISPOSITION_KARAOKE = $0020; - - {$IF LIBAVFORMAT_VERSION >= 52073000} // >= 52.73.0 - (** - * Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) - AV_DISPOSITION_FORCED = $0040; - {$IFEND} - - // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; - - {$IF LIBAVFORMAT_VERSION >= 52034000} // >= 52.34.0 - {$IF LIBAVFORMAT_VERSION < 52039000} // < 52.39.0 - MAX_PROBE_PACKETS = 100; - {$ELSE} - MAX_PROBE_PACKETS = 2500; - {$IFEND} - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52035000} // >= 52.35.0 - {$IF LIBAVFORMAT_VERSION < 52039000} // < 52.39.0 - RAW_PACKET_BUFFER_SIZE = 32000; - {$ELSE} - RAW_PACKET_BUFFER_SIZE = 2500000; - {$IFEND} - {$IFEND} - -type - PPAVCodecTag = ^PAVCodecTag; - PAVCodecTag = Pointer; - - PPAVFormatContext = ^PAVFormatContext; - PAVFormatContext = ^TAVFormatContext; - - PAVFormatParameters = ^TAVFormatParameters; - - PAVOutputFormat = ^TAVOutputFormat; - PAVProbeData = ^TAVProbeData; - - PAVInputFormat = ^TAVInputFormat; - PAVIndexEntry = ^TAVIndexEntry; - - PAVStream = ^TAVStream; - PAVPacketList = ^TAVPacketList; - - PPAVProgram = ^PAVProgram; - PAVProgram = ^TAVProgram; - - {$IF LIBAVFORMAT_VERSION < 51006000} // 51.6.0 - PAVImageFormat = ^TAVImageFormat; - PAVImageInfo = ^TAVImageInfo; - {$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; -{$IFEND} - - PAVChapter = ^TAVChapter; - TAVChapter = record - id: cint; ///< unique ID to identify the chapter - time_base: TAVRational; ///< time base in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units - {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 - title: PAnsiChar; ///< chapter title - {$ELSE} - {$IFDEF FF_API_OLD_METADATA} - title: PAnsiChar; ///< chapter title - {$ENDIF} - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 - metadata: PAVMetadata; - {$IFEND} - end; - TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; - PAVChapterArray = ^TAVChapterArray; - - TAVFormatParameters = record - time_base: TAVRational; - sample_rate: cint; - channels: cint; - width: cint; - height: cint; - pix_fmt: TAVPixelFormat; - {$IF LIBAVFORMAT_VERSION < 51006000} // 51.6.0 - image_format: PAVImageFormat; - {$IFEND} - channel: cint; (**< Used to select DV channel. *) - {$IF LIBAVFORMAT_VERSION_MAJOR < 52} - device: PAnsiChar; (* video, audio or DV device, if LIBAVFORMAT_VERSION_INT < (52<<16) *) - {$IFEND} - standard: PAnsiChar; (**< TV standard, NTSC, PAL, SECAM *) - { Delphi does not support bit fields -> use bf_flags instead - unsigned int mpeg2ts_raw:1; (**< Force raw MPEG-2 transport stream output, if possible. *) - unsigned int mpeg2ts_compute_pcr:1; (**< Compute exact PCR for each transport - stream packet (only meaningful if - mpeg2ts_raw is TRUE). *) - unsigned int initial_pause:1; (**< Do not begin to play the stream - immediately (RTSP only). *) - unsigned int prealloced_context:1; - } - bf_flags: byte; // 0:mpeg2ts_raw/1:mpeg2ts_compute_pcr/2:initial_pause/3:prealloced_context - {$IF LIBAVFORMAT_VERSION_MAJOR < 53} - video_codec_id: TCodecID; - audio_codec_id: TCodecID; - {$IFEND} - end; - - TAVOutputFormat = record - name: PAnsiChar; - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - mime_type: PAnsiChar; - extensions: PAnsiChar; (**< comma-separated filename extensions *) - (** - * size of private data so that it can be allocated in the wrapper - *) - priv_data_size: cint; - (* output support *) - audio_codec: TCodecID; (**< default audio codec *) - video_codec: TCodecID; (**< default video codec *) - write_header: function (c: PAVFormatContext): cint; cdecl; - write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; - write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** - * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER - *) - flags: cint; - (** - * Currently only used to set pixel format if not YUV420P. - *) - set_parameters: function (c: PAVFormatContext; f: PAVFormatParameters): cint; cdecl; - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; - in_: PAVPacket; flush: cint): cint; cdecl; - - {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 - (** - * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all terminated by CODEC_ID_NONE. - *) - codec_tag: {const} PPAVCodecTag; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 51012002} // 51.12.2 - subtitle_codec: TCodecID; (**< default subtitle codec *) - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52030001} // 52.30.1 - {const} metadata_conv: PAVMetadataConv; - {$IFEND} - - (* private fields *) - next: PAVOutputFormat; - end; - - TAVInputFormat = record - (** - * A comma separated list of short names for the format. New names - * may be appended with a minor bump. - *) - name: PAnsiChar; - - (** - * Descriptive name for the format, meant to be more human-readable - * than name. You should use the NULL_IF_CONFIG_SMALL() macro - * to define it. - *) - long_name: PAnsiChar; - - (** - * Size of private data so that it can be allocated in the wrapper. - *) - priv_data_size: cint; - - (** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - *) - read_probe: function (p: PAVProbeData): cint; cdecl; - - (** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. 'ap' if non-NULL contains - * additional parameters. Only used in raw format right - * now. 'av_new_stream' should be called to create new streams. - *) - read_header: function (c: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; - - (** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'av_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used. - * @return 0 on success, < 0 on error. - * When returning an error, pkt must not have been allocated - * or must be freed before returning - *) - read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - - (** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - *) - read_close: function (c: PAVFormatContext): cint; cdecl; - -{$IF LIBAVFORMAT_VERSION_MAJOR < 53} - (** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - *) - read_seek: function (c: PAVFormatContext; stream_index: cint; - timestamp: cint64; flags: cint): cint; cdecl; -{$IFEND} - - (** - * Gets the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - *) - read_timestamp: function (s: PAVFormatContext; stream_index: cint; - pos: pint64; pos_limit: cint64): cint64; cdecl; - - (** - * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. - *) - flags: cint; - - (** - * If extensions are defined, then no probe is done. You should - * usually not use extension format guessing because it is not - * reliable enough - *) - extensions: PAnsiChar; - - (** - * General purpose read-only value that the format can use. - *) - value: cint; - - (** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - *) - read_play: function (c: PAVFormatContext): cint; cdecl; - - (** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - *) - read_pause: function (c: PAVFormatContext): cint; cdecl; - - {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 - codec_tag: {const} PPAVCodecTag; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52030000} // 52.30.0 - (** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - *) - read_seek2: function (s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; cdecl; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52030001} // 52.30.1 - {const} metadata_conv: PAVMetadataConv; - {$IFEND} - - (* private fields *) - next: PAVInputFormat; - end; - - TAVStreamParseType = ( - AVSTREAM_PARSE_NONE, - AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) - AVSTREAM_PARSE_TIMESTAMPS (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) - {$IF LIBAVFORMAT_VERSION >= 52066000} // 52.66.0 - , AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - {$IFEND} - ); - - TAVIndexEntry = record - pos: cint64; - timestamp: cint64; - { Delphi doesn't support bitfields -> use flags_size instead - int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). - } - flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) - end; - - (** - * Stream structure. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVStream) must not be used outside libav*. - *) - TAVStream = record - index: cint; (**< stream index in AVFormatContext *) - id: cint; (**< format-specific stream ID *) - codec: PAVCodecContext; (**< codec context *) - (** - * Real base framerate of the stream. - * This is the lowest framerate with which all timestamps can be - * represented accurately (it is the least common multiple of all - * framerates in the stream). Note, this value is just a guess! - * For example, if the time base is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. - *) - r_frame_rate: TAVRational; - priv_data: pointer; - - (* internal data used in av_find_stream_info() *) - first_dts: cint64; - {$IF LIBAVFORMAT_VERSION_MAJOR < 52} - codec_info_nb_frames: cint; - {$IFEND} - - (** - * encoding: pts generation when outputting stream - *) - pts: TAVFrac; - (** - * This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * time base should be 1/framerate and timestamp increments should be 1. - *) - time_base: TAVRational; - pts_wrap_bits: cint; (* number of bits in pts (used for wrapping control) *) - (* ffmpeg.c private use *) - stream_copy: cint; (**< If set, just copy stream. *) - discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. - //FIXME move stuff to a flags field? - (** - * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. - * MN:dunno if thats the right place, for it - *) - quality: cfloat; - - (** - * Decoding: pts of the first frame of the stream, in stream time base. - * Only set this if you are absolutely 100% sure that the value you set - * it to really is the pts of the first frame. - * This may be undefined (AV_NOPTS_VALUE). - * @note The ASF header does NOT contain a correct start_time the ASF - * demuxer must NOT set this. - *) - start_time: cint64; - - (** - * Decoding: duration of the stream, in stream time base. - * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimated from bitrate and file size. - *) - duration: cint64; - - {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 - language: array [0..3] of PAnsiChar; (**< ISO 639-2/B 3-letter language code (empty string if undefined) *) - {$ELSE} - {$IFDEF FF_API_OLD_METADATA} - language: array [0..3] of PAnsiChar; (**< ISO 639-2/B 3-letter language code (empty string if undefined) *) - {$ENDIF} - {$IFEND} - - (* av_read_frame() support *) - need_parsing: TAVStreamParseType; - parser: PAVCodecParserContext; - - cur_dts: cint64; - last_IP_duration: cint; - last_IP_pts: cint64; - (* av_seek_frame() support *) - index_entries: PAVIndexEntry; (**< Only used if the format does not - support seeking natively. *) - nb_index_entries: cint; - index_entries_allocated_size: cuint; - - nb_frames: cint64; ///< number of frames in this stream if known or 0 - - {$IF (LIBAVFORMAT_VERSION >= 50006000) and (LIBAVFORMAT_VERSION_MAJOR < 53)} // 50.6.0 - 53.0.0 - unused: array [0..4] of cint64; - {$IFEND} - - {$IF (LIBAVFORMAT_VERSION >= 52006000) and (LIBAVFORMAT_VERSION < 52078003)} // 52.6.0 - 52.78.2 - filename: PAnsiChar; (**< source filename of the stream *) - {$ELSE} - {$IFDEF FF_API_OLD_METADATA} - filename: PAnsiChar; (**< source filename of the stream *) - {$ENDIF} - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52008000} // 52.8.0 - disposition: cint; (**< AV_DISPOSITION_* bitfield *) - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52019000} // 52.19.0 - probe_data: TAVProbeData; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52021000} // 52.21.0 - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; - - (** - * sample aspect ratio (0 if unknown) - * - encoding: Set by user. - * - decoding: Set by libavformat. - *) - sample_aspect_ratio: TAVRational; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 - metadata: PAVMetadata; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 - {* Intended mostly for av_read_frame() support. Not supposed to be used by *} - {* external applications; try to use something else if at all possible. *} - cur_ptr: {const} PCuint8; - cur_len: cint; - cur_pkt: TAVPacket; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52030000} // > 52.30.0 - // Timestamp generation support: - (** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - *) - reference_dts: cint64; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52034000} // >= 52.34.0 - (** - * Number of packets to buffer for codec probing - * NOT PART OF PUBLIC API - *) - probe_packets: cint; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52038000} // >= 52.38.0 - (** - * last packet in packet_buffer for this stream when muxing. - * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav* - *) - last_in_packet_buffer: PAVPacketList; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52041000} // >= 52.41.0 - (** - * Average framerate - *) - avg_frame_rate: TAVRational; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52054000} // >= 52.54.0 - (** - * Number of frames that have been demuxed during av_find_stream_info() - *) - codec_info_nb_frames: cint; - {$IFEND} - end; - - (** - * Format I/O context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVFormatContext) must not be used outside libav*. - *) - TAVFormatContext = record - av_class: PAVClass; (**< Set by avformat_alloc_context. *) - (* Can only be iformat or oformat, not both at the same time. *) - iformat: PAVInputFormat; - oformat: PAVOutputFormat; - priv_data: pointer; - - {$IF LIBAVFORMAT_VERSION_MAJOR >= 52} - pb: PByteIOContext; - {$ELSE} - pb: TByteIOContext; - {$IFEND} - - nb_streams: cuint; - streams: array [0..MAX_STREAMS - 1] of PAVStream; - filename: array [0..1023] of AnsiChar; (* input or output filename *) - (* stream info *) - timestamp: cint64; - {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 - title: array [0..511] of AnsiChar; - author: array [0..511] of AnsiChar; - copyright: array [0..511] of AnsiChar; - comment: array [0..511] of AnsiChar; - album: array [0..511] of AnsiChar; - year: cint; (**< ID3 year, 0 if none *) - track: cint; (**< track number, 0 if none *) - genre: array [0..31] of AnsiChar; (**< ID3 genre *) - {$ELSE} - {$IFDEF FF_API_OLD_METADATA} - title: array [0..511] of AnsiChar; - author: array [0..511] of AnsiChar; - copyright: array [0..511] of AnsiChar; - comment: array [0..511] of AnsiChar; - album: array [0..511] of AnsiChar; - year: cint; (**< ID3 year, 0 if none *) - track: cint; (**< track number, 0 if none *) - genre: array [0..31] of AnsiChar; (**< ID3 genre *) - {$ENDIF} - {$IFEND} - - ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) - (* private data for pts handling (do not modify directly). *) - (** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - *) - packet_buffer: PAVPacketList; - - (** - * Decoding: position of the first frame of the component, in - * AV_TIME_BASE fractional seconds. NEVER set this value directly: - * It is deduced from the AVStream values. - *) - start_time: cint64; - (** - * Decoding: duration of the stream, in AV_TIME_BASE fractional - * seconds. Only set this value if you know none of the individual stream - * durations and also dont set any of them. This is deduced from the - * AVStream values if not set. - *) - duration: cint64; - (** - * decoding: total file size, 0 if unknown - *) - file_size: cint64; - (** - * Decoding: total stream bitrate in bit/s, 0 if not - * available. Never set it directly if the file_size and the - * duration are known as ffmpeg can compute it automatically. - *) - bit_rate: cint; - - (* av_read_frame() support *) - cur_st: PAVStream; - {$IF LIBAVFORMAT_VERSION_MAJOR < 53} - cur_ptr_deprecated: pbyte; - cur_len_deprecated: cint; - cur_pkt_deprecated: TAVPacket; - {$IFEND} - - (* av_seek_frame() support *) - data_offset: cint64; (**< offset of the first packet *) - index_built: cint; - - mux_rate: cint; - {$IF LIBAVFORMAT_VERSION < 52034001} // < 52.34.1 - packet_size: cint; - {$ELSE} - packet_size: cuint; - {$IFEND} - preload: cint; - max_delay: cint; - - (** - * number of times to loop output in formats that support it - *) - loop_output: cint; - - flags: cint; - loop_input: cint; - - {$IF LIBAVFORMAT_VERSION >= 50006000} // 50.6.0 - (** - * decoding: size of data to probe; encoding: unused. - *) - probesize: cuint; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 51009000} // 51.9.0 - (** - * Maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in av_find_stream_info(). - *) - max_analyze_duration: cint; - - key: pbyte; - keylen : cint; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 51014000} // 51.14.0 - nb_programs: cuint; - programs: PPAVProgram; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 - (** - * Forced video codec_id. - * Demuxing: Set by user. - *) - video_codec_id: TCodecID; - - (** - * Forced audio codec_id. - * Demuxing: Set by user. - *) - audio_codec_id: TCodecID; - - (** - * Forced subtitle codec_id. - * Demuxing: Set by user. - *) - subtitle_codec_id: TCodecID; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 - (** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * muxing : unused - * demuxing: set by user - *) - max_index_size: cuint; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52009000} // 52.9.0 - (** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - *) - max_picture_buffer: cuint; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52014000} // 52.14.0 - nb_chapters: cuint; - chapters: PAVChapterArray; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52016000} // 52.16.0 - (** - * Flags to enable debugging. - *) - debug: cint; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52019000} // 52.19.0 - (** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - *) - raw_packet_buffer: PAVPacketList; - raw_packet_buffer_end: PAVPacketList; - - packet_buffer_end: PAVPacketList; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 - metadata: PAVMetadata; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52035000} // 52.35.0 - (** - * Remaining size available for raw_packet_buffer, in bytes. - * NOT PART OF PUBLIC API - *) - raw_packet_buffer_remaining_size: cint; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52056000} // 52.56.0 - (** - * Start time of the stream in real world time, in microseconds - * since the unix epoch (00:00 1st January 1970). That is, pts=0 - * in the stream was captured at this real world time. - * - encoding: Set by user. - * - decoding: Unused. - *) - start_time_realtime: cint64; - {$IFEND} - - end; - - (** - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(AVProgram) must not be used outside libav*. - *) - TAVProgram = record - id : cint; - {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 - provider_name : PAnsiChar; ///< network name for DVB streams - name : PAnsiChar; ///< service name for DVB streams - {$ELSE} - {$IFDEF FF_API_OLD_METADATA} - provider_name : PAnsiChar; ///< network name for DVB streams - name : PAnsiChar; ///< service name for DVB streams - {$ENDIF} - {$IFEND} - flags : cint; - discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller - {$IF LIBAVFORMAT_VERSION >= 51016000} // 51.16.0 - stream_index : PCardinal; - nb_stream_indexes : PCardinal; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 - metadata: PAVMetadata; - {$IFEND} - end; - - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; - -{$IF LIBAVFORMAT_VERSION < 51006000} // 51.6.0 - (* still image support *) - PAVInputImageContext = pointer; {deprecated} - - (* still image support *) - TAVImageInfo = record - pix_fmt: TAVPixelFormat; (* requested pixel format *) - width: cint; (* requested width *) - height: cint; (* requested height *) - interleaved: cint; (* image is interleaved (e.g. interleaved GIF) *) - pict: TAVPicture; (* returned allocated image *) - end; {deprecated} - - TAVImageFormat = record - name: PAnsiChar; - extensions: PAnsiChar; - (* tell if a given file has a chance of being parsing by this format *) - img_probe: function (d: PAVProbeData): cint; cdecl; - (* read a whole image. 'alloc_cb' is called when the image size is - known so that the caller can allocate the image. If 'allo_cb' - returns non zero, then the parsing is aborted. Return '0' if - OK. *) - img_read: function (b: PByteIOContext; alloc_cb: pointer; ptr: pointer): cint; cdecl; - (* write the image *) - supported_pixel_formats: cint; (* mask of supported formats for output *) - img_write: function (b: PByteIOContext; i: PAVImageInfo): cint; cdecl; - flags: cint; - next: PAVImageFormat; - end; {deprecated} - -procedure av_register_image_format(img_fmt: PAVImageFormat); - cdecl; external av__format; deprecated; - -function av_probe_image_format(pd: PAVProbeData): PAVImageFormat; - cdecl; external av__format; deprecated; - -function guess_image_format(filename: PAnsiChar): PAVImageFormat; - cdecl; external av__format; deprecated; - -function av_read_image(pb: PByteIOContext; filename: PAnsiChar; - fmt: PAVImageFormat; - alloc_cb: pointer; opaque: pointer): cint; - cdecl; external av__format; deprecated; - -function av_write_image(pb: PByteIOContext; fmt: PAVImageFormat; img: PAVImageInfo): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. If one of the tables is NULL, then - * tags are converted to/from ffmpeg generic tag names. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) -procedure av_metadata_conv(ctx: PAVFormatContext; {const} d_conv: PAVMetadataConv; - {const} s_conv: PAVMetadataConv); - cdecl; external av__format; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION_MAJOR < 53} -{ -var - first_iformat: PAVInputFormat; external av__format; - first_oformat: PAVOutputFormat; external av__format; -} -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 -(** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_iformat_next(f: PAVInputFormat): PAVInputFormat; - cdecl; external av__format; -(** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - *) -function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; - cdecl; external av__format; -{$IFEND} - -function av_guess_image2_codec(filename: {const} PAnsiChar): TCodecID; - cdecl; external av__format; - -(* XXX: Use automatic init with either ELF sections or C file parser *) -(* modules. *) - -(* utils.c *) -procedure av_register_input_format(format: PAVInputFormat); - cdecl; external av__format; - -procedure av_register_output_format(format: PAVOutputFormat); - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION_MAJOR < 53} // < 53 -function guess_stream_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Return the output format in the list of registered output formats - * which best matches the provided parameters, or return NULL if - * there is no match. - * - * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats - *) -(** - * @deprecated Use av_guess_format() instead. - *) -function guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; -{$IF LIBAVFORMAT_VERSION >= 52045000} // >= 52.45.0 - deprecated; -function av_guess_format(short_name: PAnsiChar; - filename: PAnsiChar; - mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; -{$IFEND} - -(** - * Guess the codec ID based upon muxer and filename. - *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; - filename: PAnsiChar; mime_type: PAnsiChar; - type_: TCodecType): TCodecID; - cdecl; external av__format; - -(** - * Send a nice hexadecimal dump of a buffer to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 51011000} // 51.11.0 -(** - * Send a nice hexadecimal dump of a buffer to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param buf buffer - * @param size buffer size - * - * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log - *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cint); - cdecl; external av__format; -{$IFEND} - -(** - * Send a nice dump of a packet to the specified file stream. - * - * @param f The file stream pointer where the dump should be sent to. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - *) -procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 51011000} // 51.11.0 -(** - * Send a nice dump of a packet to the log. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param pkt packet to dump - * @param dump_payload True if the payload must be displayed, too. - *) -procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); - cdecl; external av__format; -{$IFEND} - -(** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - * @see av_register_protocol() - *) -procedure av_register_all(); - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 -(** - * Get the CodecID for the given codec tag tag. - * If no codec id is found returns CODEC_ID_NONE. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TCodecID; - cdecl; external av__format; - -(** - * Getsthe codec tag for the given codec id id. - * If no codec tag is found returns 0. - * - * @param tags list of supported codec_id-codec_tag pairs, as stored - * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag - *) -function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; - cdecl; external av__format; -{$IFEND} - -(* media file input *) - -(** - * Find AVInputFormat based on the short name of the input format. - *) -function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; - cdecl; external av__format; - -(** - * Guess file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - *) -function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52062000} // 52.62.0 -(** - * Guess the file format. - * - * @param is_opened Whether the file is already opened; determines whether - * demuxers with or without AVFMT_NOFILE are probed. - * @param score_max A probe score larger that this is required to accept a - * detection, the variable is set to the actual detection - * score afterwards. - * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended - * to retry with a larger probe buffer. - *) -function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; - cdecl; external av__format; -{$IFEND} - -(** - * Allocate all the structures needed to read an input stream. - * This does not open the needed codecs for decoding the stream[s]. - *) -function av_open_input_stream(var ic_ptr: PAVFormatContext; - pb: PByteIOContext; filename: PAnsiChar; - fmt: PAVInputFormat; ap: PAVFormatParameters): cint; - cdecl; external av__format; - -(** - * Open a media file as input. The codecs are not opened. Only the file - * header (if present) is read. - * - * @param ic_ptr The opened media file handle is put here. - * @param filename filename to open - * @param fmt If non-NULL, force the file format to use. - * @param buf_size optional buffer size (zero if default is OK) - * @param ap Additional parameters needed when opening the file - * (NULL if default). - * @return 0 if OK, AVERROR_xxx otherwise - *) -function av_open_input_file(var ic_ptr: PAVFormatContext; filename: PAnsiChar; - fmt: PAVInputFormat; buf_size: cint; - ap: PAVFormatParameters): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52026000} // 52.26.0 -(** - * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! - *) -function avformat_alloc_context(): PAVFormatContext; - cdecl; external av__format; -{$ELSE} - {$IF LIBAVFORMAT_VERSION_MAJOR < 53} -(** - * @deprecated Use avformat_alloc_context() instead. - *) -function av_alloc_format_context(): PAVFormatContext; - cdecl; external av__format; - {$IFEND} -{$IFEND} - -(** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - *) -function av_find_stream_info(ic: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Read a transport packet from a media file. - * - * This function is obsolete and should never be used. - * Use av_read_frame() instead. - * - * @param s media file handle - * @param pkt is filled - * @return 0 if OK, AVERROR_xxx on error - *) -function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Return the next frame of a stream. - * - * The returned packet is valid - * until the next av_read_frame() or until av_close_input_file() and - * must be freed with av_free_packet. For video, the packet contains - * exactly one frame. For audio, it contains an cint number of - * frames if each frame has a known fixed size (e.g. PCM or ADPCM - * data). If the audio frames have a variable size (e.g. MPEG audio), - * then it contains one frame. - * - * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.time_base units (and guessed if the format cannot - * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B-frames, so it is better to rely on pkt->dts if you do not - * decompress the payload. - * - * @return 0 if OK, < 0 on error or end of file - *) -function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Seek to the keyframe at timestamp. - * 'timestamp' in 'stream_index'. - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode - * @return >= 0 on success - *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; - flags: cint): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52026000} // 52.26.0 -(** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - * - * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in byte and - * are the file position (this may not be supported by all demuxers). - * If flags contain AVSEEK_FLAG_FRAME then all timestamps are in frames - * in the stream with stream_index (this may not be supported by all demuxers). - * Otherwise all timestamps are in units of the stream selected by stream_index - * or if stream_index is -1, in AV_TIME_BASE units. - * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as - * keyframes (this may not be supported by all demuxers). - * - * @param stream_index index of the stream which is used as time base reference. - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags - * @return >=0 on success, error code otherwise - * - * @note This is part of the new seek API which is still under construction. - * Thus do not use this yet. It may change at any time, do not expect - * ABI compatibility yet! - *) -function avformat_seek_file(s: PAVFormatContext; - stream_index: cint; - min_ts: cint64; - ts: cint64; - max_ts: cint64; - flags: cint): cint; - cdecl; external av__format; -{$IFEND} - -(** - * Start playing a network-based stream (e.g. RTSP stream) at the - * current position. - *) -function av_read_play(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Pause a network-based stream (e.g. RTSP stream). - * - * Use av_read_play() to resume it. - *) -function av_read_pause(s: PAVFormatContext): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 -(** - * Free a AVFormatContext allocated by av_open_input_stream. - * @param s context to free - *) -procedure av_close_input_stream(s: PAVFormatContext); - cdecl; external av__format; -{$IFEND} - -(** - * Close a media file (but not its codecs). - * - * @param s media file handle - *) -procedure av_close_input_file(s: PAVFormatContext); - cdecl; external av__format; - -(** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - *) -function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; - cdecl; external av__format; -{$IF LIBAVFORMAT_VERSION >= 51014000} // 51.14.0 -function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; - cdecl; external av__format; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52014000} // 52.14.0 -(** - * Add a new chapter. - * This function is NOT part of the public API - * and should ONLY be used by demuxers. - * - * @param s media file handle - * @param id unique ID for this chapter - * @param start chapter start time in time_base units - * @param end chapter end time in time_base units - * @param title chapter title - * - * @return AVChapter or NULL on error - *) -function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; - start, end_: cint64; title: {const} PAnsiChar): PAVChapter; - cdecl; external av__format; -{$IFEND} - -(** - * Set the pts for a given stream. - * - * @param s stream - * @param pts_wrap_bits number of bits effectively used by the pts - * (used for wrap control, 33 is the value for MPEG) - * @param pts_num numerator to convert to seconds (MPEG: 1) - * @param pts_den denominator to convert to seconds (MPEG: 90000) - *) -procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; -{$IF LIBAVFORMAT_VERSION < 52036000} // < 52.36.0 - pts_num: cint; pts_den: cint); -{$ELSE} - pts_num: cuint; pts_den: cuint); -{$IFEND} - cdecl; external av__format; - -const - AVSEEK_FLAG_BACKWARD = 1; ///< seek backward - AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes -{$IF LIBAVFORMAT_VERSION >= 52037000} // >= 52.37.0 - AVSEEK_FLAG_FRAME = 8; -{$IFEND} - -function av_find_default_stream_index(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Get the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond - * to the timestamp which is <= the requested one, if backward - * is 0, then it will be >= - * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise - * @return < 0 if no such timestamp could be found - *) -function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 -(** - * Ensure the index uses less memory than the maximum specified in - * AVFormatContext.max_index_size by discarding entries if it grows - * too large. - * This function is not part of the public API and should only be called - * by demuxers. - *) -procedure ff_reduce_index(s: PAVFormatContext; stream_index: cint); - cdecl; external av__format; -{$IFEND} - -(** - * Add an index entry into a sorted list. Update the entry if the list - * already contains it. - * - * @param timestamp timestamp in the timebase of the given stream - *) -function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - size: cint; distance: cint; flags: cint): cint; - cdecl; external av__format; - -(** - * Perform a binary search using av_index_search_timestamp() and - * AVInputFormat.read_timestamp(). - * This is not supposed to be called directly by a user application, - * but by demuxers. - * @param target_ts target timestamp in the time base of the given stream - * @param stream_index stream number - *) -function av_seek_frame_binary(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; flags: cint): cint; - cdecl; external av__format; - - -(** - * Update cur_dts of all streams based on the given timestamp and AVStream. - * - * Stream ref_st unchanged, others set cur_dts in their native time base. - * Only needed for timestamp wrapping or if (dts not set and pts!=dts). - * @param timestamp new dts expressed in time_base of param ref_st - * @param ref_st reference stream giving time_base of param timestamp - *) -procedure av_update_cur_dts(s: PAVFormatContext; ref_st: PAVStream; - timestamp: cint64); - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 51007000} // 51.7.0 -type - TReadTimestampFunc = function (pavfc: PAVFormatContext; - arg2: cint; arg3: Pint64; arg4: cint64): cint64; cdecl; - -(** - * Perform a binary search using read_timestamp(). - * This is not supposed to be called directly by a user application, - * but by demuxers. - * @param target_ts target timestamp in the time base of the given stream - * @param stream_index stream number - *) -function av_gen_search(s: PAVFormatContext; stream_index: cint; - target_ts: cint64; pos_min: cint64; - pos_max: cint64; pos_limit: cint64; - ts_min: cint64; ts_max: cint64; - flags: cint; ts_ret: Pint64; - read_timestamp: TReadTimestampFunc): cint64; - cdecl; external av__format; -{$IFEND} - -(** - * media file output - *) -function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52072000} // 52.72.0 -(** - * Split a URL string into components. - * - * The pointers to buffers for storing individual components may be null, - * in order to ignore that component. Buffers for components not found are - * set to empty strings. If the port is not found, it is set to a negative - * value. - * - * @param proto the buffer for the protocol - * @param proto_size the size of the proto buffer - * @param authorization the buffer for the authorization - * @param authorization_size the size of the authorization buffer - * @param hostname the buffer for the host name - * @param hostname_size the size of the hostname buffer - * @param port_ptr a pointer to store the port number in - * @param path the buffer for the path - * @param path_size the size of the path buffer - * @param url the URL to split - *) -procedure av_url_split(proto: PAnsiChar; proto_size: cint; - authorization: PAnsiChar; authorization_size: cint; - hostname: PAnsiChar; hostname_size: cint; - port_ptr: Pcint; - path: PAnsiChar; path_size: cint; - {const} url: PAnsiChar); - cdecl; external av__format; -{$IFEND} - -(** - * Allocate the stream private data and write the stream header to an - * output media file. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_header(s: PAVFormatContext): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file. - * - * The packet shall contain one audio or video frame. - * The packet must be correctly interleaved according to the container - * specification, if not then av_interleaved_write_frame must be used. - * - * @param s media file handle - * @param pkt The packet, which contains the stream_index, buf/buf_size, - * dts/pts, ... - * @return < 0 on error, = 0 if OK, 1 if end of stream wanted - *) -function av_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Write a packet to an output media file ensuring correct interleaving. - * - * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved, the application should - * call av_write_frame() instead as it is slightly faster. It is also important - * to keep in mind that completely non-interleaved input will need huge amounts - * of memory to interleave with this, so it is preferable to interleave at the - * demuxer level. - * - * @param s media file handle - * @param pkt The packet, which contains the stream_index, buf/buf_size, - * dts/pts, ... - * @return < 0 on error, = 0 if OK, 1 if end of stream wanted - *) -function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; - cdecl; external av__format; - -(** - * Interleave a packet per dts in an output media file. - * - * Packets with pkt->destruct == av_destruct_packet will be freed inside this - * function, so they cannot be used after it. Note that calling av_free_packet() - * on them is still safe. - * - * @param s media file handle - * @param out the interleaved packet will be output here - * @param pkt the input packet - * @param flush 1 if no further packets are available as input and all - * remaining packets should be output - * @return 1 if a packet was output, 0 if no packet could be output, - * < 0 if an error occurred - *) -function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; - pkt: PAVPacket; flush: cint): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52025000} // 52.25.0 -(** - * Add packet to AVFormatContext->packet_buffer list, determining its - * interleaved position using compare() function argument. - * - * This function is not part of the public API and should only be called - * by muxers using their own interleave function. - *) -{ -procedure ff_interleave_add_packet(s: PAVFormatContext; - pkt: PAVPacket; - compare: function(para1: PAVFormatContext; - para2: PAVPacket; - para3: PAVPacket): cint); - cdecl; external av__format; -} -{$IFEND} - -(** - * Write the stream trailer to an output media file and free the - * file private data. - * - * May only be called after a successful call to av_write_header. - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - *) -function av_write_trailer(s: pAVFormatContext): cint; - cdecl; external av__format; - -procedure dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar; - is_output: cint); - cdecl; external av__format; - -(** - * Parse width and height out of string str. - * @deprecated Use av_parse_video_frame_size instead. - *) -function parse_image_size(width_ptr: PCint; height_ptr: PCint; - str: PAnsiChar): cint; - cdecl; external av__format; deprecated; - -{$IF LIBAVFORMAT_VERSION_MAJOR < 53} -(** - * Convert framerate from a string to a fraction. - * @deprecated Use av_parse_video_frame_rate instead. - *) -function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; - arg: PByteArray): cint; - cdecl; external av__format; deprecated; -{$IFEND} - -(** - * Parse datestr and return a corresponding number of microseconds. - * @param datestr String representing a date or a duration. - * - If a date the syntax is: - * @code - * now|{[{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z|z]} - * @endcode - * If the value is "now" it takes the current time. - * Time is localtime unless Z is appended, in which case it is - * interpreted as UTC. - * If the year-month-day part is not specified it takes the current - * year-month-day. - * Returns the number of microseconds since 1st of January, 1970 up to - * the time of the parsed date or INT64_MIN if datestr cannot be - * successfully parsed. - * - If a duration the syntax is: - * @code - * [-]HH[:MM[:SS[.m...]]] - * [-]S+[.m...] - * @endcode - * @return the number of microseconds contained in a time interval - * with the specified duration or INT64_MIN if datestr cannot be - * successfully parsed. - * @param duration Flag which tells how to interpret datestr, if - * not zero datestr is interpreted as a duration, otherwise as a - * date. - *) -function parse_date(datestr: PAnsiChar; duration: cint): cint64; - cdecl; external av__format; - -(** - * Get the current time in microseconds. - *) -function av_gettime(): cint64; - cdecl; external av__format; - -(* ffm-specific for ffserver *) -const - FFM_PACKET_SIZE = 4096; - -function ffm_read_write_index(fd: cint): cint64; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION < 52027000} // 52.27.0 -procedure ffm_write_write_index(fd: cint; pos: cint64); -{$ELSE} -function ffm_write_write_index(fd: cint; pos: cint64): cint; -{$IFEND} - cdecl; external av__format; - -procedure ffm_set_write_index(s: PAVFormatContext; pos: cint64; file_size: cint64); - cdecl; external av__format; - -(** - * Attempt to find a specific tag in a URL. - * - * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done. - * Return 1 if found. - *) -function find_info_tag(arg: PAnsiChar; arg_size: cint; tag1: PAnsiChar; info: PAnsiChar): cint; - cdecl; external av__format; - -(** - * Return in 'buf' the path with '%d' replaced by a number. - * - * Also handles the '%0nd' format where 'n' is the total number - * of digits and '%%'. - * - * @param buf destination buffer - * @param buf_size destination buffer size - * @param path numbered sequence string - * @param number frame number - * @return 0 if OK, -1 on format error - *) -function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; - path: PAnsiChar; number: cint): cint; - cdecl; external av__format - {$IF LIBAVFORMAT_VERSION <= 50006000} // 50.6.0 - name 'get_frame_filename' - {$IFEND}; - -(** - * Check whether filename actually is a numbered sequence generator. - * - * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise - *) -function av_filename_number_test(filename: PAnsiChar): cint; - cdecl; external av__format - {$IF LIBAVFORMAT_VERSION <= 50006000} // 50.6.0 - name 'filename_number_test' - {$IFEND}; - -{$IF LIBAVFORMAT_VERSION >= 51012002} // 51.12.2 -(** - * Generate an SDP for an RTP session. - * - * @param ac array of AVFormatContexts describing the RTP streams. If the - * array is composed by only one context, such context can contain - * multiple AVStreams (one AVStream per RTP stream). Otherwise, - * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream. - * @param n_files number of AVCodecContexts contained in ac - * @param buff buffer where the SDP will be stored (must be allocated by - * the caller) - * @param size the size of the buffer - * @return 0 if OK, AVERROR_xxx on error - *) -function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PByteArray; size: cint): cint; - cdecl; external av__format; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52060000} // 52.60.0 -(** - * Return a positive value if the given filename has one of the given - * extensions, 0 otherwise. - * - * @param extensions a comma-separated list of filename extensions - *) -function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; - cdecl; external av__format; -{$IFEND} - -implementation - -{$IF LIBAVFORMAT_VERSION < 51012002} // 51.12.2 -procedure av_init_packet(var pkt: TAVPacket); -begin - with pkt do begin - pts := AV_NOPTS_VALUE; - dts := AV_NOPTS_VALUE; - pos := -1; - duration := 0; - flags := 0; - stream_index := 0; - destruct := @av_destruct_packet_nofree - end -end; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION < 52032000} // < 52.32.0 -procedure av_free_packet(pkt: PAVPacket); -begin - if ((pkt <> nil) and (@pkt^.destruct <> nil)) then - pkt^.destruct(pkt); -end; -{$IFEND} - -end. diff --git a/src/lib/ffmpeg/avio.pas b/src/lib/ffmpeg/avio.pas deleted file mode 100644 index adb59a44..00000000 --- a/src/lib/ffmpeg/avio.pas +++ /dev/null @@ -1,796 +0,0 @@ -(* - * unbuffered io for ffmpeg system - * copyright (c) 2001 Fabrice Bellard - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavformat/avio.h - * unbuffered I/O operations - * @warning This file has to be considered an internal but installed - * header, so it should not be directly included in your projects. - * - * update to - * Max. avformat version: 52.78.3, revision 24841, Thu Aug 26 02:00:00 2010 CET - *) - -unit avio; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - avutil, - avcodec, - SysUtils, - UConfig; - -(* unbuffered I/O *) - -const - URL_RDONLY = 0; - URL_WRONLY = 1; - URL_RDWR = 2; - - (** - * Passing this as the "whence" parameter to a seek function causes it to - * return the filesize without seeking anywhere. Supporting this is optional. - * If it is not supported then the seek function will return <0. - *) - AVSEEK_SIZE = $10000; - -{$IF LIBAVFORMAT_VERSION >= 52056000} // 52.56.0 - (** - * Oring this flag as into the "whence" parameter to a seek function causes it to - * seek by any means (like reopening and linear reading) or other normally unreasonble - * means that can be extreemly slow. - * This may be ignored by the seek code. - *) - AVSEEK_FORCE = $20000; -{$IFEND} - -type - TURLInterruptCB = function (): cint; cdecl; - -type - PURLProtocol = ^TURLProtocol; - - (** - * URL Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(URLContext) must not be used outside libav*. - *) - PURLContext = ^TURLContext; - TURLContext = record - {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 - av_class: {const} PAVClass; ///< information for av_log(). Set by url_open(). - {$ELSE} - {$IFDEF FF_API_URL_CLASS} - av_class: {const} PAVClass; ///< information for av_log(). Set by url_open(). - {$ENDIF} - {$IFEND} - prot: PURLProtocol; - flags: cint; - is_streamed: cint; (**< true if streamed (no seek possible), default = false *) - max_packet_size: cint; (**< if non zero, the stream is packetized with this max packet size *) - priv_data: pointer; - filename: PAnsiChar; (**< specified URL *) -{$IF LIBAVFORMAT_VERSION >= 52070000} // 52.70.0 - is_connected: cint; -{$IFEND} - end; - PPURLContext = ^PURLContext; - - PURLPollEntry = ^TURLPollEntry; - TURLPollEntry = record - handle: PURLContext; - events: cint; - revents: cint; - end; - - TURLProtocol = record - name: PAnsiChar; -{$IF LIBAVFORMAT_VERSION < 52047000} // 52.47.0 - url_open: function (h: PURLContext; filename: {const} PAnsiChar; flags: cint): cint; cdecl; -{$ELSE} - url_open: function (h: PURLContext; url: {const} PAnsiChar; flags: cint): cint; cdecl; -{$IFEND} - -(** - * Read up to size bytes from the resource accessed by h, and store - * the read bytes in buf. - * - * @return The number of bytes actually read, or a negative value - * corresponding to an AVERROR code in case of error. A value of zero - * indicates that it is not possible to read more from the accessed - * resource (except if the value of the size argument is also zero). - *) - url_read: function (h: PURLContext; buf: PByteArray; size: cint): cint; cdecl; - -(** - * Read as many bytes as possible (up to size), calling the - * read function multiple times if necessary. - * Will also retry if the read function returns AVERROR(EAGAIN). - * This makes special short-read handling in applications - * unnecessary, if the return value is < size then it is - * certain there was either an error or the end of file was reached. - *) - url_write: function (h: PURLContext; {const} buf: PByteArray; size: cint): cint; cdecl; - -(** - * Change the position that will be used by the next read/write - * operation on the resource accessed by h. - * - * @param pos specifies the new position to set - * @param whence specifies how pos should be interpreted, it must be - * one of SEEK_SET (seek from the beginning), SEEK_CUR (seek from the - * current position), SEEK_END (seek from the end), or AVSEEK_SIZE - * (return the filesize of the requested resource, pos is ignored). - * @return a negative value corresponding to an AVERROR code in case - * of failure, or the resulting file position, measured in bytes from - * the beginning of the file. You can use this feature together with - * SEEK_CUR to read the current file position. - *) - url_seek: function (h: PURLContext; pos: cint64; whence: cint): cint64; cdecl; - - url_close: function (h: PURLContext): cint; cdecl; - next: PURLProtocol; - {$IF (LIBAVFORMAT_VERSION >= 52001000) and (LIBAVFORMAT_VERSION < 52004000)} // 52.1.0 .. 52.4.0 - url_read_play: function (h: PURLContext): cint; cdecl; - url_read_pause: function (h: PURLContext): cint; cdecl; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 - url_read_pause: function (h: PURLContext; pause: cint): cint; cdecl; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52001000} // 52.1.0 - url_read_seek: function (h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52031000} // 52.31.0 - url_get_file_handle: function (h: PURLContext): cint; cdecl; - {$IFEND} - - {$IF LIBAVFORMAT_VERSION >= 52071000} // 52.71.0 - priv_data_size: cint; - {const} priv_data_class: PAVClass; - {$IFEND} - end; - - (** - * Bytestream IO Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(ByteIOContext) must not be used outside libav*. - *) - PByteIOContext = ^TByteIOContext; - TByteIOContext = record - buffer: PByteArray; - buffer_size: cint; - buf_ptr: PByteArray; - buf_end: PByteArray; - opaque: pointer; - read_packet: function (opaque: pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - write_packet: function (opaque: pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - seek: function (opaque: pointer; offset: cint64; whence: cint): cint64; cdecl; - pos: cint64; (* position in the file of the current buffer *) - must_flush: cint; (* true if the next seek should flush *) - eof_reached: cint; (* true if eof reached *) - write_flag: cint; (* true if open for writing *) - is_streamed: cint; - max_packet_size: cint; - checksum: culong; - checksum_ptr: PByteArray; - update_checksum: function (checksum: culong; buf: {const} PByteArray; size: cuint): culong; cdecl; - error: cint; ///< contains the error code or 0 if no error happened - {$IF (LIBAVFORMAT_VERSION >= 52001000) and (LIBAVFORMAT_VERSION < 52004000)} // 52.1.0 .. 52.4.0 - read_play: function(opaque: Pointer): cint; cdecl; - read_pause: function(opaque: Pointer): cint; cdecl; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 - read_pause: function(opaque: Pointer; pause: cint): cint; cdecl; - {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52001000} // 52.1.0 - read_seek: function(opaque: Pointer; stream_index: cint; - timestamp: cint64; flags: cint): cint64; cdecl; - {$IFEND} - end; - -{$IF LIBAVFORMAT_VERSION >= 52070000} // 52.70.0 -(** - * Create a URLContext for accessing to the resource indicated by - * url, but do not initiate the connection yet. - * - * @param puc pointer to the location where, in case of success, the - * function puts the pointer to the created URLContext - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function url_alloc(h: PPURLContext; {const} url: PAnsiChar; flags: cint): cint; - cdecl; external av__format; - -(** - * Connect an URLContext that has been allocated by url_alloc - *) -function url_connect(h: PURLContext): cint; - cdecl; external av__format; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52021000} // 52.21.0 -(** - * Create a URLContext for accessing to the resource indicated by - * URL, and open it using the URLProtocol up. - * - * @param puc pointer to the location where, in case of success, the - * function puts the pointer to the created URLContext - * @param flags flags which control how the resource indicated by URL - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function url_open_protocol(puc: PPURLContext; up: PURLProtocol; -{$IF LIBAVFORMAT_VERSION < 52047000} // 52.47.0 - filename: {const} PAnsiChar; flags: cint): cint; -{$ELSE} - url: {const} PAnsiChar; flags: cint): cint; -{$IFEND} - cdecl; external av__format; -{$IFEND} - -(** - * Create a URLContext for accessing to the resource indicated by - * url, and open it. - * - * @param puc pointer to the location where, in case of success, the - * function puts the pointer to the created URLContext - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -{$IF LIBAVFORMAT_VERSION < 52047000} // 52.47.0 -function url_open(h: PPointer; filename: {const} PAnsiChar; flags: cint): cint; -{$ELSE} -function url_open(h: PPointer; url: {const} PAnsiChar; flags: cint): cint; -{$IFEND} - cdecl; external av__format; -function url_read (h: PURLContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; -{$IF LIBAVFORMAT_VERSION >= 52034000} // 52.34.0 -function url_read_complete (h: PURLContext; buf: PByteArray; size: cint): cint; cdecl; - cdecl; external av__format; -{$IFEND} -function url_write (h: PURLContext; {const} buf: PByteArray; size: cint): cint; - cdecl; external av__format; -function url_seek (h: PURLContext; pos: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Close the resource accessed by the URLContext h, and free the - * memory used by it. - * - * @return a negative value if an error condition occurred, 0 - * otherwise - *) -function url_close (h: PURLContext): cint; - cdecl; external av__format; - -(** - * Return a non-zero value if the resource indicated by url - * exists, 0 otherwise. - *) -{$IF LIBAVFORMAT_VERSION < 52047000} // 52.47.0 -function url_exist(filename: {const} PAnsiChar): cint; -{$ELSE} -function url_exist(url: {const} PAnsiChar): cint; -{$IFEND} - cdecl; external av__format; - -function url_filesize (h: PURLContext): cint64; - cdecl; external av__format; - -(** - * Return the file descriptor associated with this URL. For RTP, this - * will return only the RTP file descriptor, not the RTCP file descriptor. - * To get both, use rtp_get_file_handles(). - * - * @return the file descriptor associated with this URL, or <0 on error. - *) -(* not implemented *) -function url_get_file_handle(h: PURLContext): cint; - cdecl; external av__format; - -(** - * Return the maximum packet size associated to packetized file - * handle. If the file is not packetized (stream like HTTP or file on - * disk), then 0 is returned. - * - * @param h file handle - * @return maximum packet size in bytes - *) -function url_get_max_packet_size(h: PURLContext): cint; - cdecl; external av__format; -procedure url_get_filename(h: PURLContext; buf: PAnsiChar; buf_size: cint); - cdecl; external av__format; - -(** - * The callback is called in blocking functions to test regulary if - * asynchronous interruption is needed. AVERROR(EINTR) is returned - * in this case by the interrupted function. 'NULL' means no interrupt - * callback is given. - *) -procedure url_set_interrupt_cb (interrupt_cb: TURLInterruptCB); - cdecl; external av__format; - -(* not implemented *) -function url_poll(poll_table: PURLPollEntry; n: cint; timeout: cint): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 -(** - * Pause and resume playing - only meaningful if using a network streaming - * protocol (e.g. MMS). - * @param pause 1 for pause, 0 for resume - *) -function av_url_read_pause(h: PURLContext; pause: cint): cint; - cdecl; external av__format; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52001000} // 52.1.0 -(** - * Seek to a given timestamp relative to some component stream. - * Only meaningful if using a network streaming protocol (e.g. MMS.). - * @param stream_index The stream index that the timestamp is relative to. - * If stream_index is (-1) the timestamp should be in AV_TIME_BASE - * units from the beginning of the presentation. - * If a stream_index >= 0 is used and the protocol does not support - * seeking based on component streams, the call will fail with ENOTSUP. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units. - * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE - * and AVSEEK_FLAG_ANY. The protocol may silently ignore - * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will - * fail with ENOTSUP if used and not supported. - * @return >= 0 on success - * @see AVInputFormat::read_seek - *) -function av_url_read_seek(h: PURLContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; -{$IFEND} - -(** -var -{$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 - first_protocol: PURLProtocol; external av__format; -{$ELSE} - {$IFDEF FF_API_REGISTER_PROTOCOL} - first_protocol: PURLProtocol; external av__format; - {$IFEND} -{$IFEND} - url_interrupt_cb: PURLInterruptCB; external av__format; -**) - -{$IF LIBAVFORMAT_VERSION >= 52002000} // 52.2.0 -(** - * If protocol is NULL, returns the first registered protocol, - * if protocol is non-NULL, returns the next registered protocol after protocol, - * or NULL if protocol is the last one. - *) -function av_protocol_next(p: PURLProtocol): PURLProtocol; - cdecl; external av__format; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION <= 52028000} // 52.28.0 -(** - * Register the URLProtocol protocol. - * - * - * @deprecated Use av_register_protocol() instead. - *) -function register_protocol(protocol: PURLProtocol): cint; - cdecl; external av__format; -(** Alias for register_protocol() - * - * @deprecated Use av_register_protocol2() instead. - *) -function av_register_protocol(protocol: PURLProtocol): cint; - cdecl; external av__format name 'register_protocol'; -{$ELSE} -{$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 -function av_register_protocol(protocol: PURLProtocol): cint; - cdecl; external av__format; -{$ELSE} - {$IFDEF FF_API_REGISTER_PROTOCOL} -function av_register_protocol(protocol: PURLProtocol): cint; - cdecl; external av__format; - {$ENDIF} -{$IFEND} -{$IFEND} -{$IF LIBAVFORMAT_VERSION >= 52069000} // 52.69.0 -function av_register_protocol2(protocol: PURLProtocol; size: cint): cint; - cdecl; external av__format; -{$IFEND} - -type - TReadWriteFunc = function(opaque: Pointer; buf: PByteArray; buf_size: cint): cint; cdecl; - TSeekFunc = function(opaque: Pointer; offset: cint64; whence: cint): cint64; cdecl; - -function init_put_byte(s: PByteIOContext; - buffer: PByteArray; - buffer_size: cint; write_flag: cint; - opaque: pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): cint; - cdecl; external av__format; -{$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 -function av_alloc_put_byte( - buffer: PByteArray; - buffer_size: cint; - write_flag: cint; - opaque: Pointer; - read_packet: TReadWriteFunc; - write_packet: TReadWriteFunc; - seek: TSeekFunc): PByteIOContext; - cdecl; external av__format; -{$IFEND} - -procedure put_byte(s: PByteIOContext; b: cint); - cdecl; external av__format; -procedure put_buffer (s: PByteIOContext; buf: {const} PByteArray; size: cint); - cdecl; external av__format; -procedure put_le64(s: PByteIOContext; val: cuint64); - cdecl; external av__format; -procedure put_be64(s: PByteIOContext; val: cuint64); - cdecl; external av__format; -procedure put_le32(s: PByteIOContext; val: cuint); - cdecl; external av__format; -procedure put_be32(s: PByteIOContext; val: cuint); - cdecl; external av__format; -procedure put_le24(s: PByteIOContext; val: cuint); - cdecl; external av__format; -procedure put_be24(s: PByteIOContext; val: cuint); - cdecl; external av__format; -procedure put_le16(s: PByteIOContext; val: cuint); - cdecl; external av__format; -procedure put_be16(s: PByteIOContext; val: cuint); - cdecl; external av__format; -procedure put_tag(s: PByteIOContext; tag: {const} PAnsiChar); - cdecl; external av__format; - -procedure put_strz(s: PByteIOContext; buf: {const} PAnsiChar); - cdecl; external av__format; - -(** - * fseek() equivalent for ByteIOContext. - * @return new position or AVERROR. - *) -function url_fseek(s: PByteIOContext; offset: cint64; whence: cint): cint64; - cdecl; external av__format; - -(** - * Skip given number of bytes forward. - * @param offset number of bytes - * @return 0 on success, <0 on error - *) -{$IF LIBAVFORMAT_VERSION < 52074000} // 52.74.0 -procedure url_fskip(s: PByteIOContext; offset: cint64); - cdecl; external av__format; -{$ELSE} -function url_fskip(s: PByteIOContext; offset: cint64): cint; - cdecl; external av__format; -{$IFEND} - -(** - * ftell() equivalent for ByteIOContext. - * @return position or AVERROR. - *) -function url_ftell(s: PByteIOContext): cint64; - cdecl; external av__format; - -(** - * Get the filesize. - * @return filesize or AVERROR - *) -function url_fsize(s: PByteIOContext): cint64; - cdecl; external av__format; - -(** - * feof() equivalent for ByteIOContext. - * @return non zero if and only if end of file - *) -function url_feof(s: PByteIOContext): cint; - cdecl; external av__format; - -function url_ferror(s: PByteIOContext): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 -function av_url_read_fpause(h: PByteIOContext; pause: cint): cint; - cdecl; external av__format; -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52001000} // 52.1.0 -function av_url_read_fseek(h: PByteIOContext; stream_index: cint; - timestamp: cint64; flags: cint): cint64; - cdecl; external av__format; -{$IFEND} - -const - URL_EOF = -1; -(** @note return URL_EOF (-1) if EOF *) -function url_fgetc(s: PByteIOContext): cint; - cdecl; external av__format; - -(** @warning currently size is limited *) -function url_fprintf(s: PByteIOContext; fmt: {const} PAnsiChar; args: array of const): cint; - cdecl; external av__format; - -(** @note unlike fgets, the EOL character is not returned and a whole - line is parsed. return NULL if first char read was EOF *) -function url_fgets(s: PByteIOContext; buf: PAnsiChar; buf_size: cint): PAnsiChar; - cdecl; external av__format; - -procedure put_flush_packet (s: PByteIOContext); - cdecl; external av__format; - -(** - * Read size bytes from ByteIOContext into buf. - * @return number of bytes read or AVERROR - *) -function get_buffer(s: PByteIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; - -(** - * Read size bytes from ByteIOContext into buf. - * This reads at most 1 packet. If that is not enough fewer bytes will be - * returned. - * @return number of bytes read or AVERROR - *) -function get_partial_buffer(s: PByteIOContext; buf: PByteArray; size: cint): cint; - cdecl; external av__format; - -(** @note return 0 if EOF, so you cannot use it if EOF handling is - necessary *) -function get_byte(s: PByteIOContext): cint; - cdecl; external av__format; -function get_le24(s: PByteIOContext): cuint; - cdecl; external av__format; -function get_le32(s: PByteIOContext): cuint; - cdecl; external av__format; -function get_le64(s: PByteIOContext): cuint64; - cdecl; external av__format; -function get_le16(s: PByteIOContext): cuint; - cdecl; external av__format; - -function get_strz(s: PByteIOContext; buf: PAnsiChar; maxlen: cint): PAnsiChar; - cdecl; external av__format; -function get_be16(s: PByteIOContext): cuint; - cdecl; external av__format; -function get_be24(s: PByteIOContext): cuint; - cdecl; external av__format; -function get_be32(s: PByteIOContext): cuint; - cdecl; external av__format; -function get_be64(s: PByteIOContext): cuint64; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 51017001} // 51.17.1 - {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 -function ff_get_v(bc: PByteIOContext): cuint64; - cdecl; external av__format; - {$ELSE} - {$IFDEF FF_API_URL_RESETBUF} -function ff_get_v(bc: PByteIOContext): cuint64; - cdecl; external av__format; - {$ENDIF} - {$IFEND} -{$IFEND} - -function url_is_streamed(s: PByteIOContext): cint; {$IFDEF HasInline}inline;{$ENDIF} - -(** - * Create and initialize a ByteIOContext for accessing the - * resource referenced by the URLContext h. - * @note When the URLContext h has been opened in read+write mode, the - * ByteIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created ByteIOContext. - * In case of failure the pointed to value is set to NULL. - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -{$IF LIBAVFORMAT_VERSION >= 52000000} // 52.0.0 -function url_fdopen (var s: PByteIOContext; h: PURLContext): cint; -{$ELSE} -function url_fdopen (s: PByteIOContext; h: PURLContext): cint; -{$IFEND} - cdecl; external av__format; - -(** @warning must be called before any I/O *) -function url_setbufsize (s: PByteIOContext; buf_size: cint): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION_MAJOR < 53} -{$IF LIBAVFORMAT_VERSION >= 51015000} // 51.15.0 -(** Reset the buffer for reading or writing. - * @note Will drop any data currently in the buffer without transmitting it. - * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY - * to set up the buffer for writing. *) -function url_resetbuf(s: PByteIOContext; flags: cint): cint; - cdecl; external av__format; -{$IFEND} -{$IFEND} - -{$IF LIBAVFORMAT_VERSION >= 52061000} // 52.61.0 -(** - * Rewind the ByteIOContext using the specified buffer containing the first buf_size bytes of the file. - * Used after probing to avoid seeking. - * Joins buf and s->buffer, taking any overlap into consideration. - * @note s->buffer must overlap with buf or they can't be joined and the function fails - * @note This function is NOT part of the public API - * - * @param s The read-only ByteIOContext to rewind - * @param buf The probe buffer containing the first buf_size bytes of the file - * @param buf_size The size of buf - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -function ff_rewind_with_probe_data(s: PByteIOContext; buf: PAnsiChar; buf_size: cint): cint; - cdecl; external av__format; -{$IFEND} - -(** - * Create and initialize a ByteIOContext for accessing the - * resource indicated by url. - * @note When the resource indicated by url has been opened in - * read+write mode, the ByteIOContext can be used only for writing. - * - * @param s Used to return the pointer to the created ByteIOContext. - * In case of failure the pointed to value is set to NULL. - * @param flags flags which control how the resource indicated by url - * is to be opened - * @return 0 in case of success, a negative value corresponding to an - * AVERROR code in case of failure - *) -{$IF LIBAVFORMAT_VERSION < 52047000} // 52.47.0 -{$IF LIBAVFORMAT_VERSION >= 52000000} // 52.0.0 -function url_fopen(var s: PByteIOContext; filename: {const} PAnsiChar; flags: cint): cint; -{$ELSE} -function url_fopen(s: PByteIOContext; filename: {const} PAnsiChar; flags: cint): cint; -{$IFEND} -{$ELSE} -function url_fopen(var s: PByteIOContext; url: {const} PAnsiChar; flags: cint): cint; -{$IFEND} - cdecl; external av__format; -function url_fclose(s: PByteIOContext): cint; - cdecl; external av__format; -function url_fileno(s: PByteIOContext): PURLContext; - cdecl; external av__format; - -(** - * Return the maximum packet size associated to packetized buffered file - * handle. If the file is not packetized (stream like http or file on - * disk), then 0 is returned. - * - * @param s buffered file handle - * @return maximum packet size in bytes - *) -function url_fget_max_packet_size (s: PByteIOContext): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 52000000} // 52.0.0 -function url_open_buf(var s: PByteIOContext; buf: PAnsiChar; buf_size: cint; flags: cint): cint; -{$ELSE} -function url_open_buf(s: PByteIOContext; buf: PAnsiChar; buf_size: cint; flags: cint): cint; -{$IFEND} - cdecl; external av__format; - -(** return the written or read size *) -function url_close_buf(s: PByteIOContext): cint; - cdecl; external av__format; - -(** - * Open a write only memory stream. - * - * @param s new IO context - * @return zero if no error. - *) -{$IF LIBAVFORMAT_VERSION >= 52000000} // 52.0.0 -function url_open_dyn_buf(var s: PByteIOContext): cint; -{$ELSE} -function url_open_dyn_buf(s: PByteIOContext): cint; -{$IFEND} - cdecl; external av__format; - -(** - * Open a write only packetized memory stream with a maximum packet - * size of 'max_packet_size'. The stream is stored in a memory buffer - * with a big endian 4 byte header giving the packet size in bytes. - * - * @param s new IO context - * @param max_packet_size maximum packet size (must be > 0) - * @return zero if no error. - *) -{$IF LIBAVFORMAT_VERSION >= 52000000} // 52.0.0 -function url_open_dyn_packet_buf(var s: PByteIOContext; max_packet_size: cint): cint; -{$ELSE} -function url_open_dyn_packet_buf(s: PByteIOContext; max_packet_size: cint): cint; -{$IFEND} - cdecl; external av__format; - -(** - * Return the written size and a pointer to the buffer. The buffer - * must be freed with av_free(). If the buffer is opened with - * url_open_dyn_buf, then padding of FF_INPUT_BUFFER_PADDING_SIZE is - * added; if opened with url_open_dyn_packet_buf, no padding is added. - * @param s IO context - * @param pbuffer pointer to a byte buffer - * @return the length of the byte buffer - *) -function url_close_dyn_buf(s: PByteIOContext; pbuffer:PPointer): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION >= 51017001} // 51.17.1 -function ff_crc04C11DB7_update(checksum: culong; buf: {const} PByteArray; - len: cuint): culong; - cdecl; external av__format; -{$IFEND} - -function get_checksum(s: PByteIOContext): culong; - cdecl; external av__format; -procedure init_gsum(s: PByteIOContext; - update_checksum: pointer; - checksum: culong); - cdecl; external av__format; - -(* udp.c *) -function udp_set_remote_url(h: PURLContext; uri: {const} PAnsiChar): cint; - cdecl; external av__format; -function udp_get_local_port(h: PURLContext): cint; - cdecl; external av__format; - -{$IF LIBAVFORMAT_VERSION_MAJOR <= 52} -function udp_get_file_handle(h: PURLContext): cint; - cdecl; external av__format; -{$IFEND} - -implementation - -function url_is_streamed(s: PByteIOContext): cint; -begin - Result := s^.is_streamed; -end; - -end. diff --git a/src/lib/ffmpeg/avutil.pas b/src/lib/ffmpeg/avutil.pas deleted file mode 100644 index c02ac4cb..00000000 --- a/src/lib/ffmpeg/avutil.pas +++ /dev/null @@ -1,509 +0,0 @@ -(* - * copyright (c) 2006 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversions of - * - * libavutil/avutil.h: - * Min. version: 49.0.1, revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 50.24.0, revision 24814, Wed Aug 25 05:00:00 2010 CET - * - * libavutil/mem.h: - * revision 23904, Wed Jul 21 01:00:00 2010 CET - * - * libavutil/log.h: - * revision 23972, Wed Jul 21 01:00:00 2010 CET - * - * include/keep pixfmt.h (change in revision 50.01.0) - * Maybe, the pixelformats are not needed, but it has not been checked. - * log.h is only partial. - * - *) - -unit avutil; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libavutil} -{$ENDIF} - -interface - -uses - ctypes, - mathematics, - rational, - {$IFDEF UNIX} - BaseUnix, - {$ENDIF} - UConfig; - -const - (* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Max. supported version by this header *) - LIBAVUTIL_MAX_VERSION_MAJOR = 50; - LIBAVUTIL_MAX_VERSION_MINOR = 24; - LIBAVUTIL_MAX_VERSION_RELEASE = 0; - LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MAX_VERSION_RELEASE * VERSION_RELEASE); - - (* Min. supported version by this header *) - LIBAVUTIL_MIN_VERSION_MAJOR = 49; - LIBAVUTIL_MIN_VERSION_MINOR = 0; - LIBAVUTIL_MIN_VERSION_RELEASE = 1; - LIBAVUTIL_MIN_VERSION = (LIBAVUTIL_MIN_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_MIN_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_MIN_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBAVUTIL_VERSION < LIBAVUTIL_MIN_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is too old!'} -{$IFEND} - -{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libavutil is not yet supported!'} -{$IFEND} - -{$IF LIBAVUTIL_VERSION >= 49008000} // 49.8.0 -(** - * Return the LIBAVUTIL_VERSION_INT constant. - *) -function avutil_version(): cuint; - cdecl; external av__util; -{$IFEND} - -{$IF LIBAVUTIL_VERSION >= 50004000} // >= 50.4.0 -(** - * Return the libavutil build-time configuration. - *) -function avutil_configuration(): PAnsiChar; - cdecl; external av__util; - -(** - * Return the libavutil license. - *) -function avutil_license(): PAnsiChar; - cdecl; external av__util; -{$IFEND} - -{ - TAVMediaType moved to avutil in LIBAVUTIL_VERSION 50.14.0 - but moving it in the pascal headers was not really necessary - but caused problems. So, I (KMS) left it there. - -type - TAVMediaType = ( - AVMEDIA_TYPE_UNKNOWN = -1, - AVMEDIA_TYPE_VIDEO, - AVMEDIA_TYPE_AUDIO, - AVMEDIA_TYPE_DATA, - AVMEDIA_TYPE_SUBTITLE, - AVMEDIA_TYPE_ATTACHMENT, - AVMEDIA_TYPE_NB - ); -} - -{$INCLUDE error.pas} - -(* libavutil/pixfmt.h up to revision 23144, May 16 2010 *) - -type -(** - * Pixel format. Notes: - * - * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA - * color is put together as: - * (A << 24) | (R << 16) | (G << 8) | B - * This is stored as BGRA on little-endian CPU architectures and ARGB on - * big-endian CPUs. - * - * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized - * image data is stored in AVFrame.data[0]. The palette is transported in - * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is - * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is - * also endian-specific). Note also that the individual RGB palette - * components stored in AVFrame.data[1] should be in the range 0..255. - * This is important as many custom PAL8 video codecs that were designed - * to run on the IBM VGA graphics adapter use 6-bit palette components. - * - * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like - * for pal8. This palette is filled in automatically by the function - * allocating the picture. - * - * Note, make sure that all newly added big endian formats have pix_fmt&1==1 - * and that all newly added little endian formats have pix_fmt&1==0 - * this allows simpler detection of big vs little endian. - *) - - PAVPixelFormat = ^TAVPixelFormat; - TAVPixelFormat = ( - PIX_FMT_NONE= -1, - PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) - PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr - PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... - PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... - PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) - PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) -{$IF LIBAVUTIL_VERSION <= 50001000} // 50.01.0 - PIX_FMT_RGB32, ///< packed RGB 8:8:8, 32bpp, (msb)8A 8R 8G 8B(lsb), in CPU endianness -{$IFEND} - PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) - PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) -{$IF LIBAVUTIL_VERSION <= 50000000} // 50.00.0 - PIX_FMT_RGB565, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), in CPU endianness - PIX_FMT_RGB555, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in CPU endianness, most significant bit to 0 -{$IFEND} - PIX_FMT_GRAY8, ///< Y , 8bpp - PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb - PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette - PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG) - PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG) - PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG) - PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing - PIX_FMT_XVMC_MPEG2_IDCT, - PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 - PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 -{$IF LIBAVUTIL_VERSION <= 50001000} // 50.01.0 - PIX_FMT_BGR32, ///< packed RGB 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in CPU endianness -{$IFEND} -{$IF LIBAVUTIL_VERSION <= 50000000} // 50.00.0 - PIX_FMT_BGR565, ///< packed RGB 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), in CPU endianness - PIX_FMT_BGR555, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in CPU endianness, most significant bit to 1 -{$IFEND} - PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - PIX_FMT_BGR4, ///< packed RGB 1:2:1, bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - PIX_FMT_RGB4, ///< packed RGB 1:2:1, bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits - PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) - PIX_FMT_NV21, ///< as above, but U and V bytes are swapped -{$IF LIBAVUTIL_VERSION <= 50001000} // 50.01.0 - PIX_FMT_RGB32_1, ///< packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in CPU endianness - PIX_FMT_BGR32_1, ///< packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in CPU endianness -{$ELSE} // 50.02.0 - PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... - PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... - PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... - PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... -{$IFEND} - PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian - PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian - PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) - PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG) - PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) - PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$IF LIBAVUTIL_VERSION >= 49015000} // 49.15.0 - PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian - PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian -{$IFEND} -{$IF LIBAVUTIL_VERSION >= 50001000} // 50.01.0 - PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian - PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian - PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 - PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 - - PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian - PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian - PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 - PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 - - PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers - PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers - PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers -{$IFEND} - PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - ); - -const -{$ifdef WORDS_BIGENDIAN} - {$IF LIBAVUTIL_VERSION <= 50001000} // 50.01.0 - PIX_FMT_RGBA = PIX_FMT_RGB32_1; - PIX_FMT_BGRA = PIX_FMT_BGR32_1; - PIX_FMT_ARGB = PIX_FMT_RGB32; - PIX_FMT_ABGR = PIX_FMT_BGR32; - {$ELSE} // 50.02.0 - PIX_FMT_RGB32 = PIX_FMT_ARGB; - PIX_FMT_RGB32_1 = PIX_FMT_RGBA; - PIX_FMT_BGR32 = PIX_FMT_ABGR; - PIX_FMT_BGR32_1 = PIX_FMT_BGRA; - {$IFEND} - PIX_FMT_GRAY16 = PIX_FMT_GRAY16BE; - {$IF LIBAVUTIL_VERSION >= 49015000} // 49.15.0 - PIX_FMT_RGB48 = PIX_FMT_RGB48BE; - {$IFEND} - {$IF LIBAVUTIL_VERSION >= 50001000} // 50.01.0 - PIX_FMT_RGB565 = PIX_FMT_RGB565BE; - PIX_FMT_RGB555 = PIX_FMT_RGB555BE; - PIX_FMT_BGR565 = PIX_FMT_BGR565BE; - PIX_FMT_BGR555 = PIX_FMT_BGR555BE - {$IFEND} -{$else} - {$IF LIBAVUTIL_VERSION <= 50001000} // 50.01.0 - PIX_FMT_RGBA = PIX_FMT_BGR32; - PIX_FMT_BGRA = PIX_FMT_RGB32; - PIX_FMT_ARGB = PIX_FMT_BGR32_1; - PIX_FMT_ABGR = PIX_FMT_RGB32_1; - {$ELSE} // 50.02.0 - PIX_FMT_RGB32 = PIX_FMT_BGRA; - PIX_FMT_RGB32_1 = PIX_FMT_ABGR; - PIX_FMT_BGR32 = PIX_FMT_RGBA; - PIX_FMT_BGR32_1 = PIX_FMT_ARGB; - {$IFEND} - PIX_FMT_GRAY16 = PIX_FMT_GRAY16LE; - {$IF LIBAVUTIL_VERSION >= 49015000} // 49.15.0 - PIX_FMT_RGB48 = PIX_FMT_RGB48LE; - {$IFEND} - {$IF LIBAVUTIL_VERSION >= 50001000} // 50.01.0 - PIX_FMT_RGB565 = PIX_FMT_RGB565LE; - PIX_FMT_RGB555 = PIX_FMT_RGB555LE; - PIX_FMT_BGR565 = PIX_FMT_BGR565LE; - PIX_FMT_BGR555 = PIX_FMT_BGR555LE; - {$IFEND} -{$ENDIF} - -{$IF LIBAVUTIL_VERSION_MAJOR < 50} // 50.0.0 - PIX_FMT_UYVY411 = PIX_FMT_UYYVYY411; - PIX_FMT_RGBA32 = PIX_FMT_RGB32; - PIX_FMT_YUV422 = PIX_FMT_YUYV422; -{$IFEND} - -(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 - -(** - * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. - * In Pascal this can probably not be used and the functions could be removed. - * KMS 8/6/2012 - *) -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} - -(* libavutil/mem.h *) - -(* memory handling functions *) - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU). - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if the block cannot - * be allocated. - * @see av_mallocz() - *) -function av_malloc(size: cuint): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Allocate or reallocate a block of memory. - * If ptr is NULL and size > 0, allocate a new block. If - * size is zero, free the memory block pointed to by ptr. - * @param size Size in bytes for the memory block to be allocated or - * reallocated. - * @param ptr Pointer to a memory block already allocated with - * av_malloc(z)() or av_realloc() or NULL. - * @return Pointer to a newly reallocated block or NULL if the block - * cannot be allocated or the function is used to free the memory block. - * @see av_fast_realloc() - *) -function av_realloc(ptr: pointer; size: cuint): pointer; - cdecl; external av__util; {av_alloc_size(2)} - -(** - * Free a memory block which has been allocated with av_malloc(z)() or - * av_realloc(). - * @param ptr Pointer to the memory block which should be freed. - * @note ptr = NULL is explicitly allowed. - * @note It is recommended that you use av_freep() instead. - * @see av_freep() - *) -procedure av_free(ptr: pointer); - cdecl; external av__util; - -(** - * Allocate a block of size bytes with alignment suitable for all - * memory accesses (including vectors if available on the CPU) and - * zeroes all the bytes of the block. - * @param size Size in bytes for the memory block to be allocated. - * @return Pointer to the allocated block, NULL if it cannot be allocated. - * @see av_malloc() - *) -function av_mallocz(size: cuint): pointer; - cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} - -(** - * Duplicate the string s. - * @param s string to be duplicated. - * @return Pointer to a newly allocated string containing a - * copy of s or NULL if the string cannot be allocated. - *) -function av_strdup({const} s: PAnsiChar): PAnsiChar; - cdecl; external av__util; {av_malloc_attrib} - -(** - * Freesa memory block which has been allocated with av_malloc(z)() or - * av_realloc() and set the pointer pointing to it to NULL. - * @param ptr Pointer to the pointer to the memory block which should - * be freed. - * @see av_free() - *) -procedure av_freep (ptr: pointer); - cdecl; external av__util; - -(* libavutil/log.h *) - -const -{$IF LIBAVUTIL_VERSION_MAJOR < 50} - AV_LOG_QUIET = -1; - AV_LOG_FATAL = 0; - AV_LOG_ERROR = 0; - AV_LOG_WARNING = 1; - AV_LOG_INFO = 1; - AV_LOG_VERBOSE = 1; - AV_LOG_DEBUG = 2; -{$ELSE} - AV_LOG_QUIET = -8; - -(** - * Something went really wrong and we will crash now. - *) - AV_LOG_PANIC = 0; - -(** - * Something went wrong and recovery is not possible. - * For example, no header was found for a format which depends - * on headers or an illegal combination of parameters is used. - *) - AV_LOG_FATAL = 8; - -(** - * Something went wrong and cannot losslessly be recovered. - * However, not all future data is affected. - *) - AV_LOG_ERROR = 16; - -(** - * Something somehow does not look correct. This may or may not - * lead to problems. An example would be the use of '-vstrict -2'. - *) - AV_LOG_WARNING = 24; - - AV_LOG_INFO = 32; - AV_LOG_VERBOSE = 40; - -(** - * Stuff which is only useful for libav* developers. - *) - AV_LOG_DEBUG = 48; -{$IFEND} - -(** - * Send the specified message to the log if the level is less than or equal - * to the current av_log_level. By default, all logging messages are sent to - * stderr. This behavior can be altered by setting a different av_vlog callback - * function. - * - * @param avcl A pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct. - * @param level The importance level of the message, lower values signifying - * higher importance. - * @param fmt The format string (printf-compatible) that specifies how - * subsequent arguments are converted to output. - * @see av_vlog - *) - -{** to be translated if needed -#ifdef __GNUC__ -void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); -#else -void av_log(void*, int level, const char *fmt, ...); -#endif - -void av_vlog(void*, int level, const char *fmt, va_list); -**} - -function av_log_get_level(): cint; - cdecl; external av__util; -procedure av_log_set_level(level: cint); - cdecl; external av__util; - -{** to be translated if needed -void av_log_set_callback(void (*)(void*, int, const char*, va_list)); -void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); -**} - -{$IF LIBAVUTIL_VERSION >= 50015003} // 50.15.3 -function av_default_item_name (ctx: pointer): Pchar; - cdecl; external av__util; -{$IFEND} - -implementation - -(* libavutil/common.h *) - -function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); -end; - -function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); -end; - -end. diff --git a/src/lib/ffmpeg/error.pas b/src/lib/ffmpeg/error.pas deleted file mode 100644 index 720005b6..00000000 --- a/src/lib/ffmpeg/error.pas +++ /dev/null @@ -1,115 +0,0 @@ -(* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of the Pascal port of ffmpeg. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/error.h - * Max. avutil version: 50.21.0, revision 24190, Wed Jul 21 01:00:00 2010 CET - * - *) - -{$IF LIBAVUTIL_VERSION >= 50012000} // >= 50.12.0 - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needed EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) not: inverts all bits. This gives -1 and -3 - * 3) - 1: positive EINVAL gives -1, negative 1 - *) -const - AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; - -(* -#if EINVAL > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - AVERROR_UNKNOWN = AVERROR_SIGN * EINVAL; (**< unknown error *) - AVERROR_IO = AVERROR_SIGN * EIO; (**< I/O error *) - AVERROR_NUMEXPECTED = AVERROR_SIGN * EDOM; (**< Number syntax expected in filename. *) - AVERROR_INVALIDDATA = AVERROR_SIGN * EINVAL; (**< invalid data found *) - AVERROR_NOMEM = AVERROR_SIGN * ENOMEM; (**< not enough memory *) - AVERROR_NOFMT = AVERROR_SIGN * EILSEQ; (**< unknown format *) - AVERROR_NOTSUPP = AVERROR_SIGN * ENOSYS; (**< Operation not supported. *) - AVERROR_NOENT = AVERROR_SIGN * ENOENT; (**< No such file or directory. *) -{$IF LIBAVCODEC_VERSION >= 52017000} // 52.17.0 - AVERROR_EOF = AVERROR_SIGN * EPIPE; (**< End of file. *) -{$IFEND} - // Note: function calls as constant-initializers are invalid - //AVERROR_PATCHWELCOME = -MKTAG('P','A','W','E'); {**< Not yet implemented in FFmpeg. Patches welcome. *} - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); -{$IFEND} - -{$IF LIBAVUTIL_VERSION >= 50013000} // >= 50.13.0 -(* - * Put a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errnum error code to describe - * @param errbuf buffer to which description is written - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) - -function av_strerror(errnum: cint; errbuf: Pchar; errbuf_size: cint): cint; - cdecl; external av__util; -{$IFEND} diff --git a/src/lib/ffmpeg/mathematics.pas b/src/lib/ffmpeg/mathematics.pas deleted file mode 100644 index 98901c2a..00000000 --- a/src/lib/ffmpeg/mathematics.pas +++ /dev/null @@ -1,133 +0,0 @@ -(* - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/mathematics.h - * avutil max. version 50.23.0, revision 24439, Wed Aug 25 05:00:00 2010 CET - * - *) - -unit mathematics; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -interface - -uses - ctypes, - rational, - UConfig; - -const - M_E = 2.7182818284590452354; // e - M_LN2 = 0.69314718055994530942; // log_e 2 - M_LN10 = 2.30258509299404568402; // log_e 10 -{$IF LIBAVUTIL_VERSION >= 50009000} // >= 50.9.0 - M_LOG2_10 = 3.32192809488736234787; // log_2 10 -{$IFEND} -{$IF LIBAVUTIL_VERSION >= 50023000} // >= 50.23.0 - M_PHI = 1.61803398874989484820; // phi / golden ratio -{$IFEND} - M_PI = 3.14159265358979323846; // pi - M_SQRT1_2 = 0.70710678118654752440; // 1/sqrt(2) -{$IF LIBAVUTIL_VERSION >= 50014000} // >= 50.14.0 - M_SQRT2 = 1.41421356237309504880; // sqrt(2) -{$IFEND} -{$IF LIBAVUTIL_VERSION >= 50005001} // >= 50.5.1 - NAN = 0.0/0.0; - INFINITY = 1.0/0.0; -{$IFEND} - -type - TAVRounding = ( - AV_ROUND_ZERO = 0, ///< Round toward zero. - AV_ROUND_INF = 1, ///< Round away from zero. - AV_ROUND_DOWN = 2, ///< Round toward -infinity. - AV_ROUND_UP = 3, ///< Round toward +infinity. - AV_ROUND_NEAR_INF = 5 ///< Round to nearest and halfway cases away from zero. - ); - -{$IF LIBAVUTIL_VERSION >= 49013000} // 49.13.0 -(** - * Return the greatest common divisor of a and b. - * If both a or b are 0 or either or both are <0 then behavior is - * undefined. - *) -function av_gcd(a: cint64; b: cint64): cint64; - cdecl; external av__util; {av_const} -{$IFEND} - -(** - * Rescale a 64-bit integer with rounding to nearest. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale (a, b, c: cint64): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer with specified rounding. - * A simple a*b/c isn't possible as it can overflow. - *) -function av_rescale_rnd (a, b, c: cint64; enum: TAVRounding): cint64; - cdecl; external av__util; {av_const} - -(** - * Rescale a 64-bit integer by 2 rational numbers. - *) -function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64; - cdecl; external av__util; {av_const} - -{$IF LIBAVUTIL_VERSION >= 50008000} // 50.8.0 -(** - * Compare 2 timestamps each in its own timebases. - * The result of the function is undefined if one of the timestamps - * is outside the int64_t range when represented in the others timebase. - * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position - *) -function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVRational): cint; - cdecl; external av__util; -{$IFEND} - -{$IF LIBAVUTIL_VERSION >= 50018000} // 50.18.0 -(** - * Compare 2 integers modulo mod. - * That is we compare integers a and b for which only the least - * significant log2(mod) bits are known. - * - * @param mod must be a power of 2 - * @return a negative value if a is smaller than b - * a positiv value if a is greater than b - * 0 if a equals b - *) -function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; - cdecl; external av__util; -{$IFEND} - -implementation - -end. diff --git a/src/lib/ffmpeg/opt.pas b/src/lib/ffmpeg/opt.pas deleted file mode 100644 index 8669eaf6..00000000 --- a/src/lib/ffmpeg/opt.pas +++ /dev/null @@ -1,261 +0,0 @@ -(* - * AVOptions - * copyright (c) 2005 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavcodec/opt.h - * Max. avcodec version: 52.86.1, 24882, Wed Aug 23 07:00:00 2010 CET - * - *) - -unit opt; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -interface - -uses - ctypes, - rational, - UConfig; - -type - TAVOptionType = ( - FF_OPT_TYPE_FLAGS, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: cdouble; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - -{$IF LIBAVCODEC_VERSION >= 52042000} // >= 52.42.0 -(** - * AVOption2. - * THIS IS NOT PART OF THE API/ABI YET! - * This is identical to AVOption except that default_val was replaced by - * an union, it should be compatible with AVOption on normal platforms. - *) -type - PAVOption2 = ^TAVOption2; - TAVOption2 = record - name : {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help : {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset : cint; - type_ : TAVOptionType; - - (** - * the default value for scalar options - *) - default_val : record - case cint of - 0 : (dbl: cdouble); - 1 : (str: PAnsiChar); - end; - min : cdouble; - max : cdouble; - flags : cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 51039000} // 51.39.0 -(** - * Look for an option in obj. Look only for the options which - * have the flags set as specified in mask and flags (that is, - * for which it is the case that opt->flags & mask == flags). - * - * @param[in] obj a pointer to a struct whose first element is a - * pointer to an AVClass - * @param[in] name the name of the option to look for - * @param[in] unit the unit of the option to look for, or any if NULL - * @return a pointer to the option found, or NULL if no option - * has been found - *) -function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit_: PAnsiChar; mask: cint; flags: cint): {const} PAVOption; - cdecl; external av__codec; -{$IFEND} - -{$IF LIBAVCODEC_VERSION_MAJOR < 53} - -(** - * @see av_set_string2() - *) -function av_set_string(obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar): {const} PAVOption; - cdecl; external av__codec; deprecated; - -{$IF LIBAVCODEC_VERSION >= 51059000} // 51.59.0 -(** - * @return a pointer to the AVOption corresponding to the field set or - * NULL if no matching AVOption exists, or if the value val is not - * valid - * @see av_set_string3() - *) -function av_set_string2(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint): {const} PAVOption; - cdecl; external av__codec; deprecated; -{$IFEND} - -{$IFEND} - -{$IF LIBAVCODEC_VERSION >= 52007000} // 52.7.0 -(** - * Set the field of obj with the given name to value. - * - * @param[in] obj A struct whose first element is a pointer to an - * AVClass. - * @param[in] name the name of the field to set - * @param[in] val The value to set. If the field is not of a string - * type, then the given string is parsed. - * SI postfixes and some named scalars are supported. - * If the field is of a numeric type, it has to be a numeric or named - * scalar. Behavior with more than one scalar and +- infix operators - * is undefined. - * If the field is of a flags type, it has to be a sequence of numeric - * scalars or named flags separated by '+' or '-'. Prefixing a flag - * with '+' causes it to be set without affecting the other flags; - * similarly, '-' unsets a flag. - * @param[out] o_out if non-NULL put here a pointer to the AVOption - * found - * @param alloc when 1 then the old value will be av_freed() and the - * new av_strduped() - * when 0 then no av_free() nor av_strdup() will be used - * @return 0 if the value has been set, or an AVERROR code in case of - * error: - * AVERROR(ENOENT) if no matching option exists - * AVERROR(ERANGE) if the value is out of range - * AVERROR(EINVAL) if the value is not valid - *) -function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint; - cdecl; external av__codec; -{$IFEND} - -function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption; - cdecl; external av__codec; - -function av_set_q(obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption; - cdecl; external av__codec; - -function av_set_int(obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption; - cdecl; external av__codec; - -function av_get_double(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cdouble; - cdecl; external av__codec; - -function av_get_q(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): TAVRational; - cdecl; external av__codec; - -function av_get_int(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cint64; - cdecl; external av__codec; - -function av_get_string(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar; - cdecl; external av__codec; - -function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption; - cdecl; external av__codec; - -function av_opt_show(obj: pointer; av_log_obj: pointer): cint; - cdecl; external av__codec; - -procedure av_opt_set_defaults(s: pointer); - cdecl; external av__codec; - -{$IF LIBAVCODEC_VERSION >= 51039000} // 51.39.0 -procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint); - cdecl; external av__codec; -{$IFEND} - -implementation - -end. diff --git a/src/lib/ffmpeg/rational.pas b/src/lib/ffmpeg/rational.pas deleted file mode 100644 index 24bbfa8d..00000000 --- a/src/lib/ffmpeg/rational.pas +++ /dev/null @@ -1,188 +0,0 @@ -(* - * rational numbers - * Copyright (c) 2003 Michael Niedermayer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * This is a part of Pascal porting of ffmpeg. - * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. - * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT - * in the source codes. - * - Changes and updates by the UltraStar Deluxe Team - * - * Conversion of libavutil/rational.h - * avutil max. version 50.21.0, revision 24190, Wed Jul 21 01:00:00 2010 CET - * - *) - -unit rational; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$I switches.inc} - -interface - -uses - ctypes, - UConfig; - -type - (* - * rational number numerator/denominator - *) - PAVRational = ^TAVRational; - TAVRational = record - num: cint; ///< numerator - den: cint; ///< denominator - end; - - TAVRationalArray = array[0 .. (MaxInt div SizeOf(TAVRational))-1] of TAVRational; - PAVRationalArray = ^TAVRationalArray; - -(** - * Compare two rationals. - * @param a first rational - * @param b second rational - * @return 0 if a==b, 1 if a>b, -1 if a 0) then - Result := (tmp shr 63) or 1 - else - Result := 0; - -{ C original: - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; -} -{ - if tmp <> 0 then - Result := ((tmp xor a.den xor b.den) >> 63) or 1 - else if (b.den and a.den) <> 0 then - Result := 0 - else if (a.num and b.num) <> 0 then - Result := (a.num >> 31) - (b.num >> 31) - else - Result := low(cint); -} -end; - -function av_q2d(a: TAVRational): cdouble; {$IFDEF HasInline}inline;{$ENDIF} -begin - Result := a.num / a.den; -end; - -end. diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas deleted file mode 100644 index 7289e902..00000000 --- a/src/lib/ffmpeg/swscale.pas +++ /dev/null @@ -1,434 +0,0 @@ -(* - * Copyright (C) 2001-2003 Michael Niedermayer - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * FFmpeg Pascal port - * - Ported by the UltraStar Deluxe Team - * - * Conversion of libswscale/swscale.h - * Max. version: 0.11.0, revision 31301, Mon Jul 12 8:00:00 2010 CET - *) - -unit swscale; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -{$IFDEF DARWIN} - {$linklib libswscale} -{$ENDIF} - -interface - -uses - ctypes, - avutil, - avcodec, - UConfig; - -const -(* - * IMPORTANT: The official FFmpeg C headers change very quickly. Often some - * of the data structures are changed so that they become incompatible with - * older header files. The Pascal headers have to be adjusted to those changes, - * otherwise the application might crash randomly or strange bugs (not - * necessarily related to video or audio due to buffer overflows etc.) might - * occur. - * - * In the past users reported problems with USDX that took hours to fix and - * the problem was an unsupported version of FFmpeg. So we decided to disable - * support for future versions of FFmpeg until the headers are revised by us - * for that version as they otherwise most probably will break USDX. - * - * If the headers do not yet support your FFmpeg version you may want to - * adjust the max. version numbers manually but please note: it may work but - * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT - * for the game if the MAX. VERSION WAS CHANGED. - * - * The only safe way to support new versions of FFmpeg is to add the changes - * of the FFmpeg git repository C headers to the Pascal headers. - * You can accelerate this process by posting a patch with the git changes - * translated to Pascal to our bug tracker (please join our IRC chat before - * you start working on it). Simply adjusting the max. versions is NOT a valid - * fix. - *) - (* Max. supported version by this header *) - LIBSWSCALE_MAX_VERSION_MAJOR = 0; - LIBSWSCALE_MAX_VERSION_MINOR = 11; - LIBSWSCALE_MAX_VERSION_RELEASE = 0; - LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_MAX_VERSION_RELEASE * VERSION_RELEASE); - -(* Check if linked versions are supported *) -{$IF (LIBSWSCALE_VERSION > LIBSWSCALE_MAX_VERSION)} - {$MESSAGE Error 'Linked version of libswscale is not yet supported!'} -{$IFEND} - -type - TQuadCintArray = array[0..3] of cint; - PQuadCintArray = ^TQuadCintArray; - TCintArray = array[0..0] of cint; - PCintArray = ^TCintArray; - TPCuint8Array = array[0..0] of PCuint8; - PPCuint8Array = ^TPCuint8Array; - -{$IF LIBSWSCALE_VERSION >= 000006001} // 0.6.1 -(** - * Returns the LIBSWSCALE_VERSION_INT constant. - *) -function swscale_version(): cuint; - cdecl; external sw__scale; -{$IFEND} - -{$IF LIBSWSCALE_VERSION >= 000007002} // 0.7.2 -(** - * Returns the libswscale build-time configuration. - *) -function swscale_configuration(): PAnsiChar; - cdecl; external sw__scale; - -(** - * Returns the libswscale license. - *) -function swscale_license(): PAnsiChar; - cdecl; external sw__scale; -{$IFEND} - -const - (* values for the flags, the stuff on the command line is different *) - SWS_FAST_BILINEAR = 1; - SWS_BILINEAR = 2; - SWS_BICUBIC = 4; - SWS_X = 8; - SWS_POINT = $10; - SWS_AREA = $20; - SWS_BICUBLIN = $40; - SWS_GAUSS = $80; - SWS_SINC = $100; - SWS_LANCZOS = $200; - SWS_SPLINE = $400; - - SWS_SRC_V_CHR_DROP_MASK = $30000; - SWS_SRC_V_CHR_DROP_SHIFT = 16; - - SWS_PARAM_DEFAULT = 123456; - - SWS_PRINT_INFO = $1000; - - // the following 3 flags are not completely implemented - // internal chrominace subsampling info - SWS_FULL_CHR_H_INT = $2000; - // input subsampling info - SWS_FULL_CHR_H_INP = $4000; - SWS_DIRECT_BGR = $8000; - SWS_ACCURATE_RND = $40000; - SWS_BITEXACT = $80000; - - SWS_CPU_CAPS_MMX = $80000000; - SWS_CPU_CAPS_MMX2 = $20000000; - SWS_CPU_CAPS_3DNOW = $40000000; - SWS_CPU_CAPS_ALTIVEC = $10000000; - SWS_CPU_CAPS_BFIN = $01000000; - - SWS_MAX_REDUCE_CUTOFF = 0.002; - - SWS_CS_ITU709 = 1; - SWS_CS_FCC = 4; - SWS_CS_ITU601 = 5; - SWS_CS_ITU624 = 5; - SWS_CS_SMPTE170M = 5; - SWS_CS_SMPTE240M = 7; - SWS_CS_DEFAULT = 5; - -{$IF LIBSWSCALE_VERSION >= 000010000} // 0.10.0 -(** - * Returns a pointer to yuv<->rgb coefficients for the given colorspace - * suitable for sws_setColorspaceDetails(). - * - * @param colorspace One of the SWS_CS_* macros. If invalid, - * SWS_CS_DEFAULT is used. - *) -function sws_getCoefficients(colorspace: cint): Pcint; - cdecl; external sw__scale; -{$IFEND} - -type - - // when used for filters they must have an odd number of elements - // coeffs cannot be shared between vectors - PSwsVector = ^TSwsVector; - TSwsVector = record - coeff: PCdouble; // pointer to the list of coefficients - length: cint; // number of coefficients in the vector - end; - - // vectors can be shared - PSwsFilter = ^TSwsFilter; - TSwsFilter = record - lumH: PSwsVector; - lumV: PSwsVector; - chrH: PSwsVector; - chrV: PSwsVector; - end; - - PSwsContext = ^TSwsContext; - TSwsContext = record - {internal structure} - end; - -{$IF LIBSWSCALE_VERSION >= 000008000} // 0.8.0 -(** - * Returns a positive value if pix_fmt is a supported input format, 0 - * otherwise. - *) -function sws_isSupportedInput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; - -(** - * Returns a positive value if pix_fmt is a supported output format, 0 - * otherwise. - *) -function sws_isSupportedOutput(pix_fmt: TAVPixelFormat): cint; - cdecl; external sw__scale; -{$IFEND} - -(** - * Frees the swscaler context swsContext. - * If swsContext is NULL, then does nothing. - *) -procedure sws_freeContext(swsContext: PSwsContext); - cdecl; external sw__scale; - -(** - * Allocates and returns a SwsContext. You need it to perform - * scaling/conversion operations using sws_scale(). - * - * @param srcW the width of the source image - * @param srcH the height of the source image - * @param srcFormat the source image format - * @param dstW the width of the destination image - * @param dstH the height of the destination image - * @param dstFormat the destination image format - * @param flags specify which algorithm and options to use for rescaling - * @return a pointer to an allocated context, or NULL in case of error - *) -function sws_getContext(srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -(** - * Scales the image slice in srcSlice and puts the resulting scaled - * slice in the image in dst. A slice is a sequence of consecutive - * rows in an image. - * - * Slices have to be provided in sequential order, either in - * top-bottom or bottom-top order. If slices are provided in - * non-sequential order the behavior of the function is undefined. - * - * @param context the scaling context previously created with - * sws_getContext() - * @param srcSlice the array containing the pointers to the planes of - * the source slice - * @param srcStride the array containing the strides for each plane of - * the source image - * @param srcSliceY the position in the source image of the slice to - * process, that is the number (counted starting from - * zero) in the image of the first row of the slice - * @param srcSliceH the height of the source slice, that is the number - * of rows in the slice - * @param dst the array containing the pointers to the planes of - * the destination image - * @param dstStride the array containing the strides for each plane of - * the destination image - * @return the height of the output slice - *) -function sws_scale(context: PSwsContext; {const} srcSlice: PPCuint8Array; {const} srcStride: PCintArray; - srcSliceY: cint; srcSliceH: cint; {const} dst: PPCuint8Array; {const} dstStride: PCintArray): cint; - cdecl; external sw__scale; - -{$IF LIBSWSCALE_VERSION_MAJOR < 1} -// deprecated. Use sws_scale() instead. -function sws_scale_ordered(context: PSwsContext; {const} src: PPCuint8Array; - srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint; - dst: PPCuint8Array; dstStride: PCintArray): cint; - cdecl; external sw__scale; deprecated; -{$IFEND} - -(** - * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] - * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235 - * @return -1 if not supported - *) -function sws_setColorspaceDetails(c: PSwsContext; inv_table: PQuadCintArray; - srcRange: cint; table: PQuadCintArray; dstRange: cint; - brightness: cint; contrast: cint; saturation: cint): cint; - cdecl; external sw__scale; - -(** - * @return -1 if not supported - *) -function sws_getColorspaceDetails(c: PSwsContext; var inv_table: PQuadCintArray; - var srcRange: cint; var table: PQuadCintArray; var dstRange: cint; - var brightness: cint; var contrast: cint; var saturation: cint): cint; - cdecl; external sw__scale; - -(** - * Returns a normalized Gaussian curve used to filter stuff - * quality=3 is high quality, lower is lower quality. - *) -function sws_getGaussianVec(variance: cdouble; quality: cdouble): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocates and returns a vector with length coefficients, all - * with the same value c. - *) -function sws_getConstVec(c: cdouble; length: cint): PSwsVector; - cdecl; external sw__scale; - -(** - * Allocates and returns a vector with just one coefficient, with - * value 1.0. - *) -function sws_getIdentityVec: PSwsVector; - cdecl; external sw__scale; - -(** - * Scales all the coefficients of a by the scalar value. - *) -procedure sws_scaleVec(a: PSwsVector; scalar: cdouble); - cdecl; external sw__scale; - -(** - * Scales all the coefficients of a so that their sum equals height. - *) -procedure sws_normalizeVec(a: PSwsVector; height: cdouble); - cdecl; external sw__scale; - -procedure sws_convVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_addVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_subVec(a: PSwsVector; b: PSwsVector); - cdecl; external sw__scale; - -procedure sws_shiftVec(a: PSwsVector; shift: cint); - cdecl; external sw__scale; - -(** - * Allocates and returns a clone of the vector a, that is a vector - * with the same coefficients as a. - *) -function sws_cloneVec(a: PSwsVector): PSwsVector; - cdecl; external sw__scale; - -{$IF LIBSWSCALE_VERSION_MAJOR < 1} -// deprecated Use sws_printVec2() instead. - -procedure sws_printVec(a: PSwsVector); - cdecl; external sw__scale; deprecated; -{$IFEND} - -{$IF LIBSWSCALE_VERSION >= 000007000} // >= 0.7.0 -(** - * Prints with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - *) -procedure sws_printVec2(a: PSwsVector; - log_ctx: PAVClass; // PAVClass is declared in avcodec.pas - log_level: cint); - cdecl; external sw__scale; -{$IFEND} - -procedure sws_freeVec(a: PSwsVector); - cdecl; external sw__scale; - -function sws_getDefaultFilter(lumaGBlur: cfloat; chromaGBlur: cfloat; - lumaSharpen: cfloat; chromaSharpen: cfloat; - chromaHShift: cfloat; chromaVShift: cfloat; - verbose: cint): PSwsFilter; - cdecl; external sw__scale; - -procedure sws_freeFilter(filter: PSwsFilter); - cdecl; external sw__scale; - -(** - * Checks if context can be reused, otherwise reallocates a new - * one. - * - * If context is NULL, just calls sws_getContext() to get a new - * context. Otherwise, checks if the parameters are the ones already - * saved in context. If that is the case, returns the current - * context. Otherwise, frees context and gets a new context with - * the new parameters. - * - * Be warned that srcFilter and dstFilter are not checked, they - * are assumed to remain the same. - *) -function sws_getCachedContext(context: PSwsContext; - srcW: cint; srcH: cint; srcFormat: TAVPixelFormat; - dstW: cint; dstH: cint; dstFormat: TAVPixelFormat; - flags: cint; srcFilter: PSwsFilter; - dstFilter: PSwsFilter; param: PCdouble): PSwsContext; - cdecl; external sw__scale; - -{$IF LIBSWSCALE_VERSION >= 000011000} // >= 0.11.0 -(** - * Converts an 8bit paletted frame into a frame with a color depth of 32-bits. - * - * The output frame will have the same packed format as the palette. - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: clong; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; - -(** - * Converts an 8bit paletted frame into a frame with a color depth of 24 bits. - * - * With the palette format "ABCD", the destination frame ends up with the format "ABC". - * - * @param src source frame buffer - * @param dst destination frame buffer - * @param num_pixels number of pixels to convert - * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src - *) -procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array; - dst: PPCuint8Array; - num_pixels: clong; - {const} palette: PPCuint8Array); - cdecl; external sw__scale; -{$IFEND} - -implementation - -end. diff --git a/src/lib/lib-info.txt b/src/lib/lib-info.txt index 0a184568..f3dae030 100644 --- a/src/lib/lib-info.txt +++ b/src/lib/lib-info.txt @@ -1,7 +1,3 @@ -bass: -http://www.un4seen.com/ (2.4.2.1) -- FPC Mac OS X compatibility fixes - fft: translation of audacity's FFT.cpp by hennymcc (maybe replace this with FFTW?) @@ -37,14 +33,6 @@ autocreated H2Pas file taken from freepascal trunk - delphi compatibility - comments added -portaudio: -translation of the (patched) audacity C headers by hennymcc. -See http://audacity.cvs.sourceforge.net/viewvc/audacity/lib-src/portaudio-v19/include/?sortdir=down - -portmixer: -translation of the (patched) audacity C headers by hennymcc. -- Unlike portaudio portmixer is part of audacity and there is no linux package for it. If we want to use it for linux, we have to link it statically. Unfortunately it requires a patched version of portaudio (which is part of audacity and statically linked to) so we have to statically link portaudio too :(. - projectM: translation of the original C++ headers and C-wrapper by hennymcc @@ -57,4 +45,4 @@ taken from http://www.itwriting.com/blog/a-simple-delphi-wrapper-for-sqlite-3 zlib: taken from freepascal (slightly patched) -- delphi compatibility \ No newline at end of file +- delphi compatibility diff --git a/src/lib/midi/MidiFile.pas b/src/lib/midi/MidiFile.pas index c0271521..f9d7df1a 100644 --- a/src/lib/midi/MidiFile.pas +++ b/src/lib/midi/MidiFile.pas @@ -235,7 +235,7 @@ function MyTimeToStr(val: integer): string; procedure Register; implementation - +{$WARNINGS OFF} uses mmsystem; @@ -479,7 +479,7 @@ procedure TMidifile.SetOnMidiEvent(handler: TOnMidiEvent); // end; end; -{$WARNINGS OFF} + procedure TMidifile.MidiTimer(Sender: TObject); begin if playing then @@ -488,7 +488,7 @@ procedure TMidifile.MidiTimer(Sender: TObject); if assigned(FOnUpdateEvent) then FOnUpdateEvent(self); end; end; -{$WARNINGS ON} + procedure TMidifile.StartPlaying; var @@ -506,7 +506,6 @@ procedure TMidifile.StartPlaying; currentTime := 0; end; -{$WARNINGS OFF} procedure TMidifile.ContinuePlaying; begin PlayStartTime := GetTickCount - currentTime; @@ -516,7 +515,6 @@ procedure TMidifile.ContinuePlaying; SetMidiTimer; end; -{$WARNINGS ON} procedure TMidifile.StopPlaying; begin @@ -533,7 +531,6 @@ function TMidiFile.GetCurrentTime: integer; procedure TMidifile.PlayToTime(time: integer); var i: integer; - track: TMidiTrack; pos: integer; deltaTime: integer; begin @@ -555,7 +552,6 @@ procedure TMidifile.PlayToTime(time: integer); procedure TMidifile.GoToTime(time: integer); var i: integer; - track: TMidiTrack; pos: integer; begin // this function should be changed because FusPerTick might not be constant @@ -648,9 +644,8 @@ procedure TMidifile.ProcessTrackChunk; dTime: integer; event: integer; len: integer; - str: string; + // str: string; midiEvent: PMidiEvent; - i: integer; us_per_quarter: integer; begin chunkIndex := chunkData; @@ -870,6 +865,8 @@ function KeyToStr(key: integer): string; 9: str := 'A'; 10: str := 'A#'; 11: str := 'B'; + else + str := '' end; Result := str + IntToStr(key div 12); end; @@ -962,5 +959,5 @@ procedure Register; begin RegisterComponents('Synth', [TMidiFile]); end; - +{$WARNINGS ON} end. diff --git a/src/lib/portaudio/portaudio.pas b/src/lib/portaudio/portaudio.pas deleted file mode 100644 index ea7d06b7..00000000 --- a/src/lib/portaudio/portaudio.pas +++ /dev/null @@ -1,1160 +0,0 @@ -{* - * $Id: portaudio.h,v 1.7 2007/08/16 20:45:34 richardash1981 Exp $ - * PortAudio Portable Real-Time Audio Library - * PortAudio API Header File - * Latest version available at: http://www.portaudio.com/ - * - * Copyright (c) 1999-2002 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - *} - -{* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - *} - -{** @file - @brief The PortAudio API. -*} - -unit portaudio; - -{$IFDEF FPC} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) - {$MODE DELPHI } -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -interface - -uses - ctypes; - -const -{$IF Defined(MSWINDOWS)} - LibName = 'portaudio_x86.dll'; -{$ELSEIF Defined(DARWIN)} - // this is for portaudio version 19 - LibName = 'libportaudio.2.dylib'; - {$LINKLIB libportaudio.2} -{$ELSEIF Defined(UNIX)} - LibName = 'libportaudio.so'; -{$IFEND} - -{** Retrieve the release number of the currently running PortAudio build, - eg 1900. -*} -function Pa_GetVersion(): cint; cdecl; external LibName; - - -{** Retrieve a textual description of the current PortAudio build, - eg "PortAudio V19-devel 13 October 2002". -*} -function Pa_GetVersionText(): PChar; cdecl; external LibName; - - -{** Error codes returned by PortAudio functions. - Note that with the exception of paNoError, all PaErrorCodes are negative. -*} - -type TPaError = cint; -type TPaErrorCode = {enum}cint; const -{enum_begin PaErrorCode} - paNoError = 0; - - paNotInitialized = -10000; - paUnanticipatedHostError = (paNotInitialized+ 1); - paInvalidChannelCount = (paNotInitialized+ 2); - paInvalidSampleRate = (paNotInitialized+ 3); - paInvalidDevice = (paNotInitialized+ 4); - paInvalidFlag = (paNotInitialized+ 5); - paSampleFormatNotSupported = (paNotInitialized+ 6); - paBadIODeviceCombination = (paNotInitialized+ 7); - paInsufficientMemory = (paNotInitialized+ 8); - paBufferTooBig = (paNotInitialized+ 9); - paBufferTooSmall = (paNotInitialized+10); - paNullCallback = (paNotInitialized+11); - paBadStreamPtr = (paNotInitialized+12); - paTimedOut = (paNotInitialized+13); - paInternalError = (paNotInitialized+14); - paDeviceUnavailable = (paNotInitialized+15); - paIncompatibleHostApiSpecificStreamInfo = (paNotInitialized+16); - paStreamIsStopped = (paNotInitialized+17); - paStreamIsNotStopped = (paNotInitialized+18); - paInputOverflowed = (paNotInitialized+19); - paOutputUnderflowed = (paNotInitialized+20); - paHostApiNotFound = (paNotInitialized+21); // The notes below are from the - paInvalidHostApi = (paNotInitialized+22); // original file portaudio.h - paCanNotReadFromACallbackStream = (paNotInitialized+23); {**< @todo review error code name *} - paCanNotWriteToACallbackStream = (paNotInitialized+24); {**< @todo review error code name *} - paCanNotReadFromAnOutputOnlyStream = (paNotInitialized+25); {**< @todo review error code name *} - paCanNotWriteToAnInputOnlyStream = (paNotInitialized+26); {**< @todo review error code name *} - paIncompatibleStreamHostApi = (paNotInitialized+27); - paBadBufferPtr = (paNotInitialized+28); -{enum_end PaErrorCode} - - -{** Translate the supplied PortAudio error code into a human readable - message. -*} -function Pa_GetErrorText( errorCode: TPaError ): PChar; cdecl; external LibName; - - -{** Library initialization function - call this before using PortAudio. - This function initialises internal data structures and prepares underlying - host APIs for use. With the exception of Pa_GetVersion(), Pa_GetVersionText(), - and Pa_GetErrorText(), this function MUST be called before using any other - PortAudio API functions. - - If Pa_Initialize() is called multiple times, each successful - call must be matched with a corresponding call to Pa_Terminate(). - Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not - required to be fully nested. - - Note that if Pa_Initialize() returns an error code, Pa_Terminate() should - NOT be called. - - @return paNoError if successful, otherwise an error code indicating the cause - of failure. - - @see Pa_Terminate -*} -function Pa_Initialize(): TPaError; cdecl; external LibName; - - -{** Library termination function - call this when finished using PortAudio. - This function deallocates all resources allocated by PortAudio since it was - initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has - been called multiple times, each call must be matched with a corresponding call - to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically - close any PortAudio streams that are still open. - - Pa_Terminate() MUST be called before exiting a program which uses PortAudio. - Failure to do so may result in serious resource leaks, such as audio devices - not being available until the next reboot. - - @return paNoError if successful, otherwise an error code indicating the cause - of failure. - - @see Pa_Initialize -*} -function Pa_Terminate(): TPaError; cdecl; external LibName; - - - -{** The type used to refer to audio devices. Values of this type usually - range from 0 to (Pa_GetDeviceCount()-1), and may also take on the PaNoDevice - and paUseHostApiSpecificDeviceSpecification values. - - @see Pa_GetDeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification -*} -type TPaDeviceIndex = cint; - - -{** A special PaDeviceIndex value indicating that no device is available, - or should be used. - - @see PaDeviceIndex -*} -const paNoDevice = TPaDeviceIndex(-1); - - -{** A special PaDeviceIndex value indicating that the device(s) to be used - are specified in the host api specific stream info structure. - - @see PaDeviceIndex -*} -const paUseHostApiSpecificDeviceSpecification = TPaDeviceIndex(-2); - - -{* Host API enumeration mechanism *} - -{** The type used to enumerate to host APIs at runtime. Values of this type - range from 0 to (Pa_GetHostApiCount()-1). - - @see Pa_GetHostApiCount -*} -type TPaHostApiIndex = cint; - -{** Retrieve the number of available host APIs. Even if a host API is - available it may have no devices available. - - @return A non-negative value indicating the number of available host APIs - or, a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. - - @see PaHostApiIndex -*} -function Pa_GetHostApiCount(): TPaHostApiIndex; cdecl; external LibName; - - -{** Retrieve the index of the default host API. The default host API will be - the lowest common denominator host API on the current platform and is - unlikely to provide the best performance. - - @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1) - indicating the default host API index or, a PaErrorCode (which are always - negative) if PortAudio is not initialized or an error is encountered. -*} -function Pa_GetDefaultHostApi(): TPaHostApiIndex; cdecl; external LibName; - - -{** Unchanging unique identifiers for each supported host API. This type - is used in the PaHostApiInfo structure. The values are guaranteed to be - unique and to never change, thus allowing code to be written that - conditionally uses host API specific extensions. - - New type ids will be allocated when support for a host API reaches - "public alpha" status, prior to that developers should use the - paInDevelopment type id. - - @see PaHostApiInfo -*} -type TPaHostApiTypeId = {enum}cint; const -{enum_begin PaHostApiTypeId} - paInDevelopment=0; {* use while developing support for a new host API *} - paDirectSound=1; - paMME=2; - paASIO=3; - paSoundManager=4; - paCoreAudio=5; - paOSS=7; - paALSA=8; - paAL=9; - paBeOS=10; - paWDMKS=11; - paJACK=12; - paWASAPI=13; - paAudioScienceHPI=14; -{enum_end PaHostApiTypeId} - -{** A structure containing information about a particular host API. *} - -type - PPaHostApiInfo = ^TPaHostApiInfo; - TPaHostApiInfo = record - {** this is struct version 1 *} - structVersion: cint; - {** The well known unique identifier of this host API @see PaHostApiTypeId *} - _type: TPaHostApiTypeId; - {** A textual description of the host API for display on user interfaces. *} - name: PChar; - - {** The number of devices belonging to this host API. This field may be - used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate - all devices for this host API. - @see Pa_HostApiDeviceIndexToDeviceIndex - *} - deviceCount: cint; - - {** The default input device for this host API. The value will be a - device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice - if no default input device is available. - *} - defaultInputDevice: TPaDeviceIndex; - - {** The default output device for this host API. The value will be a - device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice - if no default output device is available. - *} - defaultOutputDevice: TPaDeviceIndex; - end; - - -{** Retrieve a pointer to a structure containing information about a specific - host Api. - - @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) - - @return A pointer to an immutable PaHostApiInfo structure describing - a specific host API. If the hostApi parameter is out of range or an error - is encountered, the function returns NULL. - - The returned structure is owned by the PortAudio implementation and must not - be manipulated or freed. The pointer is only guaranteed to be valid between - calls to Pa_Initialize() and Pa_Terminate(). -*} -function Pa_GetHostApiInfo( hostApi: TPaHostApiIndex ): PPaHostApiInfo; cdecl; external LibName; - - -{** Convert a static host API unique identifier, into a runtime - host API index. - - @param type A unique host API identifier belonging to the PaHostApiTypeId - enumeration. - - @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or, - a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. - - The paHostApiNotFound error code indicates that the host API specified by the - type parameter is not available. - - @see PaHostApiTypeId -*} -function Pa_HostApiTypeIdToHostApiIndex( _type: TPaHostApiTypeId ): TPaHostApiIndex; cdecl; external LibName; - - -{** Convert a host-API-specific device index to standard PortAudio device index. - This function may be used in conjunction with the deviceCount field of - PaHostApiInfo to enumerate all devices for the specified host API. - - @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) - - @param hostApiDeviceIndex A valid per-host device index in the range - 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1) - - @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1) - or, a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. - - A paInvalidHostApi error code indicates that the host API index specified by - the hostApi parameter is out of range. - - A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter - is out of range. - - @see PaHostApiInfo -*} -function Pa_HostApiDeviceIndexToDeviceIndex( hostApi: TPaHostApiIndex; - hostApiDeviceIndex: cint ): TPaDeviceIndex; cdecl; external LibName; - - - -{** Structure used to return information about a host error condition. -*} -type - PPaHostErrorInfo = ^TPaHostErrorInfo; - TPaHostErrorInfo = record - hostApiType: TPaHostApiTypeId; {**< the host API which returned the error code *} - errorCode: clong; {**< the error code returned *} - errorText: PChar; {**< a textual description of the error if available, otherwise a zero-length string *} - end; - - -{** Return information about the last host error encountered. The error - information returned by Pa_GetLastHostErrorInfo() will never be modified - asyncronously by errors occurring in other PortAudio owned threads - (such as the thread that manages the stream callback.) - - This function is provided as a last resort, primarily to enhance debugging - by providing clients with access to all available error information. - - @return A pointer to an immutable structure constaining information about - the host error. The values in this structure will only be valid if a - PortAudio function has previously returned the paUnanticipatedHostError - error code. -*} -function Pa_GetLastHostErrorInfo(): PPaHostErrorInfo; cdecl; external LibName; - - - -{* Device enumeration and capabilities *} - -{** Retrieve the number of available devices. The number of available devices - may be zero. - - @return A non-negative value indicating the number of available devices or, - a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. -*} -function Pa_GetDeviceCount(): TPaDeviceIndex; cdecl; external LibName; - - -{** Retrieve the index of the default input device. The result can be - used in the inputDevice parameter to Pa_OpenStream(). - - @return The default input device index for the default host API, or paNoDevice - if no default input device is available or an error was encountered. -*} -function Pa_GetDefaultInputDevice(): TPaDeviceIndex; cdecl; external LibName; - - -{** Retrieve the index of the default output device. The result can be - used in the outputDevice parameter to Pa_OpenStream(). - - @return The default output device index for the defualt host API, or paNoDevice - if no default output device is available or an error was encountered. - - @note - On the PC, the user can specify a default device by - setting an environment variable. For example, to use device #1. -
- set PA_RECOMMENDED_OUTPUT_DEVICE=1
-
- The user should first determine the available device ids by using - the supplied application "pa_devs". -*} -function Pa_GetDefaultOutputDevice(): TPaDeviceIndex; cdecl; external LibName; - - -{** The type used to represent monotonic time in seconds that can be used - for syncronisation. The type is used for the outTime argument to the - PaStreamCallback and as the result of Pa_GetStreamTime(). - - @see PaStreamCallback, Pa_GetStreamTime -*} -type TPaTime = cdouble; - - -{** A type used to specify one or more sample formats. Each value indicates - a possible format for sound data passed to and from the stream callback, - Pa_ReadStream and Pa_WriteStream. - - The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 - and aUInt8 are usually implemented by all implementations. - - The floating point representation (paFloat32) uses +1.0 and -1.0 as the - maximum and minimum respectively. - - paUInt8 is an unsigned 8 bit format where 128 is considered "ground" - - The paNonInterleaved flag indicates that a multichannel buffer is passed - as a set of non-interleaved pointers. - - @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo - @see paFloat32, paInt16, paInt32, paInt24, paInt8 - @see paUInt8, paCustomFormat, paNonInterleaved -*} -type TPaSampleFormat = culong; -const - paFloat32 = TPaSampleFormat($00000001); {**< @see PaSampleFormat *} - paInt32 = TPaSampleFormat($00000002); {**< @see PaSampleFormat *} - paInt24 = TPaSampleFormat($00000004); {**< Packed 24 bit format. @see PaSampleFormat *} - paInt16 = TPaSampleFormat($00000008); {**< @see PaSampleFormat *} - paInt8 = TPaSampleFormat($00000010); {**< @see PaSampleFormat *} - paUInt8 = TPaSampleFormat($00000020); {**< @see PaSampleFormat *} - paCustomFormat = TPaSampleFormat($00010000); {**< @see PaSampleFormat *} - paNonInterleaved = TPaSampleFormat($80000000); - -{** A structure providing information and capabilities of PortAudio devices. - Devices may support input, output or both input and output. -*} -type - PPaDeviceInfo = ^TPaDeviceInfo; - TPaDeviceInfo = record - structVersion: cint; {* this is struct version 2 *} - name: PChar; - hostApi: TPaHostApiIndex; {* note this is a host API index, not a type id*} - - maxInputChannels: cint; - maxOutputChannels: cint; - - {* Default latency values for interactive performance. *} - defaultLowInputLatency: TPaTime; - defaultLowOutputLatency: TPaTime; - {* Default latency values for robust non-interactive applications (eg. playing sound files). *} - defaultHighInputLatency: TPaTime; - defaultHighOutputLatency: TPaTime; - - defaultSampleRate: cdouble; - end; - - -{** Retrieve a pointer to a PaDeviceInfo structure containing information - about the specified device. - @return A pointer to an immutable PaDeviceInfo structure. If the device - parameter is out of range the function returns NULL. - - @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1) - - @note PortAudio manages the memory referenced by the returned pointer, - the client must not manipulate or free the memory. The pointer is only - guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate(). - - @see PaDeviceInfo, PaDeviceIndex -*} -function Pa_GetDeviceInfo( device: TPaDeviceIndex ): PPaDeviceInfo; cdecl; external LibName; - - -{** Parameters for one direction (input or output) of a stream. -*} -type - PPaStreamParameters = ^TPaStreamParameters; - TPaStreamParameters = record - {** A valid device index in the range 0 to (Pa_GetDeviceCount()-1) - specifying the device to be used or the special constant - paUseHostApiSpecificDeviceSpecification which indicates that the actual - device(s) to use are specified in hostApiSpecificStreamInfo. - This field must not be set to paNoDevice. - *} - device: TPaDeviceIndex; - - {** The number of channels of sound to be delivered to the - stream callback or accessed by Pa_ReadStream() or Pa_WriteStream(). - It can range from 1 to the value of maxInputChannels in the - PaDeviceInfo record for the device specified by the device parameter. - *} - channelCount: cint; - - {** The sample format of the buffer provided to the stream callback, - a_ReadStream() or Pa_WriteStream(). It may be any of the formats described - by the PaSampleFormat enumeration. - *} - sampleFormat: TPaSampleFormat; - - {** The desired latency in seconds. Where practical, implementations should - configure their latency based on these parameters, otherwise they may - choose the closest viable latency instead. Unless the suggested latency - is greater than the absolute upper limit for the device implementations - should round the suggestedLatency up to the next practial value - ie to - provide an equal or higher latency than suggestedLatency wherever possibe. - Actual latency values for an open stream may be retrieved using the - inputLatency and outputLatency fields of the PaStreamInfo structure - returned by Pa_GetStreamInfo(). - @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo - *} - suggestedLatency: TPaTime; - - {** An optional pointer to a host api specific data structure - containing additional information for device setup and/or stream processing. - hostApiSpecificStreamInfo is never required for correct operation, - if not used it should be set to NULL. - *} - hostApiSpecificStreamInfo: Pointer; - end; - - -{** Return code for Pa_IsFormatSupported indicating success. *} -const paFormatIsSupported = (0); - -{** Determine whether it would be possible to open a stream with the specified - parameters. - - @param inputParameters A structure that describes the input parameters used to - open a stream. The suggestedLatency field is ignored. See PaStreamParameters - for a description of these parameters. inputParameters must be NULL for - output-only streams. - - @param outputParameters A structure that describes the output parameters used - to open a stream. The suggestedLatency field is ignored. See PaStreamParameters - for a description of these parameters. outputParameters must be NULL for - input-only streams. - - @param sampleRate The required sampleRate. For full-duplex streams it is the - sample rate for both input and output - - @return Returns 0 if the format is supported, and an error code indicating why - the format is not supported otherwise. The constant paFormatIsSupported is - provided to compare with the return value for success. - - @see paFormatIsSupported, PaStreamParameters -*} -function Pa_IsFormatSupported( inputParameters: PPaStreamParameters; - outputParameters: PPaStreamParameters; - sampleRate: cdouble ): TPaError; cdecl; external LibName; - - - -{* Streaming types and functions *} - - -{** - A single PaStream can provide multiple channels of real-time - streaming audio input and output to a client application. A stream - provides access to audio hardware represented by one or more - PaDevices. Depending on the underlying Host API, it may be possible - to open multiple streams using the same device, however this behavior - is implementation defined. Portable applications should assume that - a PaDevice may be simultaneously used by at most one PaStream. - - Pointers to PaStream objects are passed between PortAudio functions that - operate on streams. - - @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream, - Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive, - Pa_GetStreamTime, Pa_GetStreamCpuLoad - -*} -type - PPaStream = Pointer; - -{** Can be passed as the framesPerBuffer parameter to Pa_OpenStream() - or Pa_OpenDefaultStream() to indicate that the stream callback will - accept buffers of any size. -*} -const paFramesPerBufferUnspecified = (0); - - -{** Flags used to control the behavior of a stream. They are passed as - parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be - ORed together. - - @see Pa_OpenStream, Pa_OpenDefaultStream - @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput, - paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags -*} -type TPaStreamFlags = culong; - -{** @see PaStreamFlags *} -const paNoFlag = TPaStreamFlags(0); - -{** Disable default clipping of out of range samples. - @see PaStreamFlags -*} -const paClipOff = TPaStreamFlags($00000001); - -{** Disable default dithering. - @see PaStreamFlags -*} -const paDitherOff = TPaStreamFlags($00000002); - -{** Flag requests that where possible a full duplex stream will not discard - overflowed input samples without calling the stream callback. This flag is - only valid for full duplex callback streams and only when used in combination - with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using - this flag incorrectly results in a paInvalidFlag error being returned from - Pa_OpenStream and Pa_OpenDefaultStream. - - @see PaStreamFlags, paFramesPerBufferUnspecified -*} -const paNeverDropInput = TPaStreamFlags($00000004); - -{** Call the stream callback to fill initial output buffers, rather than the - default behavior of priming the buffers with zeros (silence). This flag has - no effect for input-only and blocking read/write streams. - - @see PaStreamFlags -*} -const paPrimeOutputBuffersUsingStreamCallback = TPaStreamFlags($00000008); - -{** A mask specifying the platform specific bits. - @see PaStreamFlags -*} -const paPlatformSpecificFlags = TPaStreamFlags($FFFF0000); - -{** - Timing information for the buffers passed to the stream callback. -*} -type - PPaStreamCallbackTimeInfo = ^TPaStreamCallbackTimeInfo; - TPaStreamCallbackTimeInfo = record - inputBufferAdcTime: TPaTime; - currentTime: TPaTime; - outputBufferDacTime: TPaTime; - end; - - -{** - Flag bit constants for the statusFlags to PaStreamCallback. - - @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow, - paPrimingOutput -*} -type TPaStreamCallbackFlags = culong; - -{** In a stream opened with paFramesPerBufferUnspecified, indicates that - input data is all silence (zeros) because no real data is available. In a - stream opened without paFramesPerBufferUnspecified, it indicates that one or - more zero samples have been inserted into the input buffer to compensate - for an input underflow. - @see PaStreamCallbackFlags -*} -const paInputUnderflow = TPaStreamCallbackFlags($00000001); - -{** In a stream opened with paFramesPerBufferUnspecified, indicates that data - prior to the first sample of the input buffer was discarded due to an - overflow, possibly because the stream callback is using too much CPU time. - Otherwise indicates that data prior to one or more samples in the - input buffer was discarded. - @see PaStreamCallbackFlags -*} -const paInputOverflow = TPaStreamCallbackFlags($00000002); - -{** Indicates that output data (or a gap) was inserted, possibly because the - stream callback is using too much CPU time. - @see PaStreamCallbackFlags -*} -const paOutputUnderflow = TPaStreamCallbackFlags($00000004); - -{** Indicates that output data will be discarded because no room is available. - @see PaStreamCallbackFlags -*} -const paOutputOverflow = TPaStreamCallbackFlags($00000008); - -{** Some of all of the output data will be used to prime the stream, input - data may be zero. - @see PaStreamCallbackFlags -*} -const paPrimingOutput = TPaStreamCallbackFlags($00000010); - -{** - Allowable return values for the PaStreamCallback. - @see PaStreamCallback -*} -type TPaStreamCallbackResult = {enum}cint; const -{enum_begin PaStreamCallbackResult} - paContinue=0; - paComplete=1; - paAbort=2; -{enum_end PaStreamCallbackResult} - -{** - Functions of type PaStreamCallback are implemented by PortAudio clients. - They consume, process or generate audio in response to requests from an - active PortAudio stream. - - @param input and @param output are arrays of interleaved samples, - the format, packing and number of channels used by the buffers are - determined by parameters to Pa_OpenStream(). - - @param frameCount The number of sample frames to be processed by - the stream callback. - - @param timeInfo The time in seconds when the first sample of the input - buffer was received at the audio input, the time in seconds when the first - sample of the output buffer will begin being played at the audio output, and - the time in seconds when the stream callback was called. - See also Pa_GetStreamTime() - - @param statusFlags Flags indicating whether input and/or output buffers - have been inserted or will be dropped to overcome underflow or overflow - conditions. - - @param userData The value of a user supplied pointer passed to - Pa_OpenStream() intended for storing synthesis data etc. - - @return - The stream callback should return one of the values in the - PaStreamCallbackResult enumeration. To ensure that the callback continues - to be called, it should return paContinue (0). Either paComplete or paAbort - can be returned to finish stream processing, after either of these values is - returned the callback will not be called again. If paAbort is returned the - stream will finish as soon as possible. If paComplete is returned, the stream - will continue until all buffers generated by the callback have been played. - This may be useful in applications such as soundfile players where a specific - duration of output is required. However, it is not necessary to utilise this - mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also - be used to stop the stream. The callback must always fill the entire output - buffer irrespective of its return value. - - @see Pa_OpenStream, Pa_OpenDefaultStream - - @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call - PortAudio API functions from within the stream callback. -*} -type - PPaStreamCallback = ^TPaStreamCallback; - TPaStreamCallback = function( - input: Pointer; output: Pointer; - frameCount: culong; - timeInfo: PPaStreamCallbackTimeInfo; - statusFlags: TPaStreamCallbackFlags; - userData: Pointer ): cint; cdecl; - - -{** Opens a stream for either input, output or both. - - @param stream The address of a PaStream pointer which will receive - a pointer to the newly opened stream. - - @param inputParameters A structure that describes the input parameters used by - the opened stream. See PaStreamParameters for a description of these parameters. - inputParameters must be NULL for output-only streams. - - @param outputParameters A structure that describes the output parameters used by - the opened stream. See PaStreamParameters for a description of these parameters. - outputParameters must be NULL for input-only streams. - - @param sampleRate The desired sampleRate. For full-duplex streams it is the - sample rate for both input and output - - @param framesPerBuffer The number of frames passed to the stream callback - function, or the preferred block granularity for a blocking read/write stream. - The special value paFramesPerBufferUnspecified (0) may be used to request that - the stream callback will recieve an optimal (and possibly varying) number of - frames based on host requirements and the requested latency settings. - Note: With some host APIs, the use of non-zero framesPerBuffer for a callback - stream may introduce an additional layer of buffering which could introduce - additional latency. PortAudio guarantees that the additional latency - will be kept to the theoretical minimum however, it is strongly recommended - that a non-zero framesPerBuffer value only be used when your algorithm - requires a fixed number of frames per stream callback. - - @param streamFlags Flags which modify the behaviour of the streaming process. - This parameter may contain a combination of flags ORed together. Some flags may - only be relevant to certain buffer formats. - - @param streamCallback A pointer to a client supplied function that is responsible - for processing and filling input and output buffers. If this parameter is NULL - the stream will be opened in 'blocking read/write' mode. In blocking mode, - the client can receive sample data using Pa_ReadStream and write sample data - using Pa_WriteStream, the number of samples that may be read or written - without blocking is returned by Pa_GetStreamReadAvailable and - Pa_GetStreamWriteAvailable respectively. - - @param userData A client supplied pointer which is passed to the stream callback - function. It could for example, contain a pointer to instance data necessary - for processing the audio buffers. This parameter is ignored if streamCallback - is NULL. - - @return - Upon success Pa_OpenStream() returns paNoError and places a pointer to a - valid PaStream in the stream argument. The stream is inactive (stopped). - If a call to Pa_OpenStream() fails, a non-zero error code is returned (see - PaError for possible error codes) and the value of stream is invalid. - - @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream, - Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable -*} -function Pa_OpenStream( var stream: PPaStream; - inputParameters: PPaStreamParameters; - outputParameters: PPaStreamParameters; - sampleRate: cdouble; - framesPerBuffer: culong; - streamFlags: TPaStreamFlags; - streamCallback: PPaStreamCallback; - userData: Pointer ): TPaError; cdecl; external LibName; - - -{** A simplified version of Pa_OpenStream() that opens the default input - and/or output devices. - - @param stream The address of a PaStream pointer which will receive - a pointer to the newly opened stream. - - @param numInputChannels The number of channels of sound that will be supplied - to the stream callback or returned by Pa_ReadStream. It can range from 1 to - the value of maxInputChannels in the PaDeviceInfo record for the default input - device. If 0 the stream is opened as an output-only stream. - - @param numOutputChannels The number of channels of sound to be delivered to the - stream callback or passed to Pa_WriteStream. It can range from 1 to the value - of maxOutputChannels in the PaDeviceInfo record for the default output dvice. - If 0 the stream is opened as an output-only stream. - - @param sampleFormat The sample format of both the input and output buffers - provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream. - sampleFormat may be any of the formats described by the PaSampleFormat - enumeration. - - @param sampleRate Same as Pa_OpenStream parameter of the same name. - @param framesPerBuffer Same as Pa_OpenStream parameter of the same name. - @param streamCallback Same as Pa_OpenStream parameter of the same name. - @param userData Same as Pa_OpenStream parameter of the same name. - - @return As for Pa_OpenStream - - @see Pa_OpenStream, PaStreamCallback -*} -function Pa_OpenDefaultStream( var stream: PPaStream; - numInputChannels: cint; - numOutputChannels: cint; - sampleFormat: TPaSampleFormat; - sampleRate: cdouble; - framesPerBuffer: culong; - streamCallback: PPaStreamCallback; - userData: Pointer ): TPaError; cdecl; external LibName; - - -{** Closes an audio stream. If the audio stream is active it - discards any pending buffers as if Pa_AbortStream() had been called. -*} -function Pa_CloseStream( stream: PPaStream ): TPaError; cdecl; external LibName; - - -{** Functions of type PaStreamFinishedCallback are implemented by PortAudio - clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback - function. Once registered they are called when the stream becomes inactive - (ie once a call to Pa_StopStream() will not block). - A stream will become inactive after the stream callback returns non-zero, - or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio - output, if the stream callback returns paComplete, or Pa_StopStream is called, - the stream finished callback will not be called until all generated sample data - has been played. - - @param userData The userData parameter supplied to Pa_OpenStream() - - @see Pa_SetStreamFinishedCallback -*} -type - PPaStreamFinishedCallback = ^TPaStreamFinishedCallback; - TPaStreamFinishedCallback = procedure( userData: Pointer ); cdecl; - - -{** Register a stream finished callback function which will be called when the - stream becomes inactive. See the description of PaStreamFinishedCallback for - further details about when the callback will be called. - - @param stream a pointer to a PaStream that is in the stopped state - if the - stream is not stopped, the stream's finished callback will remain unchanged - and an error code will be returned. - - @param streamFinishedCallback a pointer to a function with the same signature - as PaStreamFinishedCallback, that will be called when the stream becomes - inactive. Passing NULL for this parameter will un-register a previously - registered stream finished callback function. - - @return on success returns paNoError, otherwise an error code indicating the cause - of the error. - - @see PaStreamFinishedCallback -*} -function Pa_SetStreamFinishedCallback( stream: PPaStream; - streamFinishedCallback: PPaStreamFinishedCallback ): TPaError; cdecl; external LibName; - - -{** Commences audio processing. -*} -function Pa_StartStream( stream: PPaStream ): TPaError; cdecl; external LibName; - - -{** Terminates audio processing. It waits until all pending - audio buffers have been played before it returns. -*} -function Pa_StopStream( stream: PPaStream ): TPaError; cdecl; external LibName; - - -{** Terminates audio processing immediately without waiting for pending - buffers to complete. -*} -function Pa_AbortStream( stream: PPaStream ): TPaError; cdecl; external LibName; - - -{** Determine whether the stream is stopped. - A stream is considered to be stopped prior to a successful call to - Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream. - If a stream callback returns a value other than paContinue the stream is NOT - considered to be stopped. - - @return Returns one (1) when the stream is stopped, zero (0) when - the stream is running or, a PaErrorCode (which are always negative) if - PortAudio is not initialized or an error is encountered. - - @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive -*} -function Pa_IsStreamStopped( stream: PPaStream ): TPaError; cdecl; external LibName; - - -{** Determine whether the stream is active. - A stream is active after a successful call to Pa_StartStream(), until it - becomes inactive either as a result of a call to Pa_StopStream() or - Pa_AbortStream(), or as a result of a return value other than paContinue from - the stream callback. In the latter case, the stream is considered inactive - after the last buffer has finished playing. - - @return Returns one (1) when the stream is active (ie playing or recording - audio), zero (0) when not playing or, a PaErrorCode (which are always negative) - if PortAudio is not initialized or an error is encountered. - - @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped -*} -function Pa_IsStreamActive( stream: PPaStream ): TPaError; cdecl; external LibName; - - - -{** A structure containing unchanging information about an open stream. - @see Pa_GetStreamInfo -*} -type - PPaStreamInfo = ^TPaStreamInfo; - TPaStreamInfo = record - {** this is struct version 1 *} - structVersion: cint; - - {** The input latency of the stream in seconds. This value provides the most - accurate estimate of input latency available to the implementation. It may - differ significantly from the suggestedLatency value passed to Pa_OpenStream(). - The value of this field will be zero (0.) for output-only streams. - @see PaTime - *} - inputLatency: TPaTime; - - {** The output latency of the stream in seconds. This value provides the most - accurate estimate of output latency available to the implementation. It may - differ significantly from the suggestedLatency value passed to Pa_OpenStream(). - The value of this field will be zero (0.) for input-only streams. - @see PaTime - *} - outputLatency: TPaTime; - - {** The sample rate of the stream in Hertz (samples per second). In cases - where the hardware sample rate is inaccurate and PortAudio is aware of it, - the value of this field may be different from the sampleRate parameter - passed to Pa_OpenStream(). If information about the actual hardware sample - rate is not available, this field will have the same value as the sampleRate - parameter passed to Pa_OpenStream(). - *} - sampleRate: cdouble; - end; - - -{** Retrieve a pointer to a PaStreamInfo structure containing information - about the specified stream. - @return A pointer to an immutable PaStreamInfo structure. If the stream - parameter invalid, or an error is encountered, the function returns NULL. - - @param stream A pointer to an open stream previously created with Pa_OpenStream. - - @note PortAudio manages the memory referenced by the returned pointer, - the client must not manipulate or free the memory. The pointer is only - guaranteed to be valid until the specified stream is closed. - - @see PaStreamInfo -*} -function Pa_GetStreamInfo( stream: PPaStream ): PPaStreamInfo; cdecl; external LibName; - - -{** Determine the current time for the stream according to the same clock used - to generate buffer timestamps. This time may be used for syncronising other - events to the audio stream, for example synchronizing audio to MIDI. - - @return The stream's current time in seconds, or 0 if an error occurred. - - @see PaTime, PaStreamCallback -*} -function Pa_GetStreamTime( stream: PPaStream ): TPaTime; cdecl; external LibName; - - -{** Retrieve CPU usage information for the specified stream. - The "CPU Load" is a fraction of total CPU time consumed by a callback stream's - audio processing routines including, but not limited to the client supplied - stream callback. This function does not work with blocking read/write streams. - - This function may be called from the stream callback function or the - application. - - @return - A floating point value, typically between 0.0 and 1.0, where 1.0 indicates - that the stream callback is consuming the maximum number of CPU cycles possible - to maintain real-time operation. A value of 0.5 would imply that PortAudio and - the stream callback was consuming roughly 50% of the available CPU time. The - return value may exceed 1.0. A value of 0.0 will always be returned for a - blocking read/write stream, or if an error occurrs. -*} -function Pa_GetStreamCpuLoad( stream: PPaStream ): cdouble; cdecl; external LibName; - - -{** Read samples from an input stream. The function doesn't return until - the entire buffer has been filled - this may involve waiting for the operating - system to supply the data. - - @param stream A pointer to an open stream previously created with Pa_OpenStream. - - @param buffer A pointer to a buffer of sample frames. The buffer contains - samples in the format specified by the inputParameters->sampleFormat field - used to open the stream, and the number of channels specified by - inputParameters->numChannels. If non-interleaved samples were requested, - buffer is a pointer to the first element of an array of non-interleaved - buffer pointers, one for each channel. - - @param frames The number of frames to be read into buffer. This parameter - is not constrained to a specific range, however high performance applications - will want to match this parameter to the framesPerBuffer parameter used - when opening the stream. - - @return On success PaNoError will be returned, or PaInputOverflowed if input - data was discarded by PortAudio after the previous call and before this call. -*} -function Pa_ReadStream( stream: PPaStream; - buffer: Pointer; - frames: culong ): TPaError; cdecl; external LibName; - - -{** Write samples to an output stream. This function doesn't return until the - entire buffer has been consumed - this may involve waiting for the operating - system to consume the data. - - @param stream A pointer to an open stream previously created with Pa_OpenStream. - - @param buffer A pointer to a buffer of sample frames. The buffer contains - samples in the format specified by the outputParameters->sampleFormat field - used to open the stream, and the number of channels specified by - outputParameters->numChannels. If non-interleaved samples were requested, - buffer is a pointer to the first element of an array of non-interleaved - buffer pointers, one for each channel. - - @param frames The number of frames to be written from buffer. This parameter - is not constrained to a specific range, however high performance applications - will want to match this parameter to the framesPerBuffer parameter used - when opening the stream. - - @return On success PaNoError will be returned, or paOutputUnderflowed if - additional output data was inserted after the previous call and before this - call. -*} -function Pa_WriteStream( stream: PPaStream; - buffer: Pointer; - frames: culong ): TPaError; cdecl; external LibName; - - -{** Retrieve the number of frames that can be read from the stream without - waiting. - - @return Returns a non-negative value representing the maximum number of frames - that can be read from the stream without blocking or busy waiting or, a - PaErrorCode (which are always negative) if PortAudio is not initialized or an - error is encountered. -*} -function Pa_GetStreamReadAvailable( stream: PPaStream ): cslong; cdecl; external LibName; - - -{** Retrieve the number of frames that can be written to the stream without - waiting. - - @return Returns a non-negative value representing the maximum number of frames - that can be written to the stream without blocking or busy waiting or, a - PaErrorCode (which are always negative) if PortAudio is not initialized or an - error is encountered. -*} -function Pa_GetStreamWriteAvailable( stream: PPaStream ): cslong; cdecl; external LibName; - - -{** Retrieve the host type handling an open stream. - - @return Returns a non-negative value representing the host API type - handling an open stream or, a PaErrorCode (which are always negative) - if PortAudio is not initialized or an error is encountered. -*} -function Pa_GetStreamHostApiType( stream: PPaStream ): TPaHostApiTypeId; cdecl; external LibName; - - -{* Miscellaneous utilities *} - - -{** Retrieve the size of a given sample format in bytes. - - @return The size in bytes of a single sample in the specified format, - or paSampleFormatNotSupported if the format is not supported. -*} -function Pa_GetSampleSize( format: TPaSampleFormat ): TPaError; cdecl; external LibName; - - -{** Put the caller to sleep for at least 'msec' milliseconds. This function is - provided only as a convenience for authors of portable code (such as the tests - and examples in the PortAudio distribution.) - - The function may sleep longer than requested so don't rely on this for accurate - musical timing. -*} -procedure Pa_Sleep( msec: clong ); cdecl; external LibName; - -implementation - -end. diff --git a/src/lib/portmixer/portmixer.pas b/src/lib/portmixer/portmixer.pas deleted file mode 100644 index b84e0cd6..00000000 --- a/src/lib/portmixer/portmixer.pas +++ /dev/null @@ -1,149 +0,0 @@ -{* - * PortMixer - * PortMixer API Header File - * - * Copyright (c) 2002, 2006 - * - * Written by Dominic Mazzoni - * and Leland Lucius - * - * PortMixer is intended to work side-by-side with PortAudio, - * the Portable Real-Time Audio Library by Ross Bencina and - * Phil Burk. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *} -unit portmixer; - -{$IFDEF FPC} - {$PACKRECORDS C} (* GCC/Visual C/C++ compatible record packing *) - {$MODE DELPHI } -{$ENDIF} - -interface - -uses - ctypes, - portaudio; - -const -{$IF Defined(MSWINDOWS)} - LibName = 'portmixer.dll'; -{$ELSEIF Defined(DARWIN)} -// LibName = 'libportmixer.dylib'; -// {$LINKLIB libportaudio} -{$ELSEIF Defined(UNIX)} - LibName = 'libportmixer.so'; -{$IFEND} - -type - PPxMixer = Pointer; - TPxVolume = cfloat; {* 0.0 (min) --> 1.0 (max) *} - TPxBalance = cfloat; {* -1.0 (left) --> 1.0 (right) *} - -{* - Px_OpenMixer() returns a mixer which will work with the given PortAudio - audio device. Pass 0 as the index for the first (default) mixer. -*} - -function Px_OpenMixer( pa_stream: Pointer; i: cint ): PPxMixer; cdecl; external LibName; - -{* - Px_CloseMixer() closes a mixer opened using Px_OpenMixer and frees any - memory associated with it. -*} - -procedure Px_CloseMixer( mixer: PPxMixer ); cdecl; external LibName; - -{* - Px_GetNumMixers returns the number of mixers which could be - used with the given PortAudio device. On most systems, there - will be only one mixer for each device; however there may be - multiple mixers for each device, or possibly multiple mixers - which are independent of any particular PortAudio device. -*} - -function Px_GetNumMixers( mixer: PPxMixer ): cint; cdecl; external LibName; -function Px_GetMixerName( mixer: PPxMixer; i: cint ): PChar; cdecl; external LibName; - -{* - Master (output) volume -*} - -function Px_GetMasterVolume( mixer: PPxMixer ): TPxVolume; cdecl; external LibName; -procedure Px_SetMasterVolume( mixer: PPxMixer; volume: TPxVolume ); cdecl; external LibName; - -{* - Main output volume -*} - -function Px_GetPCMOutputVolume( mixer: PPxMixer ): TPxVolume; cdecl; external LibName; -procedure Px_SetPCMOutputVolume( mixer: PPxMixer; volume: TPxVolume ); cdecl; external LibName; -function Px_SupportsPCMOutputVolume( mixer: PPxMixer ): cint; cdecl; external LibName; - -{* - All output volumes -*} - -function Px_GetNumOutputVolumes( mixer: PPxMixer ): cint; cdecl; external LibName; -function Px_GetOutputVolumeName( mixer: PPxMixer; i: cint ): PChar; cdecl; external LibName; -function Px_GetOutputVolume( mixer: PPxMixer; i: cint ): TPxVolume; cdecl; external LibName; -procedure Px_SetOutputVolume( mixer: PPxMixer; i: cint; volume: TPxVolume ); cdecl; external LibName; - -{* - Input source -*} - -function Px_GetNumInputSources( mixer: PPxMixer ): cint; cdecl; external LibName; -function Px_GetInputSourceName( mixer: PPxMixer; i: cint): PChar; cdecl; external LibName; -function Px_GetCurrentInputSource( mixer: PPxMixer ): cint; cdecl; external LibName; {* may return -1 == none *} -procedure Px_SetCurrentInputSource( mixer: PPxMixer; i: cint ); cdecl; external LibName; - -{* - Input volume -*} - -function Px_GetInputVolume( mixer: PPxMixer ): TPxVolume; cdecl; external LibName; -procedure Px_SetInputVolume( mixer: PPxMixer; volume: TPxVolume ); cdecl; external LibName; - -{* - Balance -*} - -function Px_SupportsOutputBalance( mixer: PPxMixer ): cint; cdecl; external LibName; -function Px_GetOutputBalance( mixer: PPxMixer ): TPxBalance; cdecl; external LibName; -procedure Px_SetOutputBalance( mixer: PPxMixer; balance: TPxBalance ); cdecl; external LibName; - -{* - Playthrough -*} - -function Px_SupportsPlaythrough( mixer: PPxMixer ): cint; cdecl; external LibName; -function Px_GetPlaythrough( mixer: PPxMixer ): TPxVolume; cdecl; external LibName; -procedure Px_SetPlaythrough( mixer: PPxMixer; volume: TPxVolume ); cdecl; external LibName; - -implementation - -end. diff --git a/src/lib/requirements.txt b/src/lib/requirements.txt index 48f1d02d..1f16f359 100644 --- a/src/lib/requirements.txt +++ b/src/lib/requirements.txt @@ -10,9 +10,10 @@ pngImage BASS.pas http://www.un4seen.com/download.php?bass24 -BASS_FX.pas - www.un4seen.com/download.php?z/0/bass_fx24 +BASS_FX.pas + http://www.un4seen.com/download.php?z/0/bass_fx24 + ffmpeg http://www.iversenit.dk/dev/ffmpeg-headers/ @@ -26,7 +27,7 @@ On top of the above pas files, you will need development libraries for them. here are the instructions needed to compile on ubunty ( 7.04 ) - sudo apt-get install libavcodec-dev libavformat-dev libsqlite3-dev libsdl-ttf2.0-dev libsdl-image1.2-dev portaudio19-dev + sudo apt-get install libavcodec-dev libavformat-dev libsqlite3-dev libsdl-ttf2.0-dev libsdl-image1.2-dev in order to build the configure file ( with autogen.sh ) @@ -35,7 +36,7 @@ in order to build the configure file ( with autogen.sh ) for Fedora 8 ( contributed by kdub ) - yum install ffmpeg-devel portaudio-devel SDL_ttf-devel SDL_image-devel sqlite-devel + yum install ffmpeg-devel SDL_ttf-devel SDL_image-devel sqlite-devel ====================================== Mac OS X build @@ -47,4 +48,4 @@ Install the FreePascal compiler (version 2.2.2 or later) using fink or a package Install these libs and their dependences using fink: fink install pkgconfig libavcodec-dev libavformat-dev libavutil-dev libswscale-dev - fink install portaudio2 SDL SDL-image libpng3 sqlite3-dev \ No newline at end of file + fink install SDL SDL-image libpng3 sqlite3-dev diff --git a/src/lib/samplerate/samplerate.pas b/src/lib/samplerate/samplerate.pas deleted file mode 100644 index 784b87da..00000000 --- a/src/lib/samplerate/samplerate.pas +++ /dev/null @@ -1,199 +0,0 @@ -{* -** Copyright (C) 2002-2004 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -*} - -{* -** API documentation is available here: -** http://www.mega-nerd.com/SRC/api.html -*} - -unit samplerate; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* GCC/Visual C/C++ compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - - -interface - -uses - ctypes, - UConfig; - -const -{$IFDEF MSWINDOWS} - LibName = 'libsamplerate-0.dll'; -{$ENDIF} -{$IFDEF UNIX} - LibName = 'samplerate'; - {$IFDEF DARWIN} - {$LINKLIB libsamplerate} - {$ENDIF} -{$ENDIF} - -{ Opaque data type SRC_STATE. } -type - PSRC_STATE = ^SRC_STATE; - SRC_STATE = record - // opaque - end; - -{ SRC_DATA is used to pass data to src_simple() and src_process(). } -type - PSRC_DATA = ^SRC_DATA; - SRC_DATA = record - data_in, data_out: PCfloat; - input_frames, output_frames: clong; - input_frames_used, output_frames_gen: clong; - end_of_input: cint; - src_ratio: cdouble; - end; - -{ SRC_CB_DATA is used with callback based API. } -type - SRC_CB_DATA = record - frames: clong; - data_in: PCfloat; - end; - -{* -** User supplied callback function type for use with src_callback_new() -** and src_callback_read(). First parameter is the same pointer that was -** passed into src_callback_new(). Second parameter is pointer to a -** pointer. The user supplied callback function must modify *data to -** point to the start of the user supplied float array. The user supplied -** function must return the number of frames that **data points to. -*} -src_callback_t = function (cb_data: pointer; var data: PCfloat): clong; cdecl; - -{* -** Standard initialisation function : return an anonymous pointer to the -** internal state of the converter. Choose a converter from the enums below. -** Error returned in *error. -*} -function src_new(converter_type: cint; channels: cint; error: PCint): PSRC_STATE; cdecl; external LibName; - -{* -** Initilisation for callback based API : return an anonymous pointer to the -** internal state of the converter. Choose a converter from the enums below. -** The cb_data pointer can point to any data or be set to NULL. Whatever the -** value, when processing, user supplied function "func" gets called with -** cb_data as first parameter. -*} -function src_callback_new(func: src_callback_t; converter_type: cint; channels: cint; - error: Pinteger; cb_data: pointer): PSRC_STATE; cdecl; external LibName; - -{* -** Cleanup all internal allocations. -** Always returns NULL. -*} -function src_delete(state: PSRC_STATE): PSRC_STATE; cdecl; external LibName; - -{* -** Standard processing function. -** Returns non zero on error. -*} -function src_process(state: PSRC_STATE; data: PSRC_DATA): cint; cdecl; external LibName; - -{* -** Callback based processing function. Read up to frames worth of data from -** the converter int *data and return frames read or -1 on error. -*} -function src_callback_read(state: PSRC_STATE; src_ratio: cdouble; - frames: clong; data: PCfloat): clong; cdecl; external LibName; - -{* -** Simple interface for performing a single conversion from input buffer to -** output buffer at a fixed conversion ratio. -** Simple interface does not require initialisation as it can only operate on -** a single buffer worth of audio. -*} -function src_simple(data: PSRC_DATA; converter_type: cint; channels: cint): cint; cdecl; external LibName; - -{* -** This library contains a number of different sample rate converters, -** numbered 0 through N. -** -** Return a string giving either a name or a more full description of each -** sample rate converter or NULL if no sample rate converter exists for -** the given value. The converters are sequentially numbered from 0 to N. -*} -function src_get_name(converter_type: cint): {const} Pchar; cdecl; external LibName; -function src_get_description(converter_type: cint): {const} Pchar; cdecl; external LibName; -function src_get_version(): {const} Pchar; cdecl; external LibName; - -{* -** Set a new SRC ratio. This allows step responses -** in the conversion ratio. -** Returns non zero on error. -*} -function src_set_ratio(state: PSRC_STATE; new_ratio: cdouble): cint; cdecl; external LibName; - -{* -** Reset the internal SRC state. -** Does not modify the quality settings. -** Does not free any memory allocations. -** Returns non zero on error. -*} -function src_reset(state: PSRC_STATE): cint; cdecl; external LibName; - -{* -** Return TRUE if ratio is a valid conversion ratio, FALSE -** otherwise. -*} -function src_is_valid_ratio(ratio: cdouble): cint; cdecl; external LibName; - -{* -** Return an error number. -*} -function src_error(state: PSRC_STATE): cint; cdecl; external LibName; - -{* -** Convert the error number into a string. -*} -function src_strerror(error: cint): {const} Pchar; cdecl; external LibName; - -{* -** The following enums can be used to set the interpolator type -** using the function src_set_converter(). -*} -const - SRC_SINC_BEST_QUALITY = 0; - SRC_SINC_MEDIUM_QUALITY = 1; - SRC_SINC_FASTEST = 2; - SRC_ZERO_ORDER_HOLD = 3; - SRC_LINEAR = 4; - -{* -** Extra helper functions for converting from short to float and -** back again. -*} -procedure src_short_to_float_array(input: {const} PCshort; output: PCfloat; len: cint); cdecl; external LibName; -procedure src_float_to_short_array(input: {const} PCfloat; output: PCshort; len: cint); cdecl; external LibName; - -{$IF LIBSAMPLERATE_VERSION >= 1003} // 0.1.3 -procedure src_int_to_float_array(input: {const} PCint; output: PCfloat; len: cint); cdecl; external LibName; -procedure src_float_to_int_array(input: {const} PCfloat; output: PCint; len: cint); cdecl; external LibName; -{$IFEND} - -implementation - -end. diff --git a/src/lua/ULuaCore.pas b/src/lua/ULuaCore.pas index 35077474..dcd55bbf 100644 --- a/src/lua/ULuaCore.pas +++ b/src/lua/ULuaCore.pas @@ -596,6 +596,7 @@ function TLuaCore_LoadModule (L: Plua_State): integer; cdecl; var Id: integer; begin + Result := 0; if (not lua_isnoneornil(L, lua_upvalueindex(1))) then begin Id := lua_ToInteger(L, lua_upvalueindex(1)); @@ -876,6 +877,7 @@ function TLuaPlugin_Register (L: Plua_State): integer; cdecl; P: TLuaPlugin; Name, Version, Author, Url: string; begin + Result := 0; if (lua_gettop(L) >= 2) then begin // we got at least name and version if (not lua_isNumber(L, lua_upvalueindex(1))) then diff --git a/src/media/UAudioConverter.pas b/src/media/UAudioConverter.pas index e3e20e42..1da79662 100644 --- a/src/media/UAudioConverter.pas +++ b/src/media/UAudioConverter.pas @@ -34,14 +34,6 @@ interface UMusic, ULog, ctypes, - {$IFDEF UseSRCResample} - samplerate, - {$ENDIF} - {$IFDEF UseFFmpegResample} - avcodec, - avutil, - UMediaCore_FFmpeg, - {$ENDIF} UMediaCore_SDL, sdl2, SysUtils, @@ -74,52 +66,6 @@ TAudioConverter_SDL = class(TAudioConverter) function GetRatio(): double; override; end; - {$IFDEF UseFFmpegResample} - // Note: FFmpeg seems to be using "kaiser windowed sinc" for resampling, so - // the quality should be good. - TAudioConverter_FFmpeg = class(TAudioConverter) - private - // TODO: use SDL for multi-channel->stereo and format conversion - ResampleContext: PReSampleContext; - Ratio: double; - public - function Init(SrcFormatInfo: TAudioFormatInfo; DstFormatInfo: TAudioFormatInfo): boolean; override; - destructor Destroy(); override; - - function Convert(InputBuffer: PByteArray; OutputBuffer: PByteArray; var InputSize: integer): integer; override; - function GetOutputBufferSize(InputSize: integer): integer; override; - function GetRatio(): double; override; - end; - {$ENDIF} - - {$IFDEF UseSRCResample} - TAudioConverter_SRC = class(TAudioConverter) - private - ConverterState: PSRC_STATE; - ConversionData: SRC_DATA; - FormatConverter: TAudioConverter; - public - function Init(SrcFormatInfo: TAudioFormatInfo; DstFormatInfo: TAudioFormatInfo): boolean; override; - destructor Destroy(); override; - - function Convert(InputBuffer: PByteArray; OutputBuffer: PByteArray; var InputSize: integer): integer; override; - function GetOutputBufferSize(InputSize: integer): integer; override; - function GetRatio(): double; override; - end; - - // Note: SRC (=libsamplerate) provides several converters with different quality - // speed trade-offs. The SINC-types are slow but offer best quality. - // The SRC_SINC_* converters are too slow for realtime conversion, - // (SRC_SINC_FASTEST is approx. ten times slower than SRC_LINEAR) resulting - // in audible clicks and pops. - // SRC_LINEAR is very fast and should have a better quality than SRC_ZERO_ORDER_HOLD - // because it interpolates the samples. Normal "non-audiophile" users should not - // be able to hear a difference between the SINC_* ones and LINEAR. Especially - // if people sing along with the song. - // But FFmpeg might offer a better quality/speed ratio than SRC_LINEAR. - const - SRC_CONVERTER_TYPE = SRC_LINEAR; - {$ENDIF} implementation @@ -199,327 +145,5 @@ function TAudioConverter_SDL.Convert(InputBuffer: PByteArray; OutputBuffer: PByt end; -{$IFDEF UseFFmpegResample} - -function TAudioConverter_FFmpeg.Init(SrcFormatInfo: TAudioFormatInfo; - DstFormatInfo: TAudioFormatInfo): boolean; -var - SrcFormat: TAVSampleFormat; - DstFormat: TAVSampleFormat; -begin - inherited Init(SrcFormatInfo, DstFormatInfo); - - Result := false; - - {$IF LIBAVCODEC_VERSION < 52015000} // 52.15.0 - // Note: ffmpeg does not support resampling for more than 2 input channels - - if srcFormatInfo.Format <> asfS16 then - begin - Log.LogError('Unsupported format', 'TAudioConverter_FFmpeg.Init'); - Log.LogError('asfS16: ' + intToStr(integer(asfS16)) - + ' (should be 7)', 'TAudioConverter_FFmpeg.Init'); - Log.LogError('srcFormatInfo.Format: ' + intToStr(integer(srcFormatInfo.Format)) - + ' (exit because <> asfS16)', 'TAudioConverter_FFmpeg.Init'); - Exit; - end; - - // TODO: use SDL here - if srcFormatInfo.Format <> dstFormatInfo.Format then - begin - Log.LogError('Incompatible formats', 'TAudioConverter_FFmpeg.Init'); - Exit; - end; - - ResampleContext := audio_resample_init( - dstFormatInfo.Channels, srcFormatInfo.Channels, - Round(dstFormatInfo.SampleRate), Round(srcFormatInfo.SampleRate)); - {$ELSE} - if not TMediaCore_FFmpeg.ConvertAudioFormatToFFmpeg(srcFormatInfo.Format, SrcFormat) then - begin - Log.LogError('Unsupported format', 'TAudioConverter_FFmpeg.Init'); - Log.LogError('srcFormatInfo.Format: ' + intToStr(integer(srcFormatInfo.Format)), - 'TAudioConverter_FFmpeg.Init'); - Exit; - end; - - if not TMediaCore_FFmpeg.ConvertAudioFormatToFFmpeg(DstFormatInfo.Format, DstFormat) then - begin - Log.LogError('Unsupported format', 'TAudioConverter_FFmpeg.Init'); - Log.LogError('dstFormatInfo.Format: ' + intToStr(integer(dstFormatInfo.Format)), - 'TAudioConverter_FFmpeg.Init'); - Exit; - end; - - ResampleContext := av_audio_resample_init( - dstFormatInfo.Channels, srcFormatInfo.Channels, - Round(dstFormatInfo.SampleRate), Round(srcFormatInfo.SampleRate), - DstFormat, SrcFormat, - 16, 10, 0, 0.8); - {$IFEND} - if ResampleContext = nil then - begin - Log.LogError('audio_resample_init() failed', 'TAudioConverter_FFmpeg.Init'); - Exit; - end; - - // calculate ratio - Ratio := (dstFormatInfo.Channels / srcFormatInfo.Channels) * - (dstFormatInfo.SampleRate / srcFormatInfo.SampleRate); - - Result := true; -end; - -destructor TAudioConverter_FFmpeg.Destroy(); -begin - if ResampleContext <> nil then - audio_resample_close(ResampleContext); - inherited; -end; - -function TAudioConverter_FFmpeg.Convert(InputBuffer: PByteArray; OutputBuffer: PByteArray; - var InputSize: integer): integer; -var - InputSampleCount: integer; - OutputSampleCount: integer; -begin - Result := -1; - - if InputSize <= 0 then - begin - // avoid div-by-zero in audio_resample() - if InputSize = 0 then - Result := 0; - Exit; - end; - - InputSampleCount := InputSize div SrcFormatInfo.FrameSize; - OutputSampleCount := audio_resample( - ResampleContext, PSmallInt(OutputBuffer), PSmallInt(InputBuffer), - InputSampleCount); - if OutputSampleCount = -1 then - begin - Log.LogError('audio_resample() failed', 'TAudioConverter_FFmpeg.Convert'); - Exit; - end; - Result := OutputSampleCount * DstFormatInfo.FrameSize; -end; - -function TAudioConverter_FFmpeg.GetOutputBufferSize(InputSize: integer): integer; -begin - Result := Ceil(InputSize * GetRatio()); -end; - -function TAudioConverter_FFmpeg.GetRatio(): double; -begin - Result := Ratio; -end; - -{$ENDIF} - - -{$IFDEF UseSRCResample} - -function TAudioConverter_SRC.Init(SrcFormatInfo: TAudioFormatInfo; - DstFormatInfo: TAudioFormatInfo): boolean; -var - error: integer; - TempSrcFormatInfo: TAudioFormatInfo; - TempDstFormatInfo: TAudioFormatInfo; -begin - inherited Init(SrcFormatInfo, DstFormatInfo); - - Result := false; - - FormatConverter := nil; - - // SRC does not handle channel or format conversion - if (SrcFormatInfo.Channels <> DstFormatInfo.Channels) or - not (SrcFormatInfo.Format in [asfS16, asfFloat]) then - begin - // SDL can not convert to float, so we have to convert to SInt16 first - TempSrcFormatInfo := TAudioFormatInfo.Create( - SrcFormatInfo.Channels, SrcFormatInfo.SampleRate, SrcFormatInfo.Format); - TempDstFormatInfo := TAudioFormatInfo.Create( - DstFormatInfo.Channels, SrcFormatInfo.SampleRate, asfS16); - - // init format/channel conversion - FormatConverter := TAudioConverter_SDL.Create(); - if not FormatConverter.Init(TempSrcFormatInfo, TempDstFormatInfo) then - begin - Log.LogError('Unsupported input format', 'TAudioConverter_SRC.Init'); - FormatConverter.Free; - // exit after the format-info is freed - end; - - // this info was copied so we do not need it anymore - TempSrcFormatInfo.Free; - TempDstFormatInfo.Free; - - // leave if the format is not supported - if not assigned(FormatConverter) then - Exit; - - // adjust our copy of the input audio-format for SRC conversion - Self.SrcFormatInfo.Channels := DstFormatInfo.Channels; - Self.SrcFormatInfo.Format := asfS16; - end; - - if (DstFormatInfo.Format <> asfS16) and - (DstFormatInfo.Format <> asfFloat) then - begin - Log.LogError('Unsupported output format', 'TAudioConverter_SRC.Init'); - Exit; - end; - - ConversionData.src_ratio := DstFormatInfo.SampleRate / SrcFormatInfo.SampleRate; - if src_is_valid_ratio(ConversionData.src_ratio) = 0 then - begin - Log.LogError('Invalid samplerate ratio', 'TAudioConverter_SRC.Init'); - Exit; - end; - - ConverterState := src_new(SRC_CONVERTER_TYPE, DstFormatInfo.Channels, @error); - if ConverterState = nil then - begin - Log.LogError('src_new() failed: ' + src_strerror(error), 'TAudioConverter_SRC.Init'); - Exit; - end; - - Result := true; -end; - -destructor TAudioConverter_SRC.Destroy(); -begin - if ConverterState <> nil then - src_delete(ConverterState); - FormatConverter.Free; - inherited; -end; - -function TAudioConverter_SRC.Convert(InputBuffer: PByteArray; OutputBuffer: PByteArray; - var InputSize: integer): integer; -var - FloatInputBuffer: PSingle; - FloatOutputBuffer: PSingle; - TempBuffer: PByteArray; - TempSize: integer; - NumSamples: integer; - OutputSize: integer; - error: integer; -begin - Result := -1; - - TempBuffer := nil; - - // format conversion with external converter (to correct number of channels and format) - if assigned(FormatConverter) then - begin - TempSize := FormatConverter.GetOutputBufferSize(InputSize); - GetMem(TempBuffer, TempSize); - InputSize := FormatConverter.Convert(InputBuffer, TempBuffer, InputSize); - InputBuffer := TempBuffer; - end; - - if InputSize <= 0 then - begin - // avoid div-by-zero problems - if InputSize = 0 then - Result := 0; - if TempBuffer <> nil then - FreeMem(TempBuffer); - Exit; - end; - - if SrcFormatInfo.Format = asfFloat then - begin - FloatInputBuffer := PSingle(InputBuffer); - end - else - begin - NumSamples := InputSize div AudioSampleSize[SrcFormatInfo.Format]; - GetMem(FloatInputBuffer, NumSamples * SizeOf(Single)); - src_short_to_float_array(PCshort(InputBuffer), PCfloat(FloatInputBuffer), NumSamples); - end; - - // calculate approx. output size - OutputSize := Ceil(InputSize * ConversionData.src_ratio); - - if DstFormatInfo.Format = asfFloat then - begin - FloatOutputBuffer := PSingle(OutputBuffer); - end - else - begin - NumSamples := OutputSize div AudioSampleSize[DstFormatInfo.Format]; - GetMem(FloatOutputBuffer, NumSamples * SizeOf(Single)); - end; - - with ConversionData do - begin - data_in := PCFloat(FloatInputBuffer); - input_frames := InputSize div SrcFormatInfo.FrameSize; - data_out := PCFloat(FloatOutputBuffer); - output_frames := OutputSize div DstFormatInfo.FrameSize; - // TODO: set this to 1 at end of file-playback - end_of_input := 0; - end; - - error := src_process(ConverterState, @ConversionData); - if error <> 0 then - begin - Log.LogError(src_strerror(error), 'TAudioConverter_SRC.Convert'); - if SrcFormatInfo.Format <> asfFloat then - FreeMem(FloatInputBuffer); - if DstFormatInfo.Format <> asfFloat then - FreeMem(FloatOutputBuffer); - if TempBuffer <> nil then - FreeMem(TempBuffer); - Exit; - end; - - if SrcFormatInfo.Format <> asfFloat then - FreeMem(FloatInputBuffer); - - if DstFormatInfo.Format <> asfFloat then - begin - NumSamples := ConversionData.output_frames_gen * DstFormatInfo.Channels; - src_float_to_short_array(PCfloat(FloatOutputBuffer), PCshort(OutputBuffer), NumSamples); - FreeMem(FloatOutputBuffer); - end; - - // free format conversion buffer if used - if TempBuffer <> nil then - FreeMem(TempBuffer); - - if assigned(FormatConverter) then - InputSize := ConversionData.input_frames_used * FormatConverter.SrcFormatInfo.FrameSize - else - InputSize := ConversionData.input_frames_used * SrcFormatInfo.FrameSize; - - // set result to output size according to SRC - Result := ConversionData.output_frames_gen * DstFormatInfo.FrameSize; -end; - -function TAudioConverter_SRC.GetOutputBufferSize(InputSize: integer): integer; -begin - Result := Ceil(InputSize * GetRatio()); -end; - -function TAudioConverter_SRC.GetRatio(): double; -begin - // if we need additional channel/format conversion, use this ratio - if assigned(FormatConverter))then - Result := FormatConverter.GetRatio() - else - Result := 1.0; - - // now the SRC ratio (Note: the format might change from SInt16 to float) - Result := Result * - ConversionData.src_ratio * - (DstFormatInfo.FrameSize / SrcFormatInfo.FrameSize); -end; - -{$ENDIF} end. diff --git a/src/media/UAudioCore_Portaudio.pas b/src/media/UAudioCore_Portaudio.pas deleted file mode 100644 index 1d248c5f..00000000 --- a/src/media/UAudioCore_Portaudio.pas +++ /dev/null @@ -1,334 +0,0 @@ -{* - UltraStar WorldParty - Karaoke Game - - UltraStar WorldParty is the legal property of its developers, - whose names are too numerous to list here. Please refer to the - COPYRIGHT file distributed with this source distribution. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. Check "LICENSE" file. If not, see - . - *} - -unit UAudioCore_Portaudio; - -interface - -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} - -{$I ../switches.inc} - -uses - Classes, - SysUtils, - portaudio; - -type - TAudioCore_Portaudio = class - private - InitCount: integer; ///< keeps track of the number of Initialize/Terminate calls - public - constructor Create(); - class function GetInstance(): TAudioCore_Portaudio; - function Initialize(): boolean; - function Terminate(): boolean; - function GetPreferredApiIndex(): TPaHostApiIndex; - function TestDevice(inParams, outParams: PPaStreamParameters; var sampleRate: double): boolean; - end; - -implementation - -uses - ULog; - -{* - * The default API used by Portaudio is the least common denominator - * and might lack efficiency. In addition it might not even work. - * We use an array named ApiPreferenceOrder with which we define the order of - * preferred APIs to use. The first API-type in the list is tried first. - * If it is not available the next one is tried and so on ... - * If none of the preferred APIs was found the default API (detected by - * portaudio) is used. - * - * Pascal does not permit zero-length static arrays, so you must use paDefaultApi - * as an array's only member if you do not have any preferences. - * You can also append paDefaultApi to a non-zero length preferences array but - * this is optional because the default API is always used as a fallback. - *} -const - paDefaultApi = -1; -const - ApiPreferenceOrder: -{$IF Defined(MSWINDOWS)} - // Note1: Portmixer has no mixer support for paASIO and paWASAPI at the moment - // Note2: Windows Default-API is MME, but DirectSound is faster - array[0..0] of TPaHostApiTypeId = ( paDirectSound ); -{$ELSEIF Defined(DARWIN)} - array[0..0] of TPaHostApiTypeId = ( paDefaultApi ); // paCoreAudio -{$ELSEIF Defined(UNIX)} - // Note: Portmixer has no mixer support for JACK at the moment - array[0..2] of TPaHostApiTypeId = ( paALSA, paJACK, paOSS ); -{$ELSE} - array[0..0] of TPaHostApiTypeId = ( paDefaultApi ); -{$IFEND} - - -{ TAudioInput_Portaudio } - -var - Instance: TAudioCore_Portaudio; - -constructor TAudioCore_Portaudio.Create(); -begin - inherited; - InitCount := 0; -end; - -class function TAudioCore_Portaudio.GetInstance(): TAudioCore_Portaudio; -begin - if not assigned(Instance) then - Instance := TAudioCore_Portaudio.Create(); - Result := Instance; -end; - -function TAudioCore_Portaudio.Initialize(): boolean; -var - Err: TPaError; -begin - // initialize only once - if (InitCount > 0) then - begin - Inc(InitCount); - Result := true; - Exit; - end; - - // init Portaudio - Err := Pa_Initialize(); - if (Err <> paNoError) then - begin - Log.LogError(Pa_GetErrorText(Err), 'TAudioCore_Portaudio.Initialize'); - Result := false; - Exit; - end; - - // only increment on success - Inc(InitCount); - Result := true; -end; - -function TAudioCore_Portaudio.Terminate(): boolean; -var - Err: TPaError; -begin - // decrement usage count - Dec(InitCount); - if (InitCount > 0) then - begin - // do not terminate yet - Result := true; - Exit; - end; - - // terminate if usage count is 0 - Err := Pa_Terminate(); - if (Err <> paNoError) then - begin - Log.LogError(Pa_GetErrorText(Err), 'TAudioCore_Portaudio.Terminate'); - Result := false; - Exit; - end; - - Result := true; -end; - -function TAudioCore_Portaudio.GetPreferredApiIndex(): TPaHostApiIndex; -var - i: integer; - apiIndex: TPaHostApiIndex; - apiInfo: PPaHostApiInfo; -begin - result := -1; - - // select preferred sound-API - for i:= 0 to High(ApiPreferenceOrder) do - begin - if (ApiPreferenceOrder[i] <> paDefaultApi) then - begin - // check if API is available - apiIndex := Pa_HostApiTypeIdToHostApiIndex(ApiPreferenceOrder[i]); - if (apiIndex >= 0) then - begin - // we found an API but we must check if it works - // (on linux portaudio might detect OSS but does not provide - // any devices if ALSA is enabled) - apiInfo := Pa_GetHostApiInfo(apiIndex); - if (apiInfo^.deviceCount > 0) then - begin - Result := apiIndex; - break; - end; - end; - end; - end; - - // None of the preferred APIs is available -> use default - if (result < 0) then - begin - result := Pa_GetDefaultHostApi(); - end; -end; - -{* - * Portaudio test callback used by TestDevice(). - *} -function TestCallback(input: pointer; output: pointer; frameCount: longword; - timeInfo: PPaStreamCallbackTimeInfo; statusFlags: TPaStreamCallbackFlags; - inputDevice: pointer): integer; cdecl; -begin - // this callback is called only once - result := paAbort; -end; - -(* - * Tests if the callback works. Some devices can be opened without - * an error but the callback is never called. Calling Pa_StopStream() on such - * a stream freezes USDX then. Probably because the callback-thread is deadlocked - * due to some bug in portaudio. The blocking Pa_ReadStream() and Pa_WriteStream() - * block forever too and though can't be used for testing. - * - * To avoid freezing Pa_AbortStream (or Pa_CloseStream which calls Pa_AbortStream) - * can be used to force the stream to stop. But for some reason this stops debugging - * in gdb with a "no process found" message. - * - * Because freezing devices are non-working devices we test the devices here to - * be able to exclude them from the device-selection list. - * - * Portaudio does not provide any test to check this error case (probably because - * it should not even occur). So we have to open the device, start the stream and - * check if the callback is called (the stream is stopped if the callback is called - * for the first time, so we can poll until the stream is stopped). - * - * Another error that occurs is that some devices (even the default device) might - * work at the beginning but stop after a few calls (maybe 50) of the callback. - * For me this problem occurs with the default output-device. The "dmix" or "front" - * device must be selected instead. Another problem is that (due to a bug in - * portaudio or ALSA) the "front" device is not detected every time portaudio - * is started. Sometimes it needs two or more restarts. - * - * There is no reasonable way to test for these errors. For the first error-case - * we could test if the callback is called 50 times but this can take a second - * for each device and it can fail in the 51st or even 100th callback call then. - * - * The second error-case cannot be tested at all. How should we now that one - * device is missing if portaudio is not even able to detect it. - * We could start and terminate Portaudio for several times and see if the device - * count changes but this is ugly. - * - * Conclusion: We are not able to autodetect a working device with - * portaudio (at least not with the newest v19_20071207) at the moment. - * So we have to provide the possibility to manually select an output device - * in the UltraStar options if we want to use portaudio instead of SDL. - *) -function TAudioCore_Portaudio.TestDevice(inParams, outParams: PPaStreamParameters; var sampleRate: double): boolean; -const - altSampleRates: array[0..1] of double = (44100, 48000); // alternative sample-rates -var - stream: PPaStream; - err: TPaError; - cbWorks: boolean; - cbPolls: integer; - i: integer; -begin - Result := false; - - if (sampleRate <= 0) then - sampleRate := 44100; - - // check if device supports our input-format - err := Pa_IsFormatSupported(inParams, outParams, sampleRate); - if (err <> paNoError) then - begin - // we cannot fix the error -> exit - if (err <> paInvalidSampleRate) then - Exit; - - // try alternative sample-rates to the detected one - sampleRate := 0; - for i := 0 to High(altSampleRates) do - begin - // do not check the detected sample-rate twice - if (altSampleRates[i] = sampleRate) then - continue; - // check alternative - err := Pa_IsFormatSupported(inParams, outParams, altSampleRates[i]); - if (err = paNoError) then - begin - // sample-rate works - sampleRate := altSampleRates[i]; - break; - end; - end; - // no working sample-rate found - if (sampleRate = 0) then - Exit; - end; - - // FIXME: for some reason gdb stops after a call of Pa_AbortStream() - // which is implicitely called by Pa_CloseStream(). - // gdb's stops with the message: "ptrace: no process found". - // Probably because the callback-thread is killed what confuses gdb. - {$IF Defined(Debug) and Defined(Linux)} - cbWorks := true; - {$ELSE} - // open device for testing - err := Pa_OpenStream(stream, inParams, outParams, sampleRate, - paFramesPerBufferUnspecified, - paNoFlag, @TestCallback, nil); - if (err <> paNoError) then - begin - exit; - end; - - // start the callback - err := Pa_StartStream(stream); - if (err <> paNoError) then - begin - Pa_CloseStream(stream); - exit; - end; - - cbWorks := false; - // check if the callback was called (poll for max. 1500ms) - for cbPolls := 1 to 150 do - begin - // if the test-callback was called it should be aborted now - if (Pa_IsStreamActive(stream) = 0) then - begin - cbWorks := true; - break; - end; - // not yet aborted, wait and try (poll) again - Pa_Sleep(10); - end; - - // finally abort the stream - Pa_CloseStream(stream); - {$IFEND} - - Result := cbWorks; -end; - -end. diff --git a/src/media/UAudioDecoder_FFmpeg.pas b/src/media/UAudioDecoder_FFmpeg.pas index 9a130484..1fbfe978 100644 --- a/src/media/UAudioDecoder_FFmpeg.pas +++ b/src/media/UAudioDecoder_FFmpeg.pas @@ -64,9 +64,7 @@ implementation avio, ctypes, rational, -{$IFDEF UseSWResample} swresample, -{$ENDIF} UMusic, UIni, UMain, @@ -76,28 +74,13 @@ implementation UConfig, UPath; -{$IFDEF UseSWResample} - {$IF LIBAVCODEC_VERSION >= 54041100} - {$DEFINE UseFrameDecoderAPI} - {$DEFINE ConvertPlanar} - {$ENDIF} -{$ELSE} - {$IF LIBAVCODEC_VERSION >= 57000000} - {$DEFINE UseFrameDecoderAPI} - {$ENDIF} -{$ENDIF} - const MAX_AUDIOQ_SIZE = (5 * 16 * 1024); const // TODO: The factor 3/2 might not be necessary as we do not need extra // space for synchronizing as in the tutorial. -{$IF FFMPEG_VERSION_INT >= 2000000} AUDIO_BUFFER_SIZE = (192000 * 3) div 2; -{$ELSE} - AUDIO_BUFFER_SIZE = (AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) div 2; -{$ENDIF} type TFFmpegDecodeStream = class(TAudioDecodeStream) @@ -128,12 +111,8 @@ TFFmpegDecodeStream = class(TAudioDecodeStream) fPacketQueue: TPacketQueue; fFormatInfo: TAudioFormatInfo; - {$IFDEF UseFrameDecoderAPI} fBytesPerSample: integer; - {$IFEND} - {$IFDEF ConvertPlanar} fSwrContext: PSwrContext; - {$IFEND} // FFmpeg specific data fFormatCtx: PAVFormatContext; @@ -160,9 +139,7 @@ TFFmpegDecodeStream = class(TAudioDecodeStream) fAudioBufferPos: integer; fAudioBufferSize: integer; fAudioBuffer: PByteArray; - {$IFDEF UseFrameDecoderAPI} fAudioBufferFrame: PAVFrame; - {$IFEND} fFilename: IPath; @@ -234,14 +211,7 @@ constructor TFFmpegDecodeStream.Create(); SeekFinishedCond := SDL_CreateCond(); fDecoderUnlockedCond := SDL_CreateCond(); fDecoderResumeCond := SDL_CreateCond(); - - {$IFDEF UseFrameDecoderAPI} - {$IF LIBAVUTIL_VERSION >= 52019101} fAudioBufferFrame := av_frame_alloc(); - {$ELSE} - fAudioBufferFrame := avcodec_alloc_frame(); - {$IFEND} - {$ELSE} // according to the documentation of avcodec_decode_audio(2), sample-data // should be aligned on a 16 byte boundary. Otherwise internal calls // (e.g. to SSE or Altivec operations) might fail or lack performance on some @@ -258,7 +228,6 @@ constructor TFFmpegDecodeStream.Create(); // was not applicable as Delphi in contrast to FPC provides at most 8 byte // alignment ({$ALIGN 16} is not supported) by this directive. fAudioBuffer := GetAlignedMem(AUDIO_BUFFER_SIZE, 16); - {$IFEND} Reset(); end; @@ -302,17 +271,7 @@ destructor TFFmpegDecodeStream.Destroy(); SDL_DestroyCond(SeekFinishedCond); SDL_DestroyCond(fDecoderUnlockedCond); SDL_DestroyCond(fDecoderResumeCond); - - {$IFDEF UseFrameDecoderAPI} - {$IF LIBAVUTIL_VERSION >= 52019101} av_frame_free(@fAudioBufferFrame); - {$ELSE} - avcodec_free_frame(@fAudioBufferFrame); - {$IFEND} - {$ELSE} - FreeAlignedMem(fAudioBuffer); - {$IFEND} - inherited; end; @@ -320,7 +279,7 @@ function TFFmpegDecodeStream.Open(const Filename: IPath): boolean; var SampleFormat: TAudioSampleFormat; PackedSampleFormat: TAVSampleFormat; - TestFrame: TAVPacket; + // TestFrame: TAVPacket; AVResult: integer; begin Result := false; @@ -419,13 +378,11 @@ function TFFmpegDecodeStream.Open(const Filename: IPath): boolean; fCodecCtx^.debug_mv := 0; fCodecCtx^.debug := 0; - {$IF FFMPEG_VERSION_INT >= 1001000} // request required sample format // reference: // http://stackoverflow.com/questions/16479662/ffmpeg-1-0-causing-audio-playback-issues // without this avcodec_open2 returns AV_SAMPLE_FMT_S16P fCodecCtx^.request_sample_fmt := AV_SAMPLE_FMT_S16; - {$IFEND} // detect bug-workarounds automatically fCodecCtx^.workaround_bugs := FF_BUG_AUTODETECT; @@ -438,11 +395,7 @@ function TFFmpegDecodeStream.Open(const Filename: IPath): boolean; // fail if called concurrently by different threads. FFmpegCore.LockAVCodec(); try - {$IF LIBAVCODEC_VERSION >= 53005000} AVResult := avcodec_open2(fCodecCtx, fCodec, nil); - {$ELSE} - AVResult := avcodec_open(fCodecCtx, fCodec); - {$IFEND} finally FFmpegCore.UnlockAVCodec(); end; @@ -454,7 +407,6 @@ function TFFmpegDecodeStream.Open(const Filename: IPath): boolean; end; // now initialize the audio-format - {$IFDEF ConvertPlanar} PackedSampleFormat := av_get_packed_sample_fmt(fCodecCtx^.sample_fmt); if (PackedSampleFormat <> fCodecCtx^.sample_fmt) then begin @@ -478,9 +430,6 @@ function TFFmpegDecodeStream.Open(const Filename: IPath): boolean; end; end; end; - {$ELSE} - PackedSampleFormat := fCodecCtx^.sample_fmt; - {$IFEND} if (not FFmpegCore.ConvertFFmpegToAudioFormat(PackedSampleFormat, SampleFormat)) then begin @@ -494,9 +443,7 @@ function TFFmpegDecodeStream.Open(const Filename: IPath): boolean; fCodecCtx^.sample_rate, SampleFormat ); - {$IFDEF UseFrameDecoderAPI} fBytesPerSample := av_get_bytes_per_sample(PackedSampleFormat) * fCodecCtx^.channels; - {$IFEND} fPacketQueue := TPacketQueue.Create(); @@ -533,11 +480,9 @@ procedure TFFmpegDecodeStream.Close(); SDL_UnlockMutex(fStateLock); end; - {$IFDEF ConvertPlanar} // Free the swresample context if (fSwrContext <> nil) then swr_free(@fSwrContext); - {$IFEND} // Close the codec if (fCodecCtx <> nil) then @@ -785,11 +730,7 @@ function TFFmpegDecodeStream.ParseLoop(): boolean; var Packet: TAVPacket; SeekTarget: int64; - {$IF FFMPEG_VERSION_INT < 1001000} - ByteIOCtx: PByteIOContext; - {$ELSE} ByteIOCtx: PAVIOContext; - {$ENDIF} ErrorCode: integer; StartSilence: double; // duration of silence at start of stream StartSilencePtr: PDouble; // pointer for the EMPTY status packet @@ -971,7 +912,7 @@ function TFFmpegDecodeStream.ParseLoop(): boolean; if (Packet.stream_index = fAudioStreamIndex) then fPacketQueue.Put(@Packet) else - av_free_packet(@Packet); + av_packet_unref(@Packet); finally SDL_LockMutex(fStateLock); @@ -1052,9 +993,7 @@ function TFFmpegDecodeStream.DecodeFrame(): integer; {$IF (LIBAVCODEC_VERSION >= 52122000) and (LIBAVCODEC_VERSION < 57037100)} AVPacket: TAVPacket; {$IFEND} - {$IFDEF UseFrameDecoderAPI} got_frame_ptr: integer; - {$IFEND} {$IFDEF DebugFFmpegDecode} TmpPos: double; {$ENDIF} @@ -1091,18 +1030,12 @@ function TFFmpegDecodeStream.DecodeFrame(): integer; AVPacket.size := fAudioPaketSize; {$IFEND} - {$IFDEF UseFrameDecoderAPI} - {$IF LIBAVCODEC_VERSION >= 57037100} got_frame_ptr := avcodec_receive_frame(fCodecCtx, fAudioBufferFrame); - if (got_frame_ptr = AVERROR(EAGAIN)) then + if got_frame_ptr = AVERROR(EAGAIN) then PaketDecodedSize := fAudioPaketSize else PaketDecodedSize := 0; got_frame_ptr := ord(got_frame_ptr = 0); - {$ELSE} - PaketDecodedSize := avcodec_decode_audio4(fCodecCtx, fAudioBufferFrame, - @got_frame_ptr, @AVPacket); - {$IFEND} if(got_frame_ptr <> 0) then begin DataSize := fAudioBufferFrame.nb_samples * fBytesPerSample; @@ -1110,18 +1043,6 @@ function TFFmpegDecodeStream.DecodeFrame(): integer; end else DataSize := 0; - {$ELSE} - {$IF LIBAVCODEC_VERSION >= 52122000} // 52.122.0 - PaketDecodedSize := avcodec_decode_audio3(fCodecCtx, PSmallint(fAudioBuffer), - DataSize, @AVPacket); - {$ELSEIF LIBAVCODEC_VERSION >= 51030000} // 51.30.0 - PaketDecodedSize := avcodec_decode_audio2(fCodecCtx, PSmallint(fAudioBuffer), - DataSize, fAudioPaketData, fAudioPaketSize); - {$ELSE} - PaketDecodedSize := avcodec_decode_audio(fCodecCtx, PSmallint(fAudioBuffer), - DataSize, fAudioPaketData, fAudioPaketSize); - {$IFEND} - {$IFEND} if(PaketDecodedSize < 0) then begin @@ -1150,7 +1071,7 @@ function TFFmpegDecodeStream.DecodeFrame(): integer; // free old packet data if (fAudioPaket.data <> nil) then - av_free_packet(@fAudioPaket); + av_packet_unref(@fAudioPaket); // do not block queue on seeking (to avoid deadlocks on the DecoderLock) if (IsSeeking()) then @@ -1259,13 +1180,11 @@ function TFFmpegDecodeStream.ReadData(Buffer: PByteArray; BufferSize: integer): // set number of bytes to copy to the output buffer BufferPos := 0; - {$IFDEF ConvertPlanar} if (fSwrContext <> nil) then begin RemainByteCount := BufferSize mod fBytesPerSample; BufferSize := BufferSize - RemainByteCount; end; - {$IFEND} LockDecoder(); try @@ -1274,7 +1193,6 @@ function TFFmpegDecodeStream.ReadData(Buffer: PByteArray; BufferSize: integer): Exit; BufferPtr := nil; - {$IFDEF ConvertPlanar} if ((fSwrContext <> nil) and (fAudioBufferSize > 0)) then begin BufferPtr := @Buffer[0]; @@ -1285,7 +1203,6 @@ function TFFmpegDecodeStream.ReadData(Buffer: PByteArray; BufferSize: integer): BufferPos := BufferPos * fBytesPerSample; Inc(fAudioBufferPos, BufferPos); end; - {$IFEND} // copy data to output buffer while (BufferPos < BufferSize) do @@ -1308,7 +1225,6 @@ function TFFmpegDecodeStream.ReadData(Buffer: PByteArray; BufferSize: integer): RemainByteCount := BufferSize - BufferPos; - {$IFDEF ConvertPlanar} if (fSwrContext <> nil) then begin BufferPtr := @Buffer[BufferPos]; @@ -1322,7 +1238,6 @@ function TFFmpegDecodeStream.ReadData(Buffer: PByteArray; BufferSize: integer): Inc(fAudioBufferPos, CopyByteCount); continue; end; - {$IFEND} // calc number of new bytes in the decode-buffer CopyByteCount := fAudioBufferSize - fAudioBufferPos; @@ -1354,7 +1269,6 @@ function TAudioDecoder_FFmpeg.InitializeDecoder: boolean; begin //Log.LogStatus('InitializeDecoder', 'UAudioDecoder_FFmpeg'); FFmpegCore := TMediaCore_FFmpeg.GetInstance(); - av_register_all(); // Do not show uninformative error messages by default. // FFmpeg prints all error-infos on the console by default what diff --git a/src/media/UAudioInput_Bass.pas b/src/media/UAudioInput_Bass.pas index b5ecedbf..e6f9991c 100644 --- a/src/media/UAudioInput_Bass.pas +++ b/src/media/UAudioInput_Bass.pas @@ -296,6 +296,7 @@ function TBassInputDevice.GetVolume(): single; SourceIndex: integer; lVolume: Single; begin + lVolume := 0; Result := 0; SourceIndex := Ini.InputDeviceConfig[CfgIndex].Input-1; @@ -359,7 +360,6 @@ function TAudioInput_Bass.EnumDevices(): boolean; DeviceInfo: BASS_DEVICEINFO; SourceIndex: integer; RecordInfo: BASS_RECORDINFO; - SelectedSourceIndex: integer; begin result := false; diff --git a/src/media/UAudioInput_Portaudio.pas b/src/media/UAudioInput_Portaudio.pas deleted file mode 100644 index 667c2924..00000000 --- a/src/media/UAudioInput_Portaudio.pas +++ /dev/null @@ -1,534 +0,0 @@ -{* - UltraStar WorldParty - Karaoke Game - - UltraStar WorldParty is the legal property of its developers, - whose names are too numerous to list here. Please refer to the - COPYRIGHT file distributed with this source distribution. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. Check "LICENSE" file. If not, see - . - *} - -unit UAudioInput_Portaudio; - -interface - -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} - -{$I ../switches.inc} - -uses - Classes, - SysUtils, - UMusic; - -implementation - -uses - {$IFDEF UsePortmixer} - portmixer, - {$ENDIF} - portaudio, - ctypes, - UAudioCore_Portaudio, - UUnicodeUtils, - UTextEncoding, - UIni, - ULog, - UMain, - URecord; - -type - TAudioInput_Portaudio = class(TAudioInputBase) - private - AudioCore: TAudioCore_Portaudio; - function EnumDevices(): boolean; - public - function GetName: string; override; - function InitializeRecord: boolean; override; - function FinalizeRecord: boolean; override; - end; - - TPortaudioInputDevice = class(TAudioInputDevice) - private - RecordStream: PPaStream; - {$IFDEF UsePortmixer} - Mixer: PPxMixer; - {$ENDIF} - PaDeviceIndex: TPaDeviceIndex; - public - function Open(): boolean; - function Close(): boolean; - function Start(): boolean; override; - function Stop(): boolean; override; - - function DetermineInputLatency(Info: PPaDeviceInfo): TPaTime; - - function GetVolume(): single; override; - procedure SetVolume(Volume: single); override; - end; - -function MicrophoneCallback(input: pointer; output: pointer; frameCount: culong; - timeInfo: PPaStreamCallbackTimeInfo; statusFlags: TPaStreamCallbackFlags; - inputDevice: pointer): cint; cdecl; forward; - -function MicrophoneTestCallback(input: pointer; output: pointer; frameCount: culong; - timeInfo: PPaStreamCallbackTimeInfo; statusFlags: TPaStreamCallbackFlags; - inputDevice: pointer): cint; cdecl; forward; - -{** - * Converts a string returned by Portaudio into UTF8. - * If the string already is in UTF8 no conversion is performed, otherwise - * the local encoding is used. - *} -function ConvertPaStringToUTF8(const Str: RawByteString): UTF8String; -begin - if (IsUTF8String(Str)) then - Result := Str - else - Result := DecodeStringUTF8(Str, encLocale); -end; - - -{ TPortaudioInputDevice } - -function TPortaudioInputDevice.DetermineInputLatency(Info: PPaDeviceInfo): TPaTime; -begin - if (Ini.InputDeviceConfig[CfgIndex].Latency <> -1) then - begin - // autodetection off -> set user latency - Result := Ini.InputDeviceConfig[CfgIndex].Latency / 1000 - end - else - begin - // on vista and xp the defaultLowInputLatency may be set to 0 but it works. - // TODO: correct too low latencies (what is a too low latency, maybe < 10ms?) - // TODO: retry with input-latency set to 20ms (defaultLowInputLatency might - // not be set correctly in OSS) - - // FIXME: according to the portaudio headers defaultHighInputLatency (approx. 40ms) is - // for robust non-interactive applications and defaultLowInputLatency (approx. 15ms) - // for interactive performance. - // We need defaultLowInputLatency here but this setting is far too buggy. If the callback - // does not return quickly the stream will be stuck after returning from the callback - // and the callback will not be called anymore and mic-capturing stops. - // Audacity (in AudioIO.cpp) uses defaultHighInputLatency if software playthrough is on - // and even higher latencies (100ms) without playthrough so this should be ok for now. - //Result := Info^.defaultLowInputLatency; - Result := Info^.defaultHighInputLatency; - end; -end; - -function TPortaudioInputDevice.Open(): boolean; -var - Error: TPaError; - inputParams: TPaStreamParameters; - deviceInfo: PPaDeviceInfo; - {$IFDEF UsePortmixer} - SourceIndex: integer; - {$ENDIF} -begin - Result := false; - - // get input latency info - deviceInfo := Pa_GetDeviceInfo(PaDeviceIndex); - - // set input stream parameters - with inputParams do - begin - device := PaDeviceIndex; - channelCount := AudioFormat.Channels; - sampleFormat := paInt16; - suggestedLatency := DetermineInputLatency(deviceInfo); - hostApiSpecificStreamInfo := nil; - end; - - Log.LogStatus('Open ' + deviceInfo^.name, 'Portaudio'); - Log.LogStatus('Latency of ' + deviceInfo^.name + ': ' + floatToStr(inputParams.suggestedLatency), 'Portaudio'); - - // open input stream - Error := Pa_OpenStream(RecordStream, @inputParams, nil, - AudioFormat.SampleRate, - paFramesPerBufferUnspecified, paNoFlag, - @MicrophoneCallback, pointer(Self)); - if (Error <> paNoError) then - begin - Log.LogError('Error opening stream: ' + Pa_GetErrorText(Error), 'TPortaudioInputDevice.Open'); - Exit; - end; - - {$IFDEF UsePortmixer} - // open default mixer - Mixer := Px_OpenMixer(RecordStream, 0); - if (Mixer = nil) then - begin - Log.LogError('Error opening mixer: ' + Pa_GetErrorText(Error), 'TPortaudioInputDevice.Open'); - end - else - begin - // save current source selection and select new source - SourceIndex := Ini.InputDeviceConfig[CfgIndex].Input-1; - if (SourceIndex = -1) then - begin - // nothing to do if default source is used - SourceRestore := -1; - end - else - begin - // store current source-index and select new source - SourceRestore := Px_GetCurrentInputSource(Mixer); // -1 in error case - Px_SetCurrentInputSource(Mixer, SourceIndex); - end; - end; - {$ENDIF} - - Result := true; -end; - -function TPortaudioInputDevice.Start(): boolean; -var - Error: TPaError; -begin - Result := false; - - // recording already started -> stop first - if (RecordStream <> nil) then - Stop(); - - // TODO: Do not open the device here (takes too much time). - if (not Open()) then - Exit; - - // start capture - Error := Pa_StartStream(RecordStream); - if (Error <> paNoError) then - begin - Log.LogError('Error starting stream: ' + Pa_GetErrorText(Error), 'TPortaudioInputDevice.Start'); - Close(); - RecordStream := nil; - Exit; - end; - - Result := true; -end; - -function TPortaudioInputDevice.Stop(): boolean; -var - Error: TPaError; -begin - Result := false; - - if (RecordStream = nil) then - Exit; - - // Note: do NOT call Pa_StopStream here! - // It gets stuck on devices with non-working callback as Pa_StopStream - // waits until all buffers have been handled (which never occurs in that case). - Error := Pa_AbortStream(RecordStream); - if (Error <> paNoError) then - begin - Log.LogError('Pa_AbortStream: ' + Pa_GetErrorText(Error), 'TPortaudioInputDevice.Stop'); - end; - - Result := Close(); -end; - -function TPortaudioInputDevice.Close(): boolean; -var - Error: TPaError; -begin - {$IFDEF UsePortmixer} - if (Mixer <> nil) then - begin - // restore source selection - if (SourceRestore >= 0) then - begin - Px_SetCurrentInputSource(Mixer, SourceRestore); - end; - - // close mixer - Px_CloseMixer(Mixer); - Mixer := nil; - end; - {$ENDIF} - - Error := Pa_CloseStream(RecordStream); - if (Error <> paNoError) then - begin - Log.LogError('Pa_CloseStream: ' + Pa_GetErrorText(Error), 'TPortaudioInputDevice.Close'); - Result := false; - end - else - begin - Result := true; - end; - - RecordStream := nil; -end; - -function TPortaudioInputDevice.GetVolume(): single; -begin - Result := 0; - {$IFDEF UsePortmixer} - if (Mixer <> nil) then - Result := Px_GetInputVolume(Mixer); - {$ENDIF} -end; - -procedure TPortaudioInputDevice.SetVolume(Volume: single); -begin - {$IFDEF UsePortmixer} - if (Mixer <> nil) then - begin - // clip to valid range - if (Volume > 1.0) then - Volume := 1.0 - else if (Volume < 0) then - Volume := 0; - Px_SetInputVolume(Mixer, Volume); - end; - {$ENDIF} -end; - - -{ TAudioInput_Portaudio } - -function TAudioInput_Portaudio.GetName: String; -begin - result := 'Portaudio'; -end; - -function TAudioInput_Portaudio.EnumDevices(): boolean; -var - i: integer; - deviceName: UTF8String; - paApiIndex: TPaHostApiIndex; - paApiInfo: PPaHostApiInfo; - paDeviceIndex:TPaDeviceIndex; - paDeviceInfo: PPaDeviceInfo; - channelCnt: integer; - deviceIndex: integer; - err: TPaError; - errMsg: string; - paDevice: TPortaudioInputDevice; - inputParams: TPaStreamParameters; - stream: PPaStream; - streamInfo: PPaStreamInfo; - sampleRate: double; - latency: TPaTime; - {$IFDEF UsePortmixer} - mixer: PPxMixer; - sourceCnt: integer; - sourceIndex: integer; - sourceName: UTF8String; - {$ENDIF} -const - MIN_TEST_LATENCY = 100 / 1000; // min. test latency of 100 ms to avoid removal of working devices -begin - Result := false; - - // choose the best available Audio-API - paApiIndex := AudioCore.GetPreferredApiIndex(); - if (paApiIndex = -1) then - begin - Log.LogError('No working Audio-API found', 'TAudioInput_Portaudio.EnumDevices'); - Exit; - end; - - paApiInfo := Pa_GetHostApiInfo(paApiIndex); - - deviceIndex := 0; - - // init array-size to max. input-devices count - SetLength(AudioInputProcessor.DeviceList, paApiInfo^.deviceCount); - for i:= 0 to High(AudioInputProcessor.DeviceList) do - begin - // convert API-specific device-index to global index - paDeviceIndex := Pa_HostApiDeviceIndexToDeviceIndex(paApiIndex, i); - paDeviceInfo := Pa_GetDeviceInfo(paDeviceIndex); - - channelCnt := paDeviceInfo^.maxInputChannels; - - // current device is no input device -> skip - if (channelCnt <= 0) then - continue; - - // portaudio returns a channel-count of 128 for some devices - // (e.g. the "default"-device), so we have to detect those - // fantasy channel counts. - if (channelCnt > 8) then - channelCnt := 2; - - paDevice := TPortaudioInputDevice.Create(); - AudioInputProcessor.DeviceList[deviceIndex] := paDevice; - - // retrieve device-name - deviceName := ConvertPaStringToUTF8(paDeviceInfo^.name); - paDevice.Name := UnifyDeviceName(deviceName, deviceIndex); - paDevice.PaDeviceIndex := paDeviceIndex; - - sampleRate := paDeviceInfo^.defaultSampleRate; - - // use a stable (high) latency so we do not remove working devices - if (paDeviceInfo^.defaultHighInputLatency > MIN_TEST_LATENCY) then - latency := paDeviceInfo^.defaultHighInputLatency - else - latency := MIN_TEST_LATENCY; - - // setup desired input parameters - with inputParams do - begin - device := paDeviceIndex; - channelCount := channelCnt; - sampleFormat := paInt16; - suggestedLatency := latency; - hostApiSpecificStreamInfo := nil; - end; - - // check souncard and adjust sample-rate - if (not AudioCore.TestDevice(@inputParams, nil, sampleRate)) then - begin - // ignore device if it does not work - Log.LogError('Device "'+paDevice.Name+'" does not work', - 'TAudioInput_Portaudio.EnumDevices'); - paDevice.Free(); - continue; - end; - - // open device for further info - err := Pa_OpenStream(stream, @inputParams, nil, sampleRate, - paFramesPerBufferUnspecified, paNoFlag, @MicrophoneTestCallback, nil); - if (err <> paNoError) then - begin - // unable to open device -> skip - errMsg := Pa_GetErrorText(err); - Log.LogError('Device error: "'+ deviceName +'" ('+ errMsg +')', - 'TAudioInput_Portaudio.EnumDevices'); - paDevice.Free(); - continue; - end; - - // adjust sample-rate (might be changed by portaudio) - streamInfo := Pa_GetStreamInfo(stream); - if (streamInfo <> nil) then - begin - if (sampleRate <> streamInfo^.sampleRate) then - begin - Log.LogStatus('Portaudio changed Samplerate from ' + FloatToStr(sampleRate) + - ' to ' + FloatToStr(streamInfo^.sampleRate), - 'TAudioInput_Portaudio.InitializeRecord'); - sampleRate := streamInfo^.sampleRate; - end; - end; - - // create audio-format info and resize capture-buffer array - paDevice.AudioFormat := TAudioFormatInfo.Create( - channelCnt, - sampleRate, - asfS16 - ); - SetLength(paDevice.CaptureChannel, paDevice.AudioFormat.Channels); - - Log.LogStatus('InputDevice "'+paDevice.Name+'"@' + - IntToStr(paDevice.AudioFormat.Channels)+'x'+ - FloatToStr(paDevice.AudioFormat.SampleRate)+'Hz ('+ - FloatTostr(inputParams.suggestedLatency)+'sec)' , - 'Portaudio.EnumDevices'); - - // portaudio does not provide a source-type check - paDevice.MicSource := -1; - paDevice.SourceRestore := -1; - - // add a virtual default source (will not change mixer-settings) - SetLength(paDevice.Source, 1); - paDevice.Source[0].Name := DEFAULT_SOURCE_NAME; - - {$IFDEF UsePortmixer} - // use default mixer - mixer := Px_OpenMixer(stream, 0); - - // get input count - sourceCnt := Px_GetNumInputSources(mixer); - SetLength(paDevice.Source, sourceCnt+1); - - // get input names - for sourceIndex := 1 to sourceCnt do - begin - sourceName := Px_GetInputSourceName(mixer, sourceIndex-1); - paDevice.Source[sourceIndex].Name := ConvertPaStringToUTF8(sourceName); - end; - - Px_CloseMixer(mixer); - {$ENDIF} - - // close test-stream - Pa_CloseStream(stream); - - Inc(deviceIndex); - end; - - // adjust size to actual input-device count - SetLength(AudioInputProcessor.DeviceList, deviceIndex); - - Log.LogStatus('#Input-Devices: ' + inttostr(deviceIndex), 'Portaudio'); - - Result := true; -end; - -function TAudioInput_Portaudio.InitializeRecord(): boolean; -begin - Result := false; - AudioCore := TAudioCore_Portaudio.GetInstance(); - - // initialize portaudio - if (not AudioCore.Initialize()) then - Exit; - Result := EnumDevices(); -end; - -function TAudioInput_Portaudio.FinalizeRecord: boolean; -begin - CaptureStop; - AudioCore.Terminate(); - Result := inherited FinalizeRecord(); -end; - -{* - * Portaudio input capture callback. - *} -function MicrophoneCallback(input: pointer; output: pointer; frameCount: culong; - timeInfo: PPaStreamCallbackTimeInfo; statusFlags: TPaStreamCallbackFlags; - inputDevice: pointer): cint; cdecl; -begin - AudioInputProcessor.HandleMicrophoneData(input, frameCount*4, inputDevice); - result := paContinue; -end; - -{* - * Portaudio test capture callback. - *} -function MicrophoneTestCallback(input: pointer; output: pointer; frameCount: culong; - timeInfo: PPaStreamCallbackTimeInfo; statusFlags: TPaStreamCallbackFlags; - inputDevice: pointer): cint; cdecl; -begin - // this callback is called only once - result := paAbort; -end; - -initialization - MediaManager.add(TAudioInput_Portaudio.Create); - -end. diff --git a/src/media/UAudioInput_SDL.pas b/src/media/UAudioInput_SDL.pas new file mode 100644 index 00000000..21657415 --- /dev/null +++ b/src/media/UAudioInput_SDL.pas @@ -0,0 +1,228 @@ +// UltraStar Deluxe - Karaoke Game +// SPDX-License-Identifier: GPL-2.0-or-later + +unit UAudioInput_SDL; + +interface + +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + +{$I ../switches.inc} + +uses + Classes, + SysUtils, + UMusic; + +implementation + +uses + sdl2, + ctypes, + math, + UIni, + ULog, + URecord; + +type + TAudioInput_SDL = class(TAudioInputBase) + private + Initialized: boolean; + function EnumDevices(): boolean; + public + function GetName: string; override; + function InitializeRecord: boolean; override; + function FinalizeRecord: boolean; override; + end; + + TSDLInputDevice = class(TAudioInputDevice) + private + DevID: TSDL_AudioDeviceID; + UseName: boolean; + public + function Start(): boolean; override; + function Stop(): boolean; override; + + function GetVolume(): single; override; + procedure SetVolume(Volume: single); override; + end; + +procedure MicrophoneCallback(inputDevice: TSDLInputDevice; input: pointer; len: cint); cdecl; +begin + AudioInputProcessor.HandleMicrophoneData(input, len, inputDevice); +end; + +function TSDLInputDevice.Start(): boolean; +var + devName: PChar; + spec: TSDL_AudioSpec; +begin + Result := false; + + if DevID <= 0 then + begin + FillChar(spec, SizeOf(spec), 0); + with spec do + begin + freq := Round(AudioFormat.SampleRate); + format := AUDIO_S16SYS; + channels := AudioFormat.Channels; + callback := @MicrophoneCallback; + userdata := pointer(Self); + + samples := 0; + if Ini.InputDeviceConfig[CfgIndex].Latency > 0 then + samples := 1 shl Round(Max(Log2(freq / 1000 * Ini.InputDeviceConfig[CfgIndex].Latency), 0)); + end; + + devName := nil; + if UseName then + devName := PChar(Name); + + DevID := SDL_OpenAudioDevice(devName, 1, @spec, @spec, 0); + if DevID > 0 then + begin + if Ini.InputDeviceConfig[CfgIndex].Latency > 0 then + Log.LogStatus('InputDevice "' + Name + '" opened with ' + + IntToStr(spec.samples) + ' samples (' + + IntToStr(round(spec.samples * 1000 / spec.freq)) + + 'ms) buffer', 'SDL'); + SDL_PauseAudioDevice(DevID, 0); + end; + end; + + Result := (DevID > 0); +end; + +function TSDLInputDevice.Stop(): boolean; +begin + SDL_CloseAudioDevice(DevID); + DevID := 0; + Result := true; +end; + +function TSDLInputDevice.GetVolume(): single; +begin + Result := 0; +end; + +procedure TSDLInputDevice.SetVolume(Volume: single); +begin +end; + +function TAudioInput_SDL.GetName: String; +begin + Result := 'SDL'; + if SDL_WasInit(SDL_INIT_AUDIO) <> 0 then + Result := Result + ' (' + SDL_GetCurrentAudioDriver + ')'; +end; + +function TAudioInput_SDL.EnumDevices(): boolean; +var + i: integer; + deviceIndex: integer; + maxDevices: integer; + name: PChar; + device: TSDLInputDevice; + spec: TSDL_AudioSpec; + dev: TSDL_AudioDeviceID; +begin + Result := false; + + Log.LogInfo('Using ' + SDL_GetCurrentAudioDriver + ' driver', 'SDL'); + + maxDevices := SDL_GetNumAudioDevices(1); + if maxDevices < 1 then + maxDevices := 1; + + // init array-size to max. input-devices count + SetLength(AudioInputProcessor.DeviceList, maxDevices); + + deviceIndex := 0; + for i := 0 to High(AudioInputProcessor.DeviceList) do + begin + name := SDL_GetAudioDeviceName(i, 1); + if (name = nil) and (i > 0) then + break; + + FillChar(spec, SizeOf(spec), 0); + with spec do + begin + freq := 44100; + format := AUDIO_S16SYS; + channels := 0; // override with SDL_AUDIO_CHANNELS + samples := 0; + end; + + dev := SDL_OpenAudioDevice(name, 1, @spec, @spec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE or SDL_AUDIO_ALLOW_CHANNELS_CHANGE); + if dev < 1 then + continue; + + SDL_CloseAudioDevice(dev); + + device := TSDLInputDevice.Create(); + device.Name := DEFAULT_SOURCE_NAME; + device.UseName := false; + if name <> nil then + begin + device.Name := name; + device.UseName := true; + end; + + device.MicSource := -1; + device.SourceRestore := -1; + SetLength(device.Source, 1); + device.Source[0].Name := DEFAULT_SOURCE_NAME; + + // create audio-format info and resize capture-buffer array + device.AudioFormat := TAudioFormatInfo.Create( + spec.channels, + spec.freq, + asfS16 + ); + SetLength(device.CaptureChannel, device.AudioFormat.Channels); + + Log.LogStatus('InputDevice "' + device.Name + '"@' + + IntToStr(device.AudioFormat.Channels) + 'x' + + FloatToStr(device.AudioFormat.SampleRate) + 'Hz ' + + 'defaults to ' + IntToStr(spec.samples) + ' samples buffer', + 'SDL'); + + AudioInputProcessor.DeviceList[deviceIndex] := device; + Inc(deviceIndex); + end; + + // adjust size to actual input-device count + SetLength(AudioInputProcessor.DeviceList, deviceIndex); + Log.LogStatus('#Input-Devices: ' + IntToStr(deviceIndex), 'SDL'); + Result := (deviceIndex > 0); +end; + +function TAudioInput_SDL.InitializeRecord(): boolean; +begin + Result := false; + + if SDL_InitSubSystem(SDL_INIT_AUDIO) = -1 then + Exit; + + Initialized := true; + Result := EnumDevices(); +end; + +function TAudioInput_SDL.FinalizeRecord: boolean; +begin + CaptureStop; + if Initialized then + begin + SDL_QuitSubSystem(SDL_INIT_AUDIO); + Initialized := false; + end; + Result := inherited FinalizeRecord(); +end; + +initialization + MediaManager.add(TAudioInput_SDL.Create); + +end. diff --git a/src/media/UAudioPlaybackBase.pas b/src/media/UAudioPlaybackBase.pas index 44086e36..119b01c5 100644 --- a/src/media/UAudioPlaybackBase.pas +++ b/src/media/UAudioPlaybackBase.pas @@ -208,12 +208,10 @@ function TAudioPlaybackBase.OpenStream(const Filename: IPath): TAudioPlaybackStr begin Result := nil; - //Log.LogStatus('Loading Sound: "' + Filename + '"', 'TAudioPlayback_Bass.OpenStream'); - DecodeStream := OpenDecodeStream(Filename); if (not assigned(DecodeStream)) then begin - Log.LogStatus('Could not open "' + Filename.ToNative + '"', 'TAudioPlayback_Bass.OpenStream'); + Log.LogStatus('Could not open "' + Filename.ToNative + '"', 'TAudioPlaybackBase.OpenStream'); Exit; end; diff --git a/src/media/UAudioPlayback_Bass.pas b/src/media/UAudioPlayback_Bass.pas index 1999d4d6..2c344da1 100644 --- a/src/media/UAudioPlayback_Bass.pas +++ b/src/media/UAudioPlayback_Bass.pas @@ -138,10 +138,9 @@ TBassOutputDevice = class(TAudioOutputDevice) end; TReplayGain_Bass = class(TReplayGain) - private - procedure Init(); override; public - class function CanEnable(): boolean; override; static; + procedure Init(); override; + class function CanEnable(): boolean; override; function GetType: DWORD; override; function GetPriority: LongInt; override; @@ -724,7 +723,6 @@ function TAudioPlayback_Bass.GetName: String; function TAudioPlayback_Bass.EnumDevices(): boolean; var BassDeviceID: DWORD; - DeviceIndex: integer; Device: TBassOutputDevice; DeviceInfo: BASS_DEVICEINFO; begin diff --git a/src/media/UAudioPlayback_Portaudio.pas b/src/media/UAudioPlayback_Portaudio.pas deleted file mode 100644 index 1f35ea8b..00000000 --- a/src/media/UAudioPlayback_Portaudio.pas +++ /dev/null @@ -1,382 +0,0 @@ -{* - UltraStar WorldParty - Karaoke Game - - UltraStar WorldParty is the legal property of its developers, - whose names are too numerous to list here. Please refer to the - COPYRIGHT file distributed with this source distribution. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. Check "LICENSE" file. If not, see - . - *} - -unit UAudioPlayback_Portaudio; - -interface - -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} - -{$I switches.inc} - -uses - Classes, - SysUtils, - UMusic; - -implementation - -uses - portaudio, - UAudioCore_Portaudio, - UAudioPlayback_SoftMixer, - ULog, - UIni, - UMain; - -type - TAudioPlayback_Portaudio = class(TAudioPlayback_SoftMixer) - private - paStream: PPaStream; - AudioCore: TAudioCore_Portaudio; - Latency: double; - function OpenDevice(deviceIndex: TPaDeviceIndex): boolean; - function EnumDevices(): boolean; - protected - function InitializeAudioPlaybackEngine(): boolean; override; - function StartAudioPlaybackEngine(): boolean; override; - procedure StopAudioPlaybackEngine(); override; - function FinalizeAudioPlaybackEngine(): boolean; override; - function GetLatency(): double; override; - public - function GetName: String; override; - end; - - TPortaudioOutputDevice = class(TAudioOutputDevice) - private - PaDeviceIndex: TPaDeviceIndex; - end; - - -{ TAudioPlayback_Portaudio } - -function PortaudioAudioCallback(input: Pointer; output: Pointer; frameCount: Longword; - timeInfo: PPaStreamCallbackTimeInfo; statusFlags: TPaStreamCallbackFlags; - userData: Pointer): Integer; cdecl; -var - Engine: TAudioPlayback_Portaudio; -begin - Engine := TAudioPlayback_Portaudio(userData); - // update latency - Engine.Latency := timeInfo.outputBufferDacTime - timeInfo.currentTime; - // call superclass callback - Engine.AudioCallback(output, frameCount * Engine.FormatInfo.FrameSize); - Result := paContinue; -end; - -function TAudioPlayback_Portaudio.GetName: String; -begin - Result := 'Portaudio_Playback'; -end; - -function TAudioPlayback_Portaudio.OpenDevice(deviceIndex: TPaDeviceIndex): boolean; -var - DeviceInfo : PPaDeviceInfo; - SampleRate : double; - OutParams : TPaStreamParameters; - StreamInfo : PPaStreamInfo; - err : TPaError; -begin - Result := false; - - DeviceInfo := Pa_GetDeviceInfo(deviceIndex); - - Log.LogInfo('Audio-Output Device: ' + DeviceInfo^.name, 'TAudioPlayback_Portaudio.OpenDevice'); - - SampleRate := DeviceInfo^.defaultSampleRate; - - with OutParams do - begin - device := deviceIndex; - channelCount := 2; - sampleFormat := paInt16; - suggestedLatency := DeviceInfo^.defaultLowOutputLatency; - hostApiSpecificStreamInfo := nil; - end; - - // check souncard and adjust sample-rate - if not AudioCore.TestDevice(nil, @OutParams, SampleRate) then - begin - Log.LogStatus('TestDevice failed!', 'TAudioPlayback_Portaudio.OpenDevice'); - Exit; - end; - - // open output stream - err := Pa_OpenStream(paStream, nil, @OutParams, SampleRate, - paFramesPerBufferUnspecified, - paNoFlag, @PortaudioAudioCallback, Self); - if(err <> paNoError) then - begin - Log.LogStatus(Pa_GetErrorText(err), 'TAudioPlayback_Portaudio.OpenDevice'); - paStream := nil; - Exit; - end; - - // get estimated latency (will be updated with real latency in the callback) - StreamInfo := Pa_GetStreamInfo(paStream); - if (StreamInfo <> nil) then - Latency := StreamInfo^.outputLatency - else - Latency := 0; - - FormatInfo := TAudioFormatInfo.Create( - OutParams.channelCount, - SampleRate, - asfS16 // FIXME: is paInt16 system-dependant or -independant? - ); - - Result := true; -end; - -function TAudioPlayback_Portaudio.EnumDevices(): boolean; -var - i: integer; - paApiIndex: TPaHostApiIndex; - paApiInfo: PPaHostApiInfo; - deviceName: string; - deviceIndex: TPaDeviceIndex; - deviceInfo: PPaDeviceInfo; - channelCnt: integer; - SC: integer; // soundcard - err: TPaError; - errMsg: string; - paDevice: TPortaudioOutputDevice; - outputParams: TPaStreamParameters; - stream: PPaStream; - streamInfo: PPaStreamInfo; - sampleRate: double; - latency: TPaTime; - cbPolls: integer; - cbWorks: boolean; -begin - Result := false; - -(* - // choose the best available Audio-API - paApiIndex := AudioCore.GetPreferredApiIndex(); - if(paApiIndex = -1) then - begin - Log.LogError('No working Audio-API found', 'TAudioPlayback_Portaudio.EnumDevices'); - Exit; - end; - - paApiInfo := Pa_GetHostApiInfo(paApiIndex); - - SC := 0; - - // init array-size to max. output-devices count - SetLength(OutputDeviceList, paApiInfo^.deviceCount); - for i:= 0 to High(OutputDeviceList) do - begin - // convert API-specific device-index to global index - deviceIndex := Pa_HostApiDeviceIndexToDeviceIndex(paApiIndex, i); - deviceInfo := Pa_GetDeviceInfo(deviceIndex); - - channelCnt := deviceInfo^.maxOutputChannels; - - // current device is no output device -> skip - if (channelCnt <= 0) then - continue; - - // portaudio returns a channel-count of 128 for some devices - // (e.g. the "default"-device), so we have to detect those - // fantasy channel counts. - if (channelCnt > 8) then - channelCnt := 2; - - paDevice := TPortaudioOutputDevice.Create(); - OutputDeviceList[SC] := paDevice; - - // retrieve device-name - deviceName := deviceInfo^.name; - paDevice.Name := deviceName; - paDevice.PaDeviceIndex := deviceIndex; - - if (deviceInfo^.defaultSampleRate > 0) then - sampleRate := deviceInfo^.defaultSampleRate - else - sampleRate := 44100; - - // on vista and xp the defaultLowInputLatency may be set to 0 but it works. - // TODO: correct too low latencies (what is a too low latency, maybe < 10ms?) - latency := deviceInfo^.defaultLowInputLatency; - - // setup desired output parameters - // TODO: retry with input-latency set to 20ms (defaultLowOutputLatency might - // not be set correctly in OSS) - with outputParams do - begin - device := deviceIndex; - channelCount := channelCnt; - sampleFormat := paInt16; - suggestedLatency := latency; - hostApiSpecificStreamInfo := nil; - end; - - // check if mic-callback works (might not be called on some devices) - if (not TAudioCore_Portaudio.TestDevice(nil, @outputParams, sampleRate)) then - begin - // ignore device if callback did not work - Log.LogError('Device "'+paDevice.Name+'" does not respond', - 'TAudioPlayback_Portaudio.InitializeRecord'); - paDevice.Free(); - continue; - end; - - // open device for further info - err := Pa_OpenStream(stream, nil, @outputParams, sampleRate, - paFramesPerBufferUnspecified, paNoFlag, @MicrophoneTestCallback, nil); - if(err <> paNoError) then - begin - // unable to open device -> skip - errMsg := Pa_GetErrorText(err); - Log.LogError('Device error: "'+ deviceName +'" ('+ errMsg +')', - 'TAudioPlayback_Portaudio.InitializeRecord'); - paDevice.Free(); - continue; - end; - - // adjust sample-rate (might be changed by portaudio) - streamInfo := Pa_GetStreamInfo(stream); - if (streamInfo <> nil) then - begin - if (sampleRate <> streamInfo^.sampleRate) then - begin - Log.LogStatus('Portaudio changed Samplerate from ' + FloatToStr(sampleRate) + - ' to ' + FloatToStr(streamInfo^.sampleRate), - 'TAudioInput_Portaudio.InitializeRecord'); - sampleRate := streamInfo^.sampleRate; - end; - end; - - // create audio-format info and resize capture-buffer array - paDevice.AudioFormat := TAudioFormatInfo.Create( - channelCnt, - sampleRate, - asfS16 - ); - SetLength(paDevice.CaptureChannel, paDevice.AudioFormat.Channels); - - Log.LogStatus('OutputDevice "'+paDevice.Name+'"@' + - IntToStr(paDevice.AudioFormat.Channels)+'x'+ - FloatToStr(paDevice.AudioFormat.SampleRate)+'Hz ('+ - FloatTostr(outputParams.suggestedLatency)+'sec)' , - 'TAudioInput_Portaudio.InitializeRecord'); - - // close test-stream - Pa_CloseStream(stream); - - Inc(SC); - end; - - // adjust size to actual input-device count - SetLength(OutputDeviceList, SC); - - Log.LogStatus('#Output-Devices: ' + inttostr(SC), 'Portaudio'); -*) - - Result := true; -end; - -function TAudioPlayback_Portaudio.InitializeAudioPlaybackEngine(): boolean; -var - paApiIndex : TPaHostApiIndex; - paApiInfo : PPaHostApiInfo; - paOutDevice : TPaDeviceIndex; -begin - Result := false; - AudioCore := TAudioCore_Portaudio.GetInstance(); - - // initialize portaudio - if (not AudioCore.Initialize()) then - Exit; - - paApiIndex := AudioCore.GetPreferredApiIndex(); - if (paApiIndex = -1) then - begin - Log.LogError('No working Audio-API found', 'TAudioPlayback_Portaudio.InitializeAudioPlaybackEngine'); - Exit; - end; - - EnumDevices(); - - paApiInfo := Pa_GetHostApiInfo(paApiIndex); - Log.LogInfo('Audio-Output API-Type: ' + paApiInfo^.name, 'TAudioPlayback_Portaudio.OpenDevice'); - - paOutDevice := paApiInfo^.defaultOutputDevice; - if (not OpenDevice(paOutDevice)) then - begin - Exit; - end; - - Result := true; -end; - -function TAudioPlayback_Portaudio.StartAudioPlaybackEngine(): boolean; -var - err: TPaError; -begin - Result := false; - - if (paStream = nil) then - Exit; - - err := Pa_StartStream(paStream); - if(err <> paNoError) then - begin - Log.LogStatus('Pa_StartStream: '+Pa_GetErrorText(err), 'UAudioPlayback_Portaudio'); - Exit; - end; - - Result := true; -end; - -procedure TAudioPlayback_Portaudio.StopAudioPlaybackEngine(); -begin - if (paStream <> nil) then - begin - Pa_CloseStream(paStream); - // wait until stream is closed, otherwise Terminate() might cause a segfault - while (Pa_IsStreamActive(paStream) = 1) do - ; - paStream := nil; - end; -end; - -function TAudioPlayback_Portaudio.FinalizeAudioPlaybackEngine(): boolean; -begin - StopAudioPlaybackEngine(); - Result := AudioCore.Terminate(); -end; - -function TAudioPlayback_Portaudio.GetLatency(): double; -begin - Result := Latency; -end; - - -initialization - MediaManager.Add(TAudioPlayback_Portaudio.Create); - -end. diff --git a/src/media/UAudioPlayback_SoftMixer.pas b/src/media/UAudioPlayback_SoftMixer.pas index 0f852c7b..1194d951 100644 --- a/src/media/UAudioPlayback_SoftMixer.pas +++ b/src/media/UAudioPlayback_SoftMixer.pas @@ -443,13 +443,7 @@ function TGenericPlaybackStream.InitFormatConversion(): boolean; DstFormatInfo := GetAudioFormatInfo(); // TODO: selection should not be done here, use a factory (TAudioConverterFactory) instead - {$IF Defined(UseFFmpegResample)} - Converter := TAudioConverter_FFmpeg.Create(); - {$ELSEIF Defined(UseSRCResample)} - Converter := TAudioConverter_SRC.Create(); - {$ELSE} Converter := TAudioConverter_SDL.Create(); - {$IFEND} Result := Converter.Init(SrcFormatInfo, DstFormatInfo); end; diff --git a/src/media/UMediaCore_FFmpeg.pas b/src/media/UMediaCore_FFmpeg.pas index ebbb0bd0..f84568de 100644 --- a/src/media/UMediaCore_FFmpeg.pas +++ b/src/media/UMediaCore_FFmpeg.pas @@ -258,6 +258,7 @@ function TMediaCore_FFmpeg.GetErrorString(ErrorNum: integer): string; else Result := 'AVERROR_#'+inttostr(ErrorNum); end; {$ELSE} + Result := ''; {$IFEND} end; @@ -654,9 +655,6 @@ function TPacketQueue.PutStatus(StatusFlag: integer; StatusInfo: Pointer): integ av_init_packet(TempPacket^); TempPacket^.data := Pointer(STATUS_PACKET); TempPacket^.flags := StatusFlag; -{$IF FFMPEG_VERSION_INT < 2000000} - TempPacket^.priv := StatusInfo; -{$ENDIF} // put a copy of the package into the queue Result := Put(TempPacket); // data has been copied -> delete temp. package @@ -665,17 +663,11 @@ function TPacketQueue.PutStatus(StatusFlag: integer; StatusInfo: Pointer): integ procedure TPacketQueue.FreeStatusInfo(var Packet: TAVPacket); begin -{$IF FFMPEG_VERSION_INT < 2000000} - if (Packet.priv <> nil) then - FreeMem(Packet.priv); -{$ENDIF} end; function TPacketQueue.GetStatusInfo(var Packet: TAVPacket): Pointer; begin -{$IF FFMPEG_VERSION_INT < 2000000} - Result := Packet.priv; -{$ENDIF} + Result := nil; end; function TPacketQueue.Get(var Packet: TAVPacket; Blocking: boolean): integer; @@ -750,7 +742,7 @@ procedure TPacketQueue.Flush(); if (PChar(CurrentListEntry^.pkt.data) = STATUS_PACKET) then FreeStatusInfo(CurrentListEntry^.pkt); // free packet data - av_free_packet(@CurrentListEntry^.pkt); + av_packet_unref(@CurrentListEntry^.pkt); // Note: param must be a pointer to a pointer! av_freep(@CurrentListEntry); CurrentListEntry := TempListEntry; diff --git a/src/media/UMedia_dummy.pas b/src/media/UMedia_dummy.pas deleted file mode 100644 index 149a5b63..00000000 --- a/src/media/UMedia_dummy.pas +++ /dev/null @@ -1,501 +0,0 @@ -{* - UltraStar WorldParty - Karaoke Game - - UltraStar WorldParty is the legal property of its developers, - whose names are too numerous to list here. Please refer to the - COPYRIGHT file distributed with this source distribution. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. Check "LICENSE" file. If not, see - . - *} - -unit UMedia_dummy; - -interface - -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} - -{$I switches.inc} - -implementation - -uses - SysUtils, - math, - Classes, - UTime, - UMusic, - UPath; - -type - TAudio_Dummy = class( TInterfacedObject, IAudioPlayback, IAudioInput ) - private - DummyOutputDeviceList: TAudioOutputDeviceList; - public - constructor Create(); - function GetName: string; - - function Init(): boolean; - function Finalize(): boolean; - - function Open(const aFileName: IPath): boolean; // true if succeed - procedure Close; - - procedure Play; - procedure Pause; - procedure Stop; - - procedure SetPosition(Time: real); - function GetPosition: real; - - procedure SetSyncSource(SyncSource: TSyncSource); - - // IAudioInput - function InitializeRecord: boolean; - function FinalizeRecord: boolean; - procedure CaptureStart; - procedure CaptureStop; - procedure GetFFTData(var data: TFFTData); - function GetPCMData(var data: TPCMData): Cardinal; - - // IAudioPlayback - function InitializePlayback: boolean; - function FinalizePlayback: boolean; - - function GetOutputDeviceList(): TAudioOutputDeviceList; - procedure FadeIn(Time: real; TargetVolume: single); - procedure Fade(Time: real; TargetVolume: single); - procedure SetAppVolume(Volume: single); - procedure SetVolume(Volume: single); - procedure Rewind; - - procedure SetLoop(Enabled: boolean); - function GetLoop(): boolean; - - function Finished: boolean; - function Length: real; - - function OpenSound(const Filename: IPath): TAudioPlaybackStream; - function OpenSoundBuffer(Buffer: TStream; Format: TAudioFormatInfo): TAudioPlaybackStream; - procedure CloseSound(var PlaybackStream: TAudioPlaybackStream); - procedure PlaySound(stream: TAudioPlaybackStream); - procedure StopSound(stream: TAudioPlaybackStream); - - function CreateVoiceStream(Channel: integer; FormatInfo: TAudioFormatInfo): TAudioVoiceStream; - procedure CloseVoiceStream(var VoiceStream: TAudioVoiceStream); - end; - - TVideo_Dummy = class( TInterfacedObject, IVideo ) - public - procedure Close; - - procedure Play; - procedure Pause; - procedure Stop; - - procedure SetLoop(Enable: boolean); - function GetLoop(): boolean; - - procedure SetPosition(Time: real); - function GetPosition: real; - - procedure SetScreen(Screen: integer); - function GetScreen(): integer; - - procedure SetScreenPosition(X, Y, Z: double); - procedure GetScreenPosition(var X, Y, Z: double); - - procedure SetWidth(Width: double); - function GetWidth(): double; - - procedure SetHeight(Height: double); - function GetHeight(): double; - - procedure SetFrameRange(Range: TRectCoords); - function GetFrameRange(): TRectCoords; - - function GetFrameAspect(): real; - - procedure SetAspectCorrection(AspectCorrection: TAspectCorrection); - function GetAspectCorrection(): TAspectCorrection; - - procedure SetAlpha(Alpha: double); - function GetAlpha(): double; - - procedure SetReflectionSpacing(Spacing: double); - function GetReflectionSpacing(): double; - - procedure GetFrame(Time: Extended); - procedure Draw(); - procedure DrawReflection(); - - property Screen: integer read GetScreen; - property Width: double read GetWidth write SetWidth; - property Height: double read GetHeight write SetWidth; - property Alpha: double read GetAlpha write SetAlpha; - property ReflectionSpacing: double read GetReflectionSpacing write SetReflectionSpacing; - property FrameAspect: real read GetFrameAspect; - property AspectCorrection: TAspectCorrection read GetAspectCorrection; - property Loop: boolean read GetLoop write SetLoop; - property Position: real read GetPosition write SetPosition; - end; - - TVideoPlayback_Dummy = class( TInterfacedObject, IVideoPlayback, IVideoVisualization ) - public - constructor Create(); - function GetName: string; - - function Init(): boolean; - function Finalize(): boolean; - - function Open(const FileName: IPath): IVideo; - end; - -function TAudio_Dummy.GetName: string; -begin - Result := 'AudioDummy'; -end; - -constructor TAudio_Dummy.Create(); -begin - inherited; -end; - -function TAudio_Dummy.Init(): boolean; -begin - Result := true; -end; - -function TAudio_Dummy.Finalize(): boolean; -begin - Result := true; -end; - -function TAudio_Dummy.Open(const aFileName : IPath): boolean; // true if succeed -begin - Result := false; -end; - -procedure TAudio_Dummy.Close; -begin -end; - -procedure TAudio_Dummy.Play; -begin -end; - -procedure TAudio_Dummy.Pause; -begin -end; - -procedure TAudio_Dummy.Stop; -begin -end; - -procedure TAudio_Dummy.SetPosition(Time: real); -begin -end; - -function TAudio_Dummy.GetPosition: real; -begin - Result := 0; -end; - -procedure TAudio_Dummy.SetSyncSource(SyncSource: TSyncSource); -begin -end; - -// IAudioInput -function TAudio_Dummy.InitializeRecord: boolean; -begin - Result := true; -end; - -function TAudio_Dummy.FinalizeRecord: boolean; -begin - Result := true; -end; - -procedure TAudio_Dummy.CaptureStart; -begin -end; - -procedure TAudio_Dummy.CaptureStop; -begin -end; - -procedure TAudio_Dummy.GetFFTData(var data: TFFTData); -begin -end; - -function TAudio_Dummy.GetPCMData(var data: TPCMData): Cardinal; -begin - Result := 0; -end; - -// IAudioPlayback -function TAudio_Dummy.InitializePlayback: boolean; -begin - SetLength(DummyOutputDeviceList, 1); - DummyOutputDeviceList[0] := TAudioOutputDevice.Create(); - DummyOutputDeviceList[0].Name := '[Dummy Device]'; - Result := true; -end; - -function TAudio_Dummy.FinalizePlayback: boolean; -begin - Result := true; -end; - -function TAudio_Dummy.GetOutputDeviceList(): TAudioOutputDeviceList; -begin - Result := DummyOutputDeviceList; -end; - -procedure TAudio_Dummy.SetAppVolume(Volume: single); -begin -end; - -procedure TAudio_Dummy.SetVolume(Volume: single); -begin -end; - -procedure TAudio_Dummy.SetLoop(Enabled: boolean); -begin -end; - -function TAudio_Dummy.GetLoop(): boolean; -begin - Result := false; -end; - -procedure TAudio_Dummy.FadeIn(Time: real; TargetVolume: single); -begin -end; - -procedure TAudio_Dummy.Fade(Time: real; TargetVolume: single); -begin -end; - -procedure TAudio_Dummy.Rewind; -begin -end; - -function TAudio_Dummy.Finished: boolean; -begin - Result := false; -end; - -function TAudio_Dummy.Length: real; -begin - Result := 60; -end; - -function TAudio_Dummy.OpenSound(const Filename: IPath): TAudioPlaybackStream; -begin - Result := nil; -end; - -function TAudio_Dummy.OpenSoundBuffer(Buffer: TStream; Format: TAudioFormatInfo): TAudioPlaybackStream; -begin - Result := nil; -end; - -procedure TAudio_Dummy.CloseSound(var PlaybackStream: TAudioPlaybackStream); -begin -end; - -procedure TAudio_Dummy.PlaySound(stream: TAudioPlaybackStream); -begin -end; - -procedure TAudio_Dummy.StopSound(stream: TAudioPlaybackStream); -begin -end; - -function TAudio_Dummy.CreateVoiceStream(Channel: integer; FormatInfo: TAudioFormatInfo): TAudioVoiceStream; -begin - Result := nil; -end; - -procedure TAudio_Dummy.CloseVoiceStream(var VoiceStream: TAudioVoiceStream); -begin -end; - - -{ TVideoPlayback_Dummy } - -procedure TVideo_Dummy.Close; -begin -end; - -procedure TVideo_Dummy.Play; -begin -end; - -procedure TVideo_Dummy.Pause; -begin -end; - -procedure TVideo_Dummy.Stop; -begin -end; - -procedure TVideo_Dummy.SetLoop(Enable: boolean); -begin -end; - -function TVideo_Dummy.GetLoop(): boolean; -begin - Result := false; -end; - -procedure TVideo_Dummy.SetPosition(Time: real); -begin -end; - -function TVideo_Dummy.GetPosition: real; -begin - Result := 0; -end; - -procedure TVideo_Dummy.SetScreen(Screen: integer); -begin -end; - -function TVideo_Dummy.GetScreen(): integer; -begin - Result := 0; -end; - -procedure TVideo_Dummy.SetScreenPosition(X, Y, Z: double); -begin -end; - -procedure TVideo_Dummy.GetScreenPosition(var X, Y, Z: double); -begin - X := 0; - Y := 0; - Z := 0; -end; - -procedure TVideo_Dummy.SetWidth(Width: double); -begin -end; - -function TVideo_Dummy.GetWidth(): double; -begin - Result := 0; -end; - -procedure TVideo_Dummy.SetHeight(Height: double); -begin -end; - -function TVideo_Dummy.GetHeight(): double; -begin - Result := 0; -end; - -procedure TVideo_Dummy.SetFrameRange(Range: TRectCoords); -begin -end; - -function TVideo_Dummy.GetFrameRange(): TRectCoords; -begin - Result.Left := 0; - Result.Right := 0; - Result.Upper := 0; - Result.Lower := 0; -end; - -function TVideo_Dummy.GetFrameAspect(): real; -begin - Result := 0; -end; - -procedure TVideo_Dummy.SetAspectCorrection(AspectCorrection: TAspectCorrection); -begin -end; - -function TVideo_Dummy.GetAspectCorrection(): TAspectCorrection; -begin - Result := acoStretch; -end; - -procedure TVideo_Dummy.SetAlpha(Alpha: double); -begin -end; - -function TVideo_Dummy.GetAlpha(): double; -begin - Result := 0; -end; - -procedure TVideo_Dummy.SetReflectionSpacing(Spacing: double); -begin -end; - -function TVideo_Dummy.GetReflectionSpacing(): double; -begin - Result := 0; -end; - -procedure TVideo_Dummy.GetFrame(Time: Extended); -begin -end; - -procedure TVideo_Dummy.Draw(); -begin -end; - -procedure TVideo_Dummy.DrawReflection(); -begin -end; - - -{ TVideoPlayback_Dummy } - -constructor TVideoPlayback_Dummy.Create(); -begin -end; - -function TVideoPlayback_Dummy.GetName: string; -begin - Result := 'VideoDummy'; -end; - -function TVideoPlayback_Dummy.Init(): boolean; -begin - Result := true; -end; - -function TVideoPlayback_Dummy.Finalize(): boolean; -begin - Result := true; -end; - -function TVideoPlayback_Dummy.Open(const FileName: IPath): IVideo; -begin - Result := TVideo_Dummy.Create; -end; - - -initialization - MediaManager.Add(TAudio_Dummy.Create); - MediaManager.Add(TVideoPlayback_Dummy.Create); - -end. diff --git a/src/media/UVideo.pas b/src/media/UVideo.pas index 4b964e86..f2cdca39 100644 --- a/src/media/UVideo.pas +++ b/src/media/UVideo.pas @@ -39,11 +39,6 @@ interface {$I switches.inc} -// use BGR-format for accelerated colorspace conversion with swscale -{$IFDEF UseSWScale} - {$DEFINE PIXEL_FMT_BGR} -{$ENDIF} - implementation uses @@ -56,9 +51,7 @@ implementation avutil, avio, rational, - {$IFDEF UseSWScale} swscale, - {$ENDIF} dglOpenGL, StrUtils, UMediaCore_FFmpeg, @@ -70,32 +63,15 @@ implementation UGraphic, UPath; -{$DEFINE PIXEL_FMT_BGR} - const -{$IFDEF PIXEL_FMT_BGR} PIXEL_FMT_OPENGL = GL_BGR; - {$IF FFMPEG_VERSION_INT < 1001000} - PIXEL_FMT_FFMPEG = PIX_FMT_BGR24; - {$ELSE} PIXEL_FMT_FFMPEG = AV_PIX_FMT_BGR24; - {$ENDIF} - PIXEL_FMT_SIZE = 3; + PIXEL_FMT_SIZE = 3; // looks strange on linux: //PIXEL_FMT_OPENGL = GL_RGBA; //PIXEL_FMT_FFMPEG = PIX_FMT_BGR32; //PIXEL_FMT_SIZE = 4; -{$ELSE} - // looks strange on linux: - PIXEL_FMT_OPENGL = GL_RGB; - {$IF FFMPEG_VERSION_INT < 1001000} - PIXEL_FMT_FFMPEG = PIX_FMT_BGR24; - {$ELSE} - PIXEL_FMT_FFMPEG = AV_PIX_FMT_BGR24; - {$ENDIF} - PIXEL_FMT_SIZE = 3; -{$ENDIF} BUFFER_ALIGN = 32; ReflectionH = 0.5; //reflection height (50%) @@ -128,9 +104,7 @@ TVideo_FFmpeg = class( TInterfacedObject, IVideo_FFmpeg ) fFrameTexValid: boolean; //**< if true, fFrameTex contains the current frame fTexWidth, fTexHeight: cardinal; - {$IFDEF UseSWScale} fSwScaleContext: PSwsContext; - {$ENDIF} fScreen: integer; //actual screen to draw on @@ -283,8 +257,6 @@ function TVideoPlayback_FFmpeg.Init(): boolean; fInitialized := true; FFmpegCore := TMediaCore_FFmpeg.GetInstance(); - - av_register_all(); end; function TVideoPlayback_FFmpeg.Finalize(): boolean; @@ -473,11 +445,7 @@ function TVideo_FFmpeg.Open(const FileName : IPath): boolean; fAspect := fAspect * fCodecContext^.width / fCodecContext^.height; - {$IF LIBAVFORMAT_VERSION_MAJOR >= 55} r_frame_rate := av_q2d(av_stream_get_r_frame_rate(fStream)); - {$ELSE} - r_frame_rate := av_q2d(fStream^.r_frame_rate); - {$ENDIF} fFrameDuration := 1/r_frame_rate; @@ -492,7 +460,6 @@ function TVideo_FFmpeg.Open(const FileName : IPath): boolean; Log.LogInfo('Framerate: '+inttostr(floor(1/fFrameDuration))+'fps', 'TVideoPlayback_ffmpeg.Open'); - {$IFDEF UseSWScale} // if available get a SWScale-context -> faster than the deprecated img_convert(). // SWScale has accelerated support for PIX_FMT_RGB32/PIX_FMT_BGR24/PIX_FMT_BGR565/PIX_FMT_BGR555. // Note: PIX_FMT_RGB32 is a BGR- and not an RGB-format (maybe a bug)!!! @@ -511,7 +478,6 @@ function TVideo_FFmpeg.Open(const FileName : IPath): boolean; Close(); Exit; end; - {$ENDIF} if (SupportsNPOT = false) then begin @@ -668,11 +634,7 @@ function TVideo_FFmpeg.DecodeFrame(): boolean; {$IF LIBAVCODEC_VERSION < 51068000} VideoPktPts: int64; {$ENDIF} - {$IF FFMPEG_VERSION_INT < 1001000} - pbIOCtx: PByteIOContext; - {$ELSE} pbIOCtx: PAVIOContext; - {$ENDIF} errnum: integer; AVPacket: TAVPacket; pts: int64; @@ -772,7 +734,7 @@ function TVideo_FFmpeg.DecodeFrame(): boolean; end; // free the packet from av_read_frame - av_free_packet( @AVPacket ); + av_packet_unref( @AVPacket ); end; // reset opaque data and update pts @@ -928,26 +890,11 @@ procedure TVideo_FFmpeg.GetFrame(Time: Extended); //end; // otherwise we convert the pixeldata from YUV to RGB - {$IFDEF UseSWScale} try - - errnum := sws_scale(fSwScaleContext, @fAVFrame.data, @fAVFrame.linesize, - 0, fCodecContext^.Height, - @fAVFrameRGB.data, @fAVFrameRGB.linesize); + errnum := sws_scale(fSwScaleContext, @fAVFrame.data, @fAVFrame.linesize, 0, fCodecContext^.Height, @fAVFrameRGB.data, @fAVFrameRGB.linesize); except ; end; - {$ELSE} - // img_convert from lib/ffmpeg/avcodec.pas is actually deprecated. - // If ./configure does not find SWScale then this gives the error - // that the identifier img_convert is not known or similar. - // I think this should be removed, but am not sure whether there should - // be some other replacement or a warning, Therefore, I leave it for now. - // April 2009, mischi - errnum := img_convert(PAVPicture(fAVFrameRGB), PIXEL_FMT_FFMPEG, - PAVPicture(fAVFrame), fCodecContext^.pix_fmt, - fCodecContext^.width, fCodecContext^.height); - {$ENDIF} if (errnum < 0) then begin diff --git a/src/media/UVisualizer.pas b/src/media/UVisualizer.pas index de20c468..c84bff15 100644 --- a/src/media/UVisualizer.pas +++ b/src/media/UVisualizer.pas @@ -103,9 +103,9 @@ TVideo_ProjectM = class( TInterfacedObject, IVideo ) fState: TProjectMState; - fScreen: integer; + // fScreen: integer; - fVisualTex: GLuint; + // fVisualTex: GLuint; fPCMData: TPCMData; fRndPCMcount: integer; @@ -379,6 +379,8 @@ function TVideo_ProjectM.GetMatrixStackDepth(MatrixMode: GLenum): GLint; glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, @Result); GL_TEXTURE: glGetIntegerv(GL_TEXTURE_STACK_DEPTH, @Result); + else + Result := 0 end; end; diff --git a/src/menu/UDisplay.pas b/src/menu/UDisplay.pas index 9145b3b8..2dc109b6 100644 --- a/src/menu/UDisplay.pas +++ b/src/menu/UDisplay.pas @@ -574,6 +574,7 @@ procedure TDisplay.DrawCursor; Ticks: cardinal; DrawX: double; begin + Alpha := 0; if (Ini.Mouse = 2) and ((Screens = 1) or ((ScreenAct - 1) = (Round(Cursor_X+16) div RenderW))) then begin // draw software cursor Ticks := SDL_GetTicks; @@ -662,27 +663,26 @@ function TDisplay.ShouldHandleInput(PressedKey: cardinal; CharCode: UCS4Char; Pr function TDisplay.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown : boolean): boolean; begin - if Console_Draw and ConsoleParseInput(PressedKey, CharCode, PressedDown) then Exit; + Result := true; + if Console_Draw and ConsoleParseInput(PressedKey, CharCode, PressedDown) then + Exit; if (assigned(NextScreen)) then Result := NextScreen^.ParseInput(PressedKey, CharCode, PressedDown) else if (assigned(CurrentScreen)) then Result := CurrentScreen^.ParseInput(PressedKey, CharCode, PressedDown) - else - Result := True; end; function TDisplay.ParseMouse(MouseButton: integer; BtnDown: boolean; X, Y: integer): boolean; begin - if Console_Draw and ConsoleParseMouse(MouseButton, BtnDown, X, Y) then Exit; + Result := true; + if Console_Draw and ConsoleParseMouse(MouseButton, BtnDown, X, Y) then + Exit; if (assigned(NextScreen)) then Result := NextScreen^.ParseMouse(MouseButton, BtnDown, X, Y) - else - if (assigned(CurrentScreen)) then + else if (assigned(CurrentScreen)) then Result := CurrentScreen^.ParseMouse(MouseButton, BtnDown, X, Y) - else - Result := True; end; { abort fading to the next screen, may be used in OnShow, or during fade process } @@ -893,7 +893,7 @@ procedure TDisplay.DrawDebugConsole; var I, LineCount: integer; YOffset, ScaleF, FontSize: real; - PosX, PosY: real; + PosY: real; W, H: real; ScrollPad, ScrollW: real; OldStretch: real; diff --git a/src/menu/UMenu.pas b/src/menu/UMenu.pas index 07a58cce..11fa649b 100644 --- a/src/menu/UMenu.pas +++ b/src/menu/UMenu.pas @@ -304,13 +304,23 @@ procedure TMenu.SetInteraction(Num: integer); // set inactive if(Interaction > -1) then begin - OldNum := Interactions[Interaction].Num; - OldTyp := Interactions[Interaction].Typ; + OldNum := Interactions[Interaction].Num; + OldTyp := Interactions[Interaction].Typ; + end + else + begin + OldNum := 0; + OldTyp := 0; end; if(Num > -1) then begin NewNum := Interactions[Num].Num; NewTyp := Interactions[Num].Typ; + end + else + begin + NewNum := 0; + NewTyp := 0; end; if(Interaction > -1) then begin @@ -1388,7 +1398,7 @@ function TMenu.AddSelectSlide(X, Y, W, H, SkipX, SBGW, ColR, ColG, ColB, Int, DC const Caption: UTF8String; var Data: integer): integer; var S: integer; - I: integer; + // I: integer; begin S := Length(SelectsS); SetLength(SelectsS, S + 1); @@ -1833,7 +1843,7 @@ function TMenu.InRegionY(Y: real; A: TMouseOverRect): boolean; //of the control at this position function TMenu.InteractAt(X, Y: real): integer; var - i, nBut: integer; + i: integer; begin Result := -1; for i := Low(Interactions) to High(Interactions) do @@ -1865,7 +1875,7 @@ function TMenu.InteractAt(X, Y: real): integer; //takes x,y coordinates and returns the button collection id function TMenu.CollectionAt(X, Y: real): integer; var - i, nBut: integer; + i: integer; begin Result := -1; for i:= Low(ButtonCollection) to High(ButtonCollection) do diff --git a/src/menu/UMenuButton.pas b/src/menu/UMenuButton.pas index f585dd46..51fed694 100644 --- a/src/menu/UMenuButton.pas +++ b/src/menu/UMenuButton.pas @@ -266,7 +266,7 @@ procedure TButton.Draw; T: integer; Tick: cardinal; Spacing: real; - x1, x2, x3, x4, y1, y2, y3, y4: real; + y1, y2, y3, y4: real; begin if Visible then begin @@ -581,6 +581,10 @@ procedure TButton.Draw; function TButton.GetMouseOverArea: TMouseOverRect; begin + Result.X := 0; + Result.Y := 0; + Result.W := 0; + Result.H := 0; if not(Display.Cursor_HiddenByScreen) then begin if (FadeTex.TexNum = 0) then diff --git a/src/menu/UMenuStatic.pas b/src/menu/UMenuStatic.pas index 88d7dd19..c10d76ff 100644 --- a/src/menu/UMenuStatic.pas +++ b/src/menu/UMenuStatic.pas @@ -126,6 +126,13 @@ function TStatic.GetMouseOverArea: TMouseOverRect; Result.Y := Texture.Y; Result.W := Texture.W; Result.H := Texture.H; + end + else + begin + Result.X := 0; + Result.Y := 0; + Result.W := 0; + Result.H := 0; end; end; diff --git a/src/menu/UMenuText.pas b/src/menu/UMenuText.pas index 1e91a460..21bdaa57 100644 --- a/src/menu/UMenuText.pas +++ b/src/menu/UMenuText.pas @@ -266,15 +266,16 @@ procedure TText.DeleteLastLetter; procedure TText.Draw; var X2, Y2: real; - tmpText2, Text2: UTF8String; I: integer; Ticks: cardinal; begin if Visible then begin - SetFontStyle(Style); - SetFontSize(Size); - SetFontItalic(false); + TextGL.SetFontStyle(Style); + TextGL.SetFontSize(Size); + TextGL.SetFontItalic(false); + TextGL.SetFontZ(Self.Z); + // TextGL.SetOutlineAlpha(Alpha); TODO don't work with japanese and chinese characters glColor4f(ColR*Int, ColG*Int, ColB*Int, Alpha); @@ -295,67 +296,13 @@ procedure TText.Draw; end; end; - {if (false) then // no width set draw as one long string + Y2 := Self.Y + Self.MoveY; + X2 := Self.X + Self.MoveX; + for I := 0 to High(Self.TextTiles) do begin - if not (SelectBool AND SelectBlink) then - Text2 := Text - else - Text2 := Text + '|'; - - case Align of - 0: X2 := X; - 1: X2 := X - glTextWidth(Text2)/2; - 2: X2 := X - glTextWidth(Text2); - end; - - SetFontPos(X2, Y); - glPrint(Text2); - SetFontStyle(ftNormal); // reset to default - end - else - begin} - // now use always: - // draw text as many strings - Y2 := Y + MoveY; - for I := 0 to High(TextTiles) do - begin - tmpText2 := TextTiles[I]; - - if (not (SelectBool and SelectBlink)) or (I <> High(TextTiles)) then - begin - Text2 := TextTiles[I]; - end - else - begin - if (Writable) then - Text2 := TextTiles[I] + '|' - else - Text2 := TextTiles[I]; - end; - - case Align of - 1: X2 := X + MoveX - glTextWidth(tmpText2)/2; { centered } - 2: X2 := X + MoveX - glTextWidth(tmpText2); { right aligned } - else X2 := X + MoveX; { left aligned (default) } - end; - - SetFontPos(X2, Y2); - - SetFontZ(Z); - - glPrint(Text2); - - {if Size >= 10 then - Y2 := Y2 + Size * 0.93 - else} - if (Style = ftBold) then - Y2 := Y2 + Size * 0.93 - else - Y2 := Y2 + Size * 0.72; - end; - SetFontStyle(ftNormal); // reset to default - - //end; + TextGL.SetFontPos(IFThen(Self.Align = 0, X2, X2 - glTextWidth(Self.TextTiles[I]) / (2 / Self.Align)), Y2, I); //Self.Align 0 left, 1 centered, 2 right + TextGL.glPrint(Self.TextTiles[I]+IfThen(Self.SelectBool and Self.Writable and Self.SelectBlink, '|', '')); + end; end; end; @@ -401,9 +348,11 @@ constructor TText.Create(ParX, ParY, ParW: real; end; function TText.GetMouseOverArea: TMouseOverRect; -var - W1: real; begin + Result.X := 0; + Result.Y := 0; + Result.W := 0; + Result.H := 0; if not(Display.Cursor_HiddenByScreen) then begin if (Align = 0) then diff --git a/src/screens/UScreenJukebox.pas b/src/screens/UScreenJukebox.pas index ffb7a5bd..e5191eed 100644 --- a/src/screens/UScreenJukebox.pas +++ b/src/screens/UScreenJukebox.pas @@ -131,8 +131,6 @@ TScreenJukebox = class(TMenu) JukeboxTextTimeText: integer; //JukeboxTextSongText: integer; - SongFinish: boolean; - //tmp_mouse: integer; JukeboxFindSong: integer; @@ -428,6 +426,7 @@ procedure TScreenJukebox.Sort(Order: integer); 3 : Comp := UTF8CompareText(CatSongs.Song[X].Edition, CatSongs.Song[JukeboxVisibleSongs[J - 1]].Edition); 4 : Comp := UTF8CompareText(CatSongs.Song[X].Genre, CatSongs.Song[JukeboxVisibleSongs[J - 1]].Genre); 5 : Comp := UTF8CompareText(CatSongs.Song[X].Language, CatSongs.Song[JukeboxVisibleSongs[J - 1]].Language); + else Comp := 0; end; if (Comp < 0) then @@ -490,6 +489,7 @@ procedure TScreenJukebox.DeleteSong(Id: integer); TailElements: Cardinal; IndexVisibleSongs, IndexSongList, I: integer; begin + IndexSongList := 0; IndexVisibleSongs := Id; for I := 0 to High(JukeboxSongsList) do @@ -2327,7 +2327,6 @@ procedure TScreenJukebox.PlayMusic(ID: integer; ShowList: boolean); Index: integer; VideoFile, BgFile: IPath; Max: integer; - CoverPath: IPath; begin // background texture (garbage disposal) @@ -2539,7 +2538,7 @@ procedure TScreenJukebox.DrawPlaylist; I, Max: integer; SongDesc, Artist, Title, TimeString: UTF8String; CurrentTick: integer; - Time: real; + // Time: real; begin CurrentTick := SDL_GetTicks() - LastTick; @@ -2609,6 +2608,7 @@ procedure TScreenJukebox.DrawPlaylist; TimeString := IntToStr(Round(Time) div 60) + ':' + Format('%.*d', [2, Round(Time) mod 60]); } + TimeString := ''; end else begin @@ -2666,20 +2666,13 @@ procedure TScreenJukebox.DrawPlaylist; end; procedure TScreenJukebox.DrawSongMenu; -var - I, Max: integer; - CurrentTick: integer; begin - CurrentTick := SDL_GetTicks() - LastSongMenuTick; - - if (CurrentTick < MAX_TIME_SONGMENU) then + if (SDL_GetTicks() - LastSongMenuTick < MAX_TIME_SONGMENU) then begin Statics[JukeboxStaticSongMenuTimeBackground].Draw; Statics[JukeboxStaticSongMenuTimeProgress].Draw; Statics[JukeboxStaticSongMenuBackground].Draw; - Text[JukeboxTextSongMenuTimeText].Draw; - Button[JukeboxSongMenuPlaylist].Draw; Button[JukeboxSongMenuOptions].Draw; Button[JukeboxSongMenuNext].Draw; diff --git a/src/screens/UScreenJukeboxOptions.pas b/src/screens/UScreenJukeboxOptions.pas index 69b5d8e8..e25d6451 100644 --- a/src/screens/UScreenJukeboxOptions.pas +++ b/src/screens/UScreenJukeboxOptions.pas @@ -100,8 +100,6 @@ function TScreenJukeboxOptions.ParseMouse(MouseButton: integer; BtnDown: boolean end; function TScreenJukeboxOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; -var - LeftPressedKey: boolean; begin Result := true; @@ -135,6 +133,7 @@ function TScreenJukeboxOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch // close if Self.Interaction = 11 then begin + UIni.Ini.Save(); Visible := false; ScreenJukebox.CloseClickTime := SDL_GetTicks; Exit; diff --git a/src/screens/UScreenMain.pas b/src/screens/UScreenMain.pas index 5a59e8eb..4bd100e9 100644 --- a/src/screens/UScreenMain.pas +++ b/src/screens/UScreenMain.pas @@ -49,9 +49,11 @@ TScreenMain = class(TMenu) function ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; function Draw: boolean; override; procedure OnShow; override; + procedure ReloadSongs(ScreenReturn: boolean = true); procedure SetInteraction(Num: integer); override; procedure SetAnimationProgress(Progress: real); override; private + ReturnToSongScreenAfterLoadSongs: boolean; TextDescription, TextDescriptionLong, TextProgressSongs: integer; function CheckSongs(): boolean; end; @@ -66,7 +68,7 @@ implementation USongs, ULanguage, UParty, - UScreenPlayerSelection, + UScreenPlayerSelector, UScreenSong, UScreenPartyOptions, UScreenJukeboxPlaylist, @@ -79,6 +81,8 @@ implementation ITEMS_PER_ROW = 3; // Number of buttons for row of buttons in Main menu. function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; +var + Screen: PMenu; begin Result := true; if (PressedDown) then @@ -103,38 +107,25 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; Presse //reset Party.bPartyGame := false; + Screen := nil; case Interaction of 0: //solo begin - if Self.CheckSongs then + if Self.CheckSongs() then begin - UGraphic.ScreenSong.Mode := smNormal; - if (Ini.Players >= 0) and (Ini.Players <= 3) then - UNote.PlayersPlay := Ini.Players + 1; - if (Ini.Players = 4) then - UNote.PlayersPlay := 6; - - if Ini.OnSongClick = sSelectPlayer then - FadeTo(@ScreenSong) - else - begin - if not Assigned(UGraphic.ScreenPlayerSelector) then - UGraphic.ScreenPlayerSelector := TScreenPlayerSelector.Create(); - - UGraphic.ScreenPlayerSelector.Goto_SingScreen := false; - FadeTo(@UGraphic.ScreenPlayerSelector, SoundLib.Start); - end; + UGraphic.ScreenSong.Mode := smNormal; + Screen := @UGraphic.ScreenSong; end; end; 1: //party begin - if Self.CheckSongs then + if Self.CheckSongs() then begin if not Assigned(UGraphic.ScreenPartyOptions) then //load the screens only the first time UGraphic.ScreenPartyOptions := TScreenPartyOptions.Create(); Party.bPartyGame := true; - FadeTo(@ScreenPartyOptions, SoundLib.Start); + Screen := @UGraphic.ScreenPartyOptions; end end; 2: //jukebox @@ -142,23 +133,23 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; Presse if not Assigned(UGraphic.ScreenJukeboxPlaylist) then //load the screens only the first time UGraphic.ScreenJukeboxPlaylist := TScreenJukeboxPlaylist.Create(); - if Self.CheckSongs then - FadeTo(@ScreenJukeboxPlaylist, SoundLib.Start); + if Self.CheckSongs() then + Screen := @UGraphic.ScreenJukeboxPlaylist; end; 3: //stats begin if not Assigned(UGraphic.ScreenStatMain) then //load the screens only the first time UGraphic.ScreenStatMain := TScreenStatMain.Create(); - if Self.CheckSongs then - FadeTo(@ScreenStatMain, SoundLib.Start); + if Self.CheckSongs() then + Screen := @UGraphic.ScreenStatMain; end; 4: //options begin if not Assigned(UGraphic.ScreenOptions) then //load the screens only the first time UGraphic.ScreenOptions := TScreenOptions.Create(); - FadeTo(@UGraphic.ScreenOptions, SoundLib.Start); + Screen := @UGraphic.ScreenOptions; end; 5: //exit Result := false; @@ -167,9 +158,11 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; Presse if not Assigned(UGraphic.ScreenAbout) then //load the screens only the first time UGraphic.ScreenAbout := TScreenAbout.Create(); - FadeTo(@ScreenAbout, SoundLib.Start); + Screen := @UGraphic.ScreenAbout; end; end; + if Result and Assigned(Screen) then + Self.FadeTo(Screen, UMusic.SoundLib.Start); end; SDLK_DOWN: InteractMainNextRow(ITEMS_PER_ROW); @@ -179,6 +172,8 @@ function TScreenMain.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; Presse InteractNext; SDLK_LEFT: InteractPrev; + SDLK_F5: + Self.ReloadSongs(); end; end end; @@ -210,6 +205,7 @@ constructor TScreenMain.Create(); AddButton(Theme.Main.ButtonAbout); Interaction := 0; + Self.ReturnToSongScreenAfterLoadSongs := false; end; function TScreenMain.Draw: boolean; @@ -220,15 +216,22 @@ function TScreenMain.Draw: boolean; Result := true; ProgressSong := USongs.Songs.GetLoadProgress(); if not ProgressSong.Finished then //while song loading show progress + Self.Text[Self.TextProgressSongs].Text := ProgressSong.Folder+': '+IntToStr(ProgressSong.Total)+'\n\n'+ProgressSong.FolderProcessed + else if not Self.Text[Self.TextDescriptionLong].Visible then //after finish song loading, return to normal mode and close popup begin - Self.Text[TextDescriptionLong].Visible := false; - Self.Text[TextProgressSongs].Text := ProgressSong.Folder+': '+IntToStr(ProgressSong.Total)+'\n\n'+ProgressSong.FolderProcessed; - end - else if Self.Text[TextDescriptionLong].Visible = false then //after finish song loading, return to normal mode and close popup - begin + FreeAndNil(UGraphic.ScreenSong); UGraphic.ScreenSong := TScreenSong.Create(); - Self.Text[TextDescriptionLong].Visible := true; - Self.Text[TextProgressSongs].Visible := false; + if Self.ReturnToSongScreenAfterLoadSongs then + begin + Self.ReturnToSongScreenAfterLoadSongs := false; + if Self.CheckSongs() then + begin + UDisplay.Display.AbortScreenChange(); + Self.FadeTo(@UGraphic.ScreenSong); + end; + end; + Self.Text[Self.TextDescriptionLong].Visible := true; + Self.Text[Self.TextProgressSongs].Visible := false; if ProgressSong.Total > 0 then UGraphic.ScreenPopupError.Visible := false; end; @@ -237,7 +240,8 @@ function TScreenMain.Draw: boolean; procedure TScreenMain.OnShow; begin inherited; - + Self.Text[Self.TextProgressSongs].Visible := true; + Self.Text[Self.TextDescriptionLong].Visible := false; SoundLib.StartBgMusic; {** @@ -272,4 +276,14 @@ function TScreenMain.CheckSongs(): boolean; Result := true; end; +procedure TScreenMain.ReloadSongs(ScreenReturn: boolean = true); +begin + UIni.Ini.Load(); + FreeAndNil(USongs.CatSongs); + FreeAndNil(USongs.Songs); + USongs.CatSongs := TCatSongs.Create(); + USongs.Songs := TSongs.Create(); + Self.ReturnToSongScreenAfterLoadSongs := ScreenReturn; +end; + end. diff --git a/src/screens/UScreenOptions.pas b/src/screens/UScreenOptions.pas index 21f7474f..f7b3a159 100644 --- a/src/screens/UScreenOptions.pas +++ b/src/screens/UScreenOptions.pas @@ -45,24 +45,10 @@ interface type TScreenOptions = class(TMenu) private - ButtonGameIID, - ButtonGraphicsIID, - ButtonSoundIID, - ButtonInputIID, - ButtonLyricsIID, - ButtonThemesIID, - ButtonMicrophonesIID, - ButtonAdvancedIID, - ButtonNetworkIID, - ButtonWebcamIID, - ButtonExitIID: cardinal; - MapIIDtoDescID: array of integer; - procedure UpdateTextDescriptionFor(IID: integer); virtual; - public - TextDescription: integer; + TextDescription: integer; constructor Create; override; function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; procedure OnShow; override; @@ -85,10 +71,13 @@ implementation UScreenOptionsAdvanced, UScreenOptionsNetwork, UScreenOptionsWebcam, + UScreenPlayerSelector, UWebcam, UUnicodeUtils; function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; +var + Screen: PMenu; begin Result := true; if (PressedDown) then @@ -106,94 +95,90 @@ function TScreenOptions.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre case PressedKey of SDLK_ESCAPE, SDLK_BACKSPACE: - begin - Ini.Save; - AudioPlayback.PlaySound(SoundLib.Back); - FadeTo(@ScreenMain); - end; + Self.FadeTo(@UGraphic.ScreenMain, UMusic.SoundLib.Back); SDLK_RETURN: - begin - if Interaction = ButtonGameIID then - begin - if not Assigned(UGraphic.ScreenOptionsGame) then - UGraphic.ScreenOptionsGame := TScreenOptionsGame.Create(); - - AudioPlayback.PlaySound(SoundLib.Start); - FadeTo(@ScreenOptionsGame); - end - else if Interaction = ButtonGraphicsIID then - begin - if not Assigned(UGraphic.ScreenOptionsGraphics) then - UGraphic.ScreenOptionsGraphics := TScreenOptionsGraphics.Create(); - - AudioPlayback.PlaySound(SoundLib.Start); - FadeTo(@ScreenOptionsGraphics); - end - else if Interaction = ButtonSoundIID then - begin - if not Assigned(UGraphic.ScreenOptionsSound) then - UGraphic.ScreenOptionsSound := TScreenOptionsSound.Create(); - - AudioPlayback.PlaySound(SoundLib.Start); - FadeTo(@ScreenOptionsSound); - end - else if Interaction = ButtonLyricsIID then begin - if not Assigned(UGraphic.ScreenOptionsLyrics) then - UGraphic.ScreenOptionsLyrics := TScreenOptionsLyrics.Create(); - - AudioPlayback.PlaySound(SoundLib.Start); - FadeTo(@ScreenOptionsLyrics); - end - else if Interaction = ButtonThemesIID then - begin - if not Assigned(UGraphic.ScreenOptionsThemes) then - UGraphic.ScreenOptionsThemes := TScreenOptionsThemes.Create(); - - AudioPlayback.PlaySound(SoundLib.Start); - FadeTo(@ScreenOptionsThemes); - end - else if Interaction = ButtonMicrophonesIID then - begin - if not Assigned(UGraphic.ScreenOptionsMicrophones) then - UGraphic.ScreenOptionsMicrophones := TScreenOptionsMicrophones.Create(); - - AudioPlayback.PlaySound(SoundLib.Start); - FadeTo(@ScreenOptionsMicrophones); - end - else if Interaction = ButtonAdvancedIID then - begin - if not Assigned(UGraphic.ScreenOptionsAdvanced) then - UGraphic.ScreenOptionsAdvanced := TScreenOptionsAdvanced.Create(); - - AudioPlayback.PlaySound(SoundLib.Start); - FadeTo(@ScreenOptionsAdvanced); - end - else if Interaction = ButtonNetworkIID then - if High(DataBase.NetworkUser) = -1 then - UGraphic.ScreenPopupError.ShowPopup(ULanguage.Language.Translate('SING_OPTIONS_NETWORK_NO_DLL')) - else - begin - if not Assigned(UGraphic.ScreenOptionsNetwork) then - UGraphic.ScreenOptionsNetwork := TScreenOptionsNetwork.Create(); - - AudioPlayback.PlaySound(SoundLib.Back); - FadeTo(@ScreenOptionsNetwork); - end - else if Interaction = ButtonWebcamIID then - begin - if not Assigned(UGraphic.ScreenOptionsWebcam) then - UGraphic.ScreenOptionsWebcam := TScreenOptionsWebcam.Create(); - - AudioPlayback.PlaySound(SoundLib.Back); - FadeTo(@ScreenOptionsWebcam); - end - else if Interaction = ButtonExitIID then - begin - Ini.Save; - AudioPlayback.PlaySound(SoundLib.Back); - FadeTo(@ScreenMain); - end; + Screen := nil; + case Self.Interaction of + 0: + Self.FadeTo(@UGraphic.ScreenMain, UMusic.SoundLib.Back); + 1: + begin + if not Assigned(UGraphic.ScreenOptionsGame) then + UGraphic.ScreenOptionsGame := TScreenOptionsGame.Create(); + + Screen := @UGraphic.ScreenOptionsGame; + end; + 2: + begin + if not Assigned(UGraphic.ScreenOptionsGraphics) then + UGraphic.ScreenOptionsGraphics := TScreenOptionsGraphics.Create(); + + Screen := @UGraphic.ScreenOptionsGraphics; + end; + 3: + begin + if not Assigned(UGraphic.ScreenOptionsSound) then + UGraphic.ScreenOptionsSound := TScreenOptionsSound.Create(); + + Screen := @UGraphic.ScreenOptionsSound; + end; + 4: + begin + if not Assigned(UGraphic.ScreenOptionsLyrics) then + UGraphic.ScreenOptionsLyrics := TScreenOptionsLyrics.Create(); + + Screen := @UGraphic.ScreenOptionsLyrics; + end; + 5: + begin + if not Assigned(UGraphic.ScreenOptionsThemes) then + UGraphic.ScreenOptionsThemes := TScreenOptionsThemes.Create(); + + Screen := @UGraphic.ScreenOptionsThemes; + end; + 6: + begin + if not Assigned(UGraphic.ScreenOptionsMicrophones) then + UGraphic.ScreenOptionsMicrophones := TScreenOptionsMicrophones.Create(); + + Screen := @UGraphic.ScreenOptionsMicrophones; + end; + 7: + begin + if not Assigned(UGraphic.ScreenOptionsAdvanced) then + UGraphic.ScreenOptionsAdvanced := TScreenOptionsAdvanced.Create(); + + Screen := @UGraphic.ScreenOptionsAdvanced; + end; + 8: + if High(DataBase.NetworkUser) = -1 then + UGraphic.ScreenPopupError.ShowPopup(ULanguage.Language.Translate('SING_OPTIONS_NETWORK_NO_DLL')) + else + begin + if not Assigned(UGraphic.ScreenOptionsNetwork) then + UGraphic.ScreenOptionsNetwork := TScreenOptionsNetwork.Create(); + + Screen := @UGraphic.ScreenOptionsNetwork; + end; + 9: + begin + if not Assigned(UGraphic.ScreenOptionsWebcam) then + UGraphic.ScreenOptionsWebcam := TScreenOptionsWebcam.Create(); + + Screen := @UGraphic.ScreenOptionsWebcam; + end; + 10: + begin + if not Assigned(UGraphic.ScreenPlayerSelector) then + UGraphic.ScreenPlayerSelector := TScreenPlayerSelector.Create(); + + UGraphic.ScreenPlayerSelector.OpenedInOptions := true; + Screen := @UGraphic.ScreenPlayerSelector; + end; + end; + if Assigned(Screen) then + Self.FadeTo(Screen, UMusic.SoundLib.Start); end; SDLK_DOWN: InteractNextRow; SDLK_UP: InteractPrevRow; @@ -212,16 +197,17 @@ constructor TScreenOptions.Create; LoadFromTheme(Theme.Options); - Self.ButtonGameIID := Self.AddButton(Theme.Options.ButtonGame); - Self.ButtonGraphicsIID := Self.AddButton(Theme.Options.ButtonGraphics); - Self.ButtonSoundIID := Self.AddButton(Theme.Options.ButtonSound); - Self.ButtonLyricsIID := Self.AddButton(Theme.Options.ButtonLyrics); - Self.ButtonThemesIID := Self.AddButton(Theme.Options.ButtonThemes); - Self.ButtonMicrophonesIID := Self.AddButton(Theme.Options.ButtonMicrophones); - Self.ButtonAdvancedIID := Self.AddButton(Theme.Options.ButtonAdvanced); - Self.ButtonNetworkIID := Self.AddButton(Theme.Options.ButtonNetwork); - Self.ButtonWebcamIID := Self.AddButton(Theme.Options.ButtonWebcam); - Self.ButtonExitIID := Self.AddButton(Theme.Options.ButtonExit); + Self.AddButton(UThemes.Theme.Options.ButtonExit); + Self.AddButton(UThemes.Theme.Options.ButtonGame); + Self.AddButton(UThemes.Theme.Options.ButtonGraphics); + Self.AddButton(UThemes.Theme.Options.ButtonSound); + Self.AddButton(UThemes.Theme.Options.ButtonLyrics); + Self.AddButton(UThemes.Theme.Options.ButtonThemes); + Self.AddButton(UThemes.Theme.Options.ButtonMicrophones); + Self.AddButton(UThemes.Theme.Options.ButtonAdvanced); + Self.AddButton(UThemes.Theme.Options.ButtonNetwork); + Self.AddButton(UThemes.Theme.Options.ButtonWebcam); + Self.AddButton(UThemes.Theme.Options.ButtonProfiles); Self.Interaction := 0; end; @@ -248,8 +234,6 @@ procedure TScreenOptions.SetAnimationProgress(Progress: real); end; procedure TScreenOptions.UpdateTextDescriptionFor(IID: integer); -var - index: integer; begin // Sanity check if (IID < 0) or (IID >= Length(MapIIDtoDescID)) then diff --git a/src/screens/UScreenOptionsGame.pas b/src/screens/UScreenOptionsGame.pas index 16db1e74..066fe00f 100644 --- a/src/screens/UScreenOptionsGame.pas +++ b/src/screens/UScreenOptionsGame.pas @@ -37,7 +37,7 @@ interface type TScreenOptionsGame = class(TMenu) private - Language, SongMenu: integer; + Language, SongMenu: integer; static; procedure ReloadScreen(); procedure ReloadScreens(); protected @@ -96,9 +96,7 @@ function TScreenOptionsGame.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; if Self.SelInteraction = 6 then //rebuild songs arrays with new config begin UIni.Ini.Save(); - FreeAndNil(UGraphic.ScreenSong); - USongs.CatSongs := TCatSongs.Create(); - USongs.Songs := TSongs.Create(); + UGraphic.ScreenMain.ReloadSongs(false); end; AudioPlayback.PlaySound(SoundLib.Option); @@ -141,7 +139,7 @@ procedure TScreenOptionsGame.OnShow; // Reload all screens, after Language changed or screen song after songmenu, sorting or tabs changed procedure TScreenOptionsGame.ReloadScreens(); begin - UIni.Ini.Save; + UIni.Ini.Save(); if (Self.SongMenu <> UIni.Ini.SongMenu) then begin UThemes.Theme.ThemeSongLoad(); @@ -166,16 +164,16 @@ procedure TScreenOptionsGame.ReloadScreens(); procedure TScreenOptionsGame.ReloadScreen(); begin - ULanguage.Language.ChangeLanguage(ILanguage[Ini.Language]); + ULanguage.Language.ChangeLanguage(ILanguage[UIni.Ini.Language]); UThemes.Theme.OptionsGame.SelectLanguage.Text := ULanguage.Language.Translate('SING_OPTIONS_GAME_LANGUAGE'); UThemes.Theme.OptionsGame.SelectSongMenu.Text := ULanguage.Language.Translate('SING_OPTIONS_GAME_SONGMENU'); UThemes.Theme.OptionsGame.SelectDuets.Text := ULanguage.Language.Translate('SING_OPTIONS_GAME_DUETS'); UThemes.Theme.OptionsGame.SelectTabs.Text := ULanguage.Language.Translate('SING_OPTIONS_GAME_TABS'); UThemes.Theme.OptionsGame.SelectSorting.Text := ULanguage.Language.Translate('SING_OPTIONS_GAME_SORTING'); UThemes.Theme.OptionsGame.SelectShowScores.Text := ULanguage.Language.Translate('SING_OPTIONS_GAME_SHOWSCORES'); - UThemes.Theme.OptionsGame.SelectFindUnsetMedley.Text := ULanguage.Language.Translate('SING_SONG_SELECTION_LEGEND_MEDLEYC'); + UThemes.Theme.OptionsGame.SelectFindUnsetMedley.Text := ULanguage.Language.Translate('C_MEDLEYC'); UThemes.Theme.OptionsGame.SelectJoypad.Text := ULanguage.Language.Translate('SING_OPTIONS_GAME_JOYPAD_SUPPORT'); - UThemes.Theme.OptionsGame.ButtonExit.Text[0].Text := ULanguage.Language.Translate('SING_OPTIONS_EXIT'); + UThemes.Theme.OptionsGame.ButtonExit.Text[0].Text := ULanguage.Language.Translate('C_BACK'); UGraphic.ScreenOptionsGame.Free(); UGraphic.ScreenOptionsGame := TScreenOptionsGame.Create(); end; diff --git a/src/screens/UScreenOptionsGraphics.pas b/src/screens/UScreenOptionsGraphics.pas index 7c75365d..62912bf5 100644 --- a/src/screens/UScreenOptionsGraphics.pas +++ b/src/screens/UScreenOptionsGraphics.pas @@ -84,25 +84,11 @@ function TScreenOptionsGraphics.ParseInput(PressedKey: cardinal; CharCode: UCS4C // check special keys case PressedKey of SDLK_ESCAPE, - SDLK_BACKSPACE : - begin - UIni.Ini.Save; - AudioPlayback.PlaySound(SoundLib.Back); - FadeTo(@ScreenOptions); - end; + SDLK_BACKSPACE: + Self.FadeTo(@UGraphic.ScreenOptions, UMusic.SoundLib.Back); SDLK_RETURN: - begin - if SelInteraction = 6 then - begin - UIni.Ini.Save; - AudioPlayback.PlaySound(SoundLib.Back); - - if OldWindowMode <> UIni.Ini.FullScreen then UGraphic.UpdateVideoMode() - else UGraphic.UpdateResolution(); - - FadeTo(@ScreenOptions); - end; - end; + if Self.SelInteraction = 6 then + Self.FadeTo(@UGraphic.ScreenOptions, UMusic.SoundLib.Back); SDLK_DOWN: InteractNext; SDLK_UP : @@ -173,6 +159,11 @@ procedure TScreenOptionsGraphics.OnHide; begin inherited; UIni.Ini.ClearCustomResolutions(); + UIni.Ini.Save(); + if Self.OldWindowMode <> UIni.Ini.FullScreen then + UGraphic.UpdateVideoMode() + else + UGraphic.UpdateResolution(); end; procedure TScreenOptionsGraphics.OnWindowResized; diff --git a/src/screens/UScreenOptionsLyrics.pas b/src/screens/UScreenOptionsLyrics.pas index d8c93e2b..625ece17 100644 --- a/src/screens/UScreenOptionsLyrics.pas +++ b/src/screens/UScreenOptionsLyrics.pas @@ -93,7 +93,7 @@ constructor TScreenOptionsLyrics.Create(); Self.AddSelectSlide(UThemes.Theme.OptionsLyrics.SelectTransparency, Self.SelectTransparency, UIni.ILyricsAlpha); Self.AddSelectSlide(UThemes.Theme.OptionsLyrics.SelectLines, Self.SelectLines, UIni.ILine, 'OPTION_VALUE_'); Self.AddSelectSlide(UThemes.Theme.OptionsLyrics.SelectProperty, Self.SelectProperty, UIni.IProperty, 'OPTION_VALUE_'); - Self.AddSelectSlide(UThemes.Theme.OptionsLyrics.SelectColor, Self.SelectColor, UIni.LineColor, 'OPTION_VALUE_'); + Self.AddSelectSlide(UThemes.Theme.OptionsLyrics.SelectColor, Self.SelectColor, UIni.LineColor, 'C_COLOR_'); Self.AddSelectSlide(UThemes.Theme.OptionsLyrics.SelectR, Self.Red, IRed); Self.AddSelectSlide(UThemes.Theme.OptionsLyrics.SelectG, Self.Green, IGreen); Self.AddSelectSlide(UThemes.Theme.OptionsLyrics.SelectB, Self.Blue, IBlue); @@ -128,7 +128,7 @@ constructor TScreenOptionsLyrics.Create(); function TScreenOptionsLyrics.Draw(): boolean; begin Result := inherited Draw(); - Self.Lyrics.Draw(13); //to see effects in the second note in slide mode too + Self.Lyrics.Draw(11); //to see effects in the second note in slide mode too end; procedure TScreenOptionsLyrics.OnShow(); @@ -295,7 +295,7 @@ procedure TScreenOptionsLyrics.SetColor(); 0: //sing begin Self.SelectColor := Self.GetColorPosition(UIni.IHexSingColor, Self.SingColor); - Self.UpdateSelectSlideOptions(UThemes.Theme.OptionsLyrics.SelectColor, 6, UIni.LineColor, Self.SelectColor, 'OPTION_VALUE_'); + Self.UpdateSelectSlideOptions(UThemes.Theme.OptionsLyrics.SelectColor, 6, UIni.LineColor, Self.SelectColor, 'C_COLOR_'); end; 1: //upper begin @@ -315,7 +315,7 @@ procedure TScreenOptionsLyrics.SetColor(); 1: Self.SelectColor := Self.GetColorPosition(UIni.IHexOColor, Self.CurrentOutlineColor); 2: Self.SelectColor := Self.GetColorPosition(UIni.IHexOColor, Self.NextOutlineColor); end; - Self.UpdateSelectSlideOptions(UThemes.Theme.OptionsLyrics.SelectColor, 6, UIni.OutlineColor, Self.SelectColor, 'OPTION_VALUE_'); + Self.UpdateSelectSlideOptions(UThemes.Theme.OptionsLyrics.SelectColor, 6, UIni.OutlineColor, Self.SelectColor, 'C_COLOR_'); end; end; @@ -363,6 +363,7 @@ procedure TScreenOptionsLyrics.SetValues(); begin Self.Lyrics.SetProperties(Self.SelectMode = 1); Self.SelectsS[5].Visible := Self.SelectFont <> 0; + HexColor := ''; if Self.SelectProperty = 0 then //fill case Self.SelectLines of 0: HexColor := Self.SingColor; diff --git a/src/screens/UScreenOptionsProfiles.pas b/src/screens/UScreenOptionsProfiles.pas new file mode 100644 index 00000000..4064c194 --- /dev/null +++ b/src/screens/UScreenOptionsProfiles.pas @@ -0,0 +1,129 @@ +{* + UltraStar WorldParty - Karaoke Game + + UltraStar WorldParty is the legal property of its developers, + whose names are too numerous to list here. Please refer to the + COPYRIGHT file distributed with this source distribution. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. Check "LICENSE" file. If not, see + . + *} + + +unit UScreenOptionsProfiles; + +interface + +{$MODE OBJFPC} + +{$I switches.inc} + +uses + UCommon, + sdl2, + UMenu, + UDisplay, + UMusic, + UFiles, + UIni, + UThemes; + +type + + TScreenOptionsProfiles = class(TMenu) + public + constructor Create; override; + function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; + procedure OnShow; override; + end; + +implementation + +uses + UGraphic, + UUnicodeUtils, + SysUtils; + +function TScreenOptionsProfiles.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; +begin + Result := true; + if (PressedDown) then + begin // Key Down + // check normal keys + case UCS4UpperCase(CharCode) of + Ord('Q'): + begin + Result := false; + Exit; + end; + end; + + // check special keys + case PressedKey of + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + UIni.Ini.Save; + AudioPlayback.PlaySound(SoundLib.Back); + FadeTo(@ScreenOptions); + end; + SDLK_RETURN: + begin + if SelInteraction = 0 then + begin + UIni.Ini.Save; + AudioPlayback.PlaySound(SoundLib.Back); + FadeTo(@ScreenOptions); + end; + end; + SDLK_LEFT: + begin + InteractPrev; + end; + SDLK_RIGHT: + begin + InteractNext; + end; + SDLK_UP: + begin + InteractPrev; + end; + SDLK_DOWN: + begin + InteractNext; + end; + + + end; + end; +end; + +constructor TScreenOptionsProfiles.Create; +begin + inherited Create; + + LoadFromTheme(Theme.OptionsProfiles); + + AddButton(Theme.OptionsProfiles.ButtonExit); + + Interaction := 0; +end; + +procedure TScreenOptionsProfiles.OnShow; +begin + inherited; + + Interaction := 0; +end; +end. diff --git a/src/screens/UScreenOptionsThemes.pas b/src/screens/UScreenOptionsThemes.pas index 307a9632..541762f8 100644 --- a/src/screens/UScreenOptionsThemes.pas +++ b/src/screens/UScreenOptionsThemes.pas @@ -150,7 +150,7 @@ constructor TScreenOptionsThemes.Create; LoadFromTheme(Theme.OptionsThemes); AddSelectSlide(Theme.OptionsThemes.SelectTheme, Ini.Theme, ITheme); Self.SkinSelect := AddSelectSlide(UThemes.Theme.OptionsThemes.SelectSkin, UIni.Ini.Skin, UThemes.Theme.Themes[UIni.Ini.Theme].Skins); - AddSelectSlide(Theme.OptionsThemes.SelectColor, UIni.Ini.Color, UIni.IColor, 'OPTION_VALUE_'); + AddSelectSlide(Theme.OptionsThemes.SelectColor, UIni.Ini.Color, UIni.IColor, 'C_COLOR_'); AddButton(Theme.OptionsThemes.ButtonExit); diff --git a/src/screens/UScreenOptionsWebcam.pas b/src/screens/UScreenOptionsWebcam.pas index e2be3069..48e0993d 100644 --- a/src/screens/UScreenOptionsWebcam.pas +++ b/src/screens/UScreenOptionsWebcam.pas @@ -178,7 +178,6 @@ constructor TScreenOptionsWebcam.Create; var WebcamsIDs: array[0..2] of UTF8String; IWebcamEffectTranslated: array [0..10] of UTF8String = ('NORMAL', 'GRAYSCALE', 'BLACK_WHITE', 'NEGATIVE', 'BINARY_IMAGE', 'DILATE', 'THRESHOLD', 'EDGES', 'GAUSSIAN_BLUR', 'EQUALIZED', 'ERODE'); - SelectWebcam: integer; begin inherited Create; diff --git a/src/screens/UScreenPartyNewRound.pas b/src/screens/UScreenPartyNewRound.pas index 3c408803..2a22c43f 100644 --- a/src/screens/UScreenPartyNewRound.pas +++ b/src/screens/UScreenPartyNewRound.pas @@ -253,15 +253,16 @@ constructor TScreenPartyNewRound.Create; end; procedure TScreenPartyNewRound.OnShow; -var - I: integer; function GetTeamPlayers(const Num: integer): UTF8String; var Players: array of UTF8String; J: integer; begin if (Num > High(Party.Teams)) or (Num < 0) then - exit; + begin + Result := ''; + Exit(); + end; //Create Players array SetLength(Players, Length(Party.Teams[Num].Players)); diff --git a/src/screens/UScreenPartyPlayer.pas b/src/screens/UScreenPartyPlayer.pas index 12f1ec88..9cd9a2da 100644 --- a/src/screens/UScreenPartyPlayer.pas +++ b/src/screens/UScreenPartyPlayer.pas @@ -297,7 +297,7 @@ function TScreenPartyPlayer.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; case Interaction of 1: Team := 0; 7: Team := 1; - 13: Team := 2; + else Team := 2; //13 end; Num[Team] := Num[Team] - 1; @@ -315,7 +315,7 @@ function TScreenPartyPlayer.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; case Interaction of 1: Team := 0; 7: Team := 1; - 13: Team := 2; + else Team := 2; //13 end; //Button[Team * 5].Text[0].Text := 'BUTTON ' + IntTostr(Team); diff --git a/src/screens/UScreenPartyTournamentRounds.pas b/src/screens/UScreenPartyTournamentRounds.pas index 1d35ce03..a029c96f 100644 --- a/src/screens/UScreenPartyTournamentRounds.pas +++ b/src/screens/UScreenPartyTournamentRounds.pas @@ -618,7 +618,7 @@ function TScreenPartyTournamentRounds.ExistPlayers(Phase: integer): boolean; case Phase of 0: Valor := 8; 1: Valor := 12; - 2: Valor := 14; + else Valor := 14; //2 end; Result := (Total < Valor); diff --git a/src/screens/UScreenPlayerSelection.pas b/src/screens/UScreenPlayerSelector.pas similarity index 90% rename from src/screens/UScreenPlayerSelection.pas rename to src/screens/UScreenPlayerSelector.pas index d6eae9bf..648aeeae 100644 --- a/src/screens/UScreenPlayerSelection.pas +++ b/src/screens/UScreenPlayerSelector.pas @@ -21,7 +21,7 @@ *} -unit UScreenPlayerSelection; +unit UScreenPlayerSelector; interface @@ -58,7 +58,9 @@ TScreenPlayerSelector = class(TMenu) PlayerColor: cardinal; PlayerSelect: cardinal; PlayerSelectLevel: cardinal; - SingButton: boolean; //only change the screen with click on sing button + SingButtonPressed: boolean; //only change the screen with click on sing button + SingButton: integer; + ExitButton: integer; CountIndex: integer; PlayerIndex: integer; ColorIndex: integer; @@ -78,19 +80,20 @@ TScreenPlayerSelector = class(TMenu) PlayerNames: array [0..UIni.IMaxPlayerCount-1] of UTF8String; PlayerAvatars: array [0..UIni.IMaxPlayerCount-1] of integer; PlayerLevel: array [0..UIni.IMaxPlayerCount-1] of integer; - + Num: array[0..UIni.IMaxPlayerCount-1] of integer; APlayerColor: array of integer; PlayerAvatarButton: array of integer; PlayerAvatarButtonMD5: array of UTF8String; public - Goto_SingScreen: boolean; //If true then next Screen in SingScreen + OpenedInOptions: boolean; constructor Create; override; function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; function ParseMouse(MouseButton: integer; BtnDown: boolean; X, Y: integer): boolean; override; procedure OnShow; override; + procedure OnHide; override; function Draw: boolean; override; procedure SetAnimationProgress(Progress: real); override; @@ -112,9 +115,6 @@ TScreenPlayerSelector = class(TMenu) const PlayerColors: array[0..16] of UTF8String = ('Blue', 'Red', 'Green', 'Yellow', 'Magenta', 'Orange', 'Pink', 'Violet', 'Brown', 'Gray', 'DarkBlue', 'Sky', 'Cyan', 'Flame', 'Orchid', 'Harlequin', 'GreenYellow'); -var - Num: array[0..UIni.IMaxPlayerCount-1]of integer; - implementation uses @@ -137,7 +137,7 @@ function TScreenPlayerSelector.ParseMouse(MouseButton: integer; BtnDown: boolean if BtnDown then case MouseButton of SDL_BUTTON_LEFT: //only change the screen if sing button is clicked - Self.SingButton := Self.Interaction = 6; + Self.SingButtonPressed := Self.Interaction in [6, 7]; SDL_BUTTON_MIDDLE: begin Result := Self.ParseInput(SDLK_RETURN, 0, true); @@ -185,8 +185,7 @@ function TScreenPlayerSelector.ParseMouse(MouseButton: integer; BtnDown: boolean function TScreenPlayerSelector.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; var - I, CurrentAvatar, PrevAvatar: integer; - Col: TRGB; + CurrentAvatar, PrevAvatar: integer; begin Result := true; if (PressedDown) then @@ -233,81 +232,18 @@ function TScreenPlayerSelector.ParseInput(PressedKey: cardinal; CharCode: UCS4Ch else ParseInput(SDLK_ESCAPE, CharCode, PressedDown); end; - SDLK_ESCAPE : - begin - Ini.SaveNames; - AudioPlayback.PlaySound(SoundLib.Back); - if GoTo_SingScreen then - FadeTo(@ScreenSong) + if Self.OpenedInOptions then + Self.FadeTo(@UGraphic.ScreenOptions, UMusic.SoundLib.Back) else - FadeTo(@ScreenMain); - end; - + Self.FadeTo(@UGraphic.ScreenSong); SDLK_RETURN: begin - if not Self.SingButton then + if not Self.SingButtonPressed then Exit(); - Ini.Players := CountIndex; - PlayersPlay:= UIni.IPlayersVals[CountIndex]; - - for I := 1 to PlayersPlay do - begin - Ini.Name[I-1] := PlayerNames[I-1]; - Ini.PlayerColor[I-1] := Num[I-1]; - Ini.SingColor[I-1] := Num[I-1]; - Ini.PlayerLevel[I-1] := PlayerLevel[I-1]; - - Ini.PlayerAvatar[I-1] := PlayerAvatarButtonMD5[PlayerAvatars[I-1]]; - - if (PlayerAvatars[I-1] = 0) then - begin - AvatarPlayerTextures[I] := NoAvatartexture[I]; - - Col := GetPlayerColor(Num[I-1]); - - AvatarPlayerTextures[I].ColR := Col.R; - AvatarPlayerTextures[I].ColG := Col.G; - AvatarPlayerTextures[I].ColB := Col.B; - end - else - begin - Button[PlayerAvatarButton[PlayerAvatars[I-1]]].Texture.Int := 1; - AvatarPlayerTextures[I] := Button[PlayerAvatarButton[PlayerAvatars[I-1]]].Texture; - end; - - end; - - Ini.SaveNumberOfPlayers; - Ini.SaveNames; - Ini.SavePlayerColors; - Ini.SavePlayerAvatars; - Ini.SavePlayerLevels; - - LoadPlayersColors; - Theme.ThemeScoreLoad; - - // Reload ScreenSing and ScreenScore because of player colors - // TODO: do this better REALLY NECESSARY? - //ScreenScore.Free; - //ScreenSing.Free; - - ScreenScore := TScreenScore.Create; - ScreenSing := TScreenSingController.Create; - // - - AudioPlayback.PlaySound(SoundLib.Start); - if GoTo_SingScreen then - begin - FadeTo(@ScreenSing); - GoTo_SingScreen := false; - end - else - begin - FadeTo(@ScreenSong); - GoTo_SingScreen := false; - end; + if Self.SelInteraction = 6 then + ParseInput(SDLK_ESCAPE, CharCode, PressedDown); end; // Up and Down could be done at the same time, @@ -565,7 +501,7 @@ procedure TScreenPlayerSelector.RefreshProfile(); if not (Used) then begin - ITmp[Index] := ULanguage.Language.Translate('OPTION_VALUE_'+PlayerColors[I]); + ITmp[Index] := ULanguage.Language.Translate('C_COLOR_'+PlayerColors[I]); APlayerColor[Index] := I + 1; Index := Index + 1; end; @@ -701,7 +637,8 @@ constructor TScreenPlayerSelector.Create; Self.PlayerColor := AddSelectSlide(UThemes.Theme.PlayerSelector.SelectPlayerColor, Self.ColorIndex, PlayerColors, 'OPTION_VALUE_'); Self.PlayerSelectLevel := Self.AddSelectSlide(UThemes.Theme.PlayerSelector.SelectPlayerLevel, Self.LevelIndex, UIni.IDifficulty, 'OPTION_VALUE_'); Self.PlayerAvatar := Self.AddButton(UThemes.Theme.PlayerSelector.PlayerButtonAvatar); - Self.AddButton(UThemes.Theme.PlayerSelector.SingButton); + Self.ExitButton := Self.AddButton(UThemes.Theme.PlayerSelector.ExitButton); + Self.SingButton := Self.AddButton(UThemes.Theme.PlayerSelector.SingButton); isScrolling := false; GenerateAvatars(); @@ -744,7 +681,9 @@ procedure TScreenPlayerSelector.OnShow; I: integer; begin inherited; - Self.SingButton := true; + Self.SingButtonPressed := true; + Self.Button[Self.ExitButton].Visible := Self.OpenedInOptions; + Self.Button[Self.SingButton].Visible := not Self.OpenedInOptions; CountIndex := Ini.Players; @@ -778,6 +717,46 @@ procedure TScreenPlayerSelector.OnShow; Interaction := 0; end; +procedure TScreenPlayerSelector.OnHide(); +var + Col: TRGB; + I: integer; +begin + inherited; + UIni.Ini.Players := Self.CountIndex; + UNote.PlayersPlay := UIni.IPlayersVals[Self.CountIndex]; + for I := 1 to UIni.IPlayersVals[Self.CountIndex] do + begin + UIni.Ini.Name[I - 1] := Self.PlayerNames[I - 1]; + UIni.Ini.PlayerColor[I - 1] := Self.Num[I - 1]; + UIni.Ini.SingColor[I - 1] := Self.Num[I - 1]; + UIni.Ini.PlayerLevel[I - 1] := Self.PlayerLevel[I - 1]; + UIni.Ini.PlayerAvatar[I - 1] := Self.PlayerAvatarButtonMD5[Self.PlayerAvatars[I - 1]]; + if Self.PlayerAvatars[I - 1] = 0 then + begin + UAvatars.AvatarPlayerTextures[I] := UAvatars.NoAvatartexture[I]; + Col := UThemes.GetPlayerColor(Self.Num[I - 1]); + UAvatars.AvatarPlayerTextures[I].ColR := Col.R; + UAvatars.AvatarPlayerTextures[I].ColG := Col.G; + UAvatars.AvatarPlayerTextures[I].ColB := Col.B; + end + else + begin + Self.Button[Self.PlayerAvatarButton[Self.PlayerAvatars[I-1]]].Texture.Int := 1; + UAvatars.AvatarPlayerTextures[I] := Self.Button[Self.PlayerAvatarButton[Self.PlayerAvatars[I-1]]].Texture; + end; + end; + UIni.Ini.SaveNumberOfPlayers(); + UIni.Ini.SaveNames(); + UIni.Ini.SavePlayerColors(); + UIni.Ini.SavePlayerAvatars(); + UIni.Ini.SavePlayerLevels(); + UThemes.LoadPlayersColors(); + UThemes.Theme.ThemeScoreLoad(); + UGraphic.ScreenScore := UScreenScore.TScreenScore.Create(); + UGraphic.ScreenSing := UScreenSingController.TScreenSingController.Create(); +end; + procedure TScreenPlayerSelector.SetAvatarScroll; var B: integer; @@ -792,15 +771,9 @@ procedure TScreenPlayerSelector.SetAvatarScroll; VS := Length(AvatarsList); case NumVisibleAvatars of - 1: begin - Factor := 0; - end; - 3: begin - Factor := 1; - end; - 5: begin - Factor := 1.5; - end; + 3: Factor := 1; + 5: Factor := 1.5; + else Factor := 0; end; // Update positions of all avatars diff --git a/src/screens/UScreenPopup.pas b/src/screens/UScreenPopup.pas index 19a75481..16c2a35d 100644 --- a/src/screens/UScreenPopup.pas +++ b/src/screens/UScreenPopup.pas @@ -174,8 +174,8 @@ TScreenPopupScoreDownload = class(TMenu) Texture_ProgressBar: TTexture; - List_MD5Song: widestring; - Receive_List: array[0..2] of widestring; + List_MD5Song: string; + Receive_List: array[0..2] of string; Actual_Level: integer; Position_Receive_List: array[0..2] of integer; @@ -900,7 +900,9 @@ procedure TScreenPopupScoreDownload.SaveScoreSong(); J, Update: integer; DeleteSongLevel: array [0..2] of boolean; begin - + DeleteSongLevel[0] := false; + DeleteSongLevel[1] := false; + DeleteSongLevel[2] := false; if not(CatSongs.Song[Index_Song].Main) then begin Actual_Song := Actual_Song + 1; @@ -1051,8 +1053,7 @@ procedure TScreenPopupScoreDownload.ReceiveListScore(); Text_WebSituation := IntToStr(Actual_Web) + '/' + IntToStr(Num_Webs); Text_SongSituation := Language.Translate('SCORE_DOWNLOAD_RECEIVE_LIST'); - Receive_List[Actual_Level] := ''; - Receive_List[Actual_Level] := DllMan.WebsiteDownloadScore(List_MD5Song, Actual_Level + 1); + Receive_List[Actual_Level] := DllMan.WebsiteDownloadScore(widestring(List_MD5Song), Actual_Level + 1); if (Receive_List[Actual_Level] = '0') then begin diff --git a/src/screens/UScreenScore.pas b/src/screens/UScreenScore.pas index cb348ea1..70cc8c11 100644 --- a/src/screens/UScreenScore.pas +++ b/src/screens/UScreenScore.pas @@ -158,7 +158,6 @@ TScreenScore = class(TMenu) StaticLevel: array[1..UIni.IMaxPlayerCount] of integer; StaticLevelRound: array[1..UIni.IMaxPlayerCount] of integer; - Animation: real; Voice: integer; TextScore_ActualValue: array[1..UIni.IMaxPlayerCount] of integer; @@ -247,7 +246,6 @@ procedure SendScore(SendInfo: TSendInfo; Website: integer); var LoginInfo: TLoginInfo; SendStatus: integer; - EncryptPassword: widestring; begin // Encrypt Password (with username and password) @@ -257,10 +255,7 @@ procedure SendScore(SendInfo: TSendInfo; Website: integer); DllMan.LoadWebsite(Website); if (ScreenPopUpSendScore.SelectValueU = High(ScreenPopUpSendScore.IUsername)) then - begin - EncryptPassword := DllMan.WebsiteEncryptPassword(LoginInfo); - SendInfo.Password := EncryptPassword; - end; + SendInfo.Password := DllMan.WebsiteEncryptPassword(LoginInfo); SendStatus := DllMan.WebsiteSendScore(SendInfo); @@ -279,7 +274,6 @@ procedure SendScore(SendInfo: TSendInfo; Website: integer); procedure SaveScore(SendInfo: TSendInfo; Website: integer); var LoginInfo: TLoginInfo; - EncryptPassword: widestring; ScoreFile: TextFile; EncryptText: string; WebName: UTF8String; @@ -291,10 +285,7 @@ procedure SaveScore(SendInfo: TSendInfo; Website: integer); DllMan.LoadWebsite(Website); if (ScreenPopUpSendScore.SelectValueU = High(ScreenPopUpSendScore.IUsername)) then - begin - EncryptPassword := DllMan.WebsiteEncryptPassword(LoginInfo); - SendInfo.Password := EncryptPassword; - end; + SendInfo.Password := DllMan.WebsiteEncryptPassword(LoginInfo); WebName := UDataBase.DataBase.NetworkUser[Website].Website; @@ -472,7 +463,6 @@ function TScreenScore.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Press function TScreenScore.ParseMouse(MouseButton: Integer; BtnDown: Boolean; X, Y: integer): boolean; var - min_y, max_y, min_x, max_x: real; button_s: integer; begin Result := True; @@ -486,11 +476,6 @@ function TScreenScore.ParseMouse(MouseButton: Integer; BtnDown: Boolean; X, Y: i button_s := ButtonSend[3]; end; - min_x := Button[button_s].X; - min_y := Button[button_s].Y; - max_x := Button[button_s].X + Button[button_s].W; - max_y := Button[button_s].Y + Button[button_s].H; - // transfer mousecords to the 800x600 raster we use to draw X := Round((X / (Screen^.w / Screens)) * RenderW); if (X > RenderW) then @@ -580,10 +565,9 @@ procedure TScreenScore.LoadSwapTextures; PlayerNum2 := PlayerNum + 2; end; - 4..6: begin + else //4..6 PlayerNum := P - 3; PlayerNum2 := PlayerNum + 3; - end; end; for I := 0 to High(PlayerStatic[P]) do @@ -634,10 +618,9 @@ procedure TScreenScore.LoadSwapTextures; PlayerNum2 := PlayerNum + 2; end; - 4..6: begin + else // 4..6 PlayerNum := P - 3; PlayerNum2 := PlayerNum + 3; - end; end; for I := 0 to High(PlayerBoxTextures[P]) do @@ -651,10 +634,9 @@ procedure TScreenScore.LoadSwapTextures; StaticNum := StaticBoxLight[P]; ThemeStatic := Theme.Score.StaticBoxLight[P]; end; - 2: begin + else //2 StaticNum := StaticBoxDark[P]; ThemeStatic := Theme.Score.StaticBoxDark[P]; - end; end; // copy current statics texture to texture for screen 1 PlayerBoxTextures[P, I, 1].Tex := Statics[StaticNum].Texture; @@ -692,7 +674,7 @@ procedure TScreenScore.LoadSwapTextures; //TODO: adapt for players 7 to 12 procedure TScreenScore.SwapToScreen(Screen: integer); var - P, I, J, Max: integer; + P, I, Max: integer; Col: TRGB; begin @@ -824,7 +806,6 @@ constructor TScreenScore.Create; Player: integer; Counter: integer; I: integer; - Col: TRGB; R, G, B: real; Col2: integer; ArrayStartModifier: integer; @@ -910,7 +891,6 @@ constructor TScreenScore.Create; aPlayerScoreScreenTextures[Player].Score_NoteBarRound_Lightest := Tex_Score_NoteBarRound_Lightest[Player]; end; - //TODO: adapt for players 7 to 12 // avatars case PlayersPlay of 1: ArrayStartModifier := 0; @@ -1093,7 +1073,6 @@ procedure TScreenScore.OnShow; P: integer; // player I: integer; V: array[1..UIni.IMaxPlayerCount] of boolean; // visibility array - ArrayStartModifier: integer; begin if not Assigned(UGraphic.ScreenPopupSendScore) then //load the screens only the first time begin @@ -1132,7 +1111,6 @@ procedure TScreenScore.OnShow; Text[TextTitle].Text := CurrentSong.Title; Text[TextArtistTitle].Text := CurrentSong.Artist + ' - ' + CurrentSong.Title; - //TODO: adapt for players 7 to 12 // set visibility case PlayersPlay of 1: begin @@ -1183,6 +1161,13 @@ procedure TScreenScore.OnShow; V[6] := true; end; end; + else + V[1] := false; + V[2] := false; + V[3] := false; + V[4] := false; + V[5] := false; + V[6] := false; end; for P := 1 to UIni.IMaxPlayerCount do @@ -1587,28 +1572,34 @@ procedure TscreenScore.EaseBarIn(PlayerNumber: integer; BarType: TScoreBarType); // let's get the points according to the bar we draw // score array starts at 0, which means the score for player 1 is in score[0] // EaseOut_Step is the actual step in the raising process, like the 20iest step of EaseOut_MaxSteps - if (BarType = sbtScore) then - begin - Score := Player[PlayerNumber - 1].ScoreInt; - RaiseStep := BarScore_EaseOut_Step; - BarStartPosY := Theme.Score.StaticBackLevel[ThemeIndex].Y + MaxHeight; - end - else if (BarType = sbtLine) then - begin - Score := Player[PlayerNumber - 1].ScoreLineInt; - RaiseStep := BarPhrase_EaseOut_Step; - BarStartPosY := Theme.Score.StaticBackLevel[ThemeIndex].Y - aPlayerScoreScreenDatas[PlayerNumber].BarScore_ActualHeight + MaxHeight; - end - else if (BarType = sbtGolden) then - begin - Score := Player[PlayerNumber - 1].ScoreGoldenInt; - RaiseStep := BarGolden_EaseOut_Step; - BarStartPosY := Theme.Score.StaticBackLevel[ThemeIndex].Y - aPlayerScoreScreenDatas[PlayerNumber].BarScore_ActualHeight - aPlayerScoreScreenDatas[PlayerNumber].BarLine_ActualHeight + MaxHeight; + case BarType of + sbtScore: + begin + Score := Player[PlayerNumber - 1].ScoreInt; + RaiseStep := BarScore_EaseOut_Step; + BarStartPosY := Theme.Score.StaticBackLevel[ThemeIndex].Y + MaxHeight; + end; + sbtLine: + begin + Score := Player[PlayerNumber - 1].ScoreLineInt; + RaiseStep := BarPhrase_EaseOut_Step; + BarStartPosY := Theme.Score.StaticBackLevel[ThemeIndex].Y - aPlayerScoreScreenDatas[PlayerNumber].BarScore_ActualHeight + MaxHeight; + end; + sbtGolden: + begin + Score := Player[PlayerNumber - 1].ScoreGoldenInt; + RaiseStep := BarGolden_EaseOut_Step; + BarStartPosY := Theme.Score.StaticBackLevel[ThemeIndex].Y - aPlayerScoreScreenDatas[PlayerNumber].BarScore_ActualHeight - aPlayerScoreScreenDatas[PlayerNumber].BarLine_ActualHeight + MaxHeight; + end; + else + Score := 0; + RaiseStep := 0; + BarStartPosY := 0; end; - // the height dependend of the score Height2Reach := (Score / MAX_SONG_SCORE) * MaxHeight; + NewHeight := 0; if (aPlayerScoreScreenDatas[PlayerNumber].Bar_Actual_Height < Height2Reach) then begin // Check http://proto.layer51.com/d.aspx?f=400 for more info on easing functions @@ -1706,23 +1697,29 @@ procedure TScreenScore.EaseScoreIn(PlayerNumber: integer; ScoreType: TScoreBarTy EaseOut_Step: real; ActualScoreValue: integer; begin - if (ScoreType = sbtScore) then - begin - EaseOut_Step := BarScore_EaseOut_Step; - ActualScoreValue := TextScore_ActualValue[PlayerNumber]; - ScoreReached := Player[PlayerNumber-1].ScoreInt; - end; - if (ScoreType = sbtLine) then - begin - EaseOut_Step := BarPhrase_EaseOut_Step; - ActualScoreValue := TextPhrase_ActualValue[PlayerNumber]; - ScoreReached := Player[PlayerNumber-1].ScoreLineInt; - end; - if (ScoreType = sbtGolden) then - begin - EaseOut_Step := BarGolden_EaseOut_Step; - ActualScoreValue := TextGolden_ActualValue[PlayerNumber]; - ScoreReached := Player[PlayerNumber-1].ScoreGoldenInt; + case ScoreType of + sbtScore: + begin + EaseOut_Step := BarScore_EaseOut_Step; + ActualScoreValue := TextScore_ActualValue[PlayerNumber]; + ScoreReached := Player[PlayerNumber-1].ScoreInt; + end; + sbtLine: + begin + EaseOut_Step := BarPhrase_EaseOut_Step; + ActualScoreValue := TextPhrase_ActualValue[PlayerNumber]; + ScoreReached := Player[PlayerNumber-1].ScoreLineInt; + end; + sbtGolden: + begin + EaseOut_Step := BarGolden_EaseOut_Step; + ActualScoreValue := TextGolden_ActualValue[PlayerNumber]; + ScoreReached := Player[PlayerNumber-1].ScoreGoldenInt; + end; + else + EaseOut_Step := 0; + ActualScoreValue := 0; + ScoreReached := 0; end; // EaseOut_Step is the actual step in the raising process, like the 20iest step of EaseOut_MaxSteps @@ -1798,6 +1795,7 @@ procedure TScreenSCore.StartPreview; select: integer; changed: boolean; begin + select := 0; //When Music Preview is activated -> then change music if (Ini.PreviewVolume <> 0) then begin @@ -1853,15 +1851,15 @@ procedure TScreenSCore.StartPreview; end; procedure TScreenScore.StartVoice; -var - changed: boolean; - files: array of string; - I: integer; +// var + // changed: boolean; + // files: array of string; + // I: integer; begin //Music.Close; //ScreenSong.SongIndex := -1; - changed := false; + //changed := false; // not implement voice yet { diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas index 1d2a50d7..2f947c28 100644 --- a/src/screens/UScreenSong.pas +++ b/src/screens/UScreenSong.pas @@ -30,6 +30,7 @@ interface {$I switches.inc} uses + UAvatars, UCommon, UIni, UMenu, @@ -59,6 +60,8 @@ TScreenSong = class(TMenu) TextNumber: integer; TextTitle: integer; TextYear: integer; + TextCreator: integer; + TextFixer: integer; procedure ColorDuetNameSingers; procedure LoadCover(Const I: integer); procedure LoadMainCover(); @@ -95,6 +98,9 @@ TScreenSong = class(TMenu) //Rap Icon RapIcon: cardinal; + CreatorIcon: cardinal; + FixerIcon: cardinal; + TextCat: integer; SongCurrent: real; @@ -105,15 +111,20 @@ TScreenSong = class(TMenu) CoverTime: real; //Scores - TextScore: integer; - TextMaxScore: integer; - TextMediaScore: integer; - TextMaxScore2: integer; - TextMediaScore2: integer; - TextScoreUser: integer; - TextMaxScoreLocal: integer; - TextMediaScoreLocal: integer; - TextScoreUserLocal: integer; + TextMyScores: integer; + TextWebsite: integer; + TextUserLocalScore1: integer; + TextUserLocalScore2: integer; + TextUserLocalScore3: integer; + TextLocalScore1: integer; + TextLocalScore2: integer; + TextLocalScore3: integer; + TextUserOnlineScore1: integer; + TextUserOnlineScore2: integer; + TextUserOnlineScore3: integer; + TextOnlineScore1: integer; + TextOnlineScore2: integer; + TextOnlineScore3: integer; //Party Mod Mode: TSingMode; @@ -133,11 +144,15 @@ TScreenSong = class(TMenu) ListTextArtist: array of integer; ListTextTitle: array of integer; ListTextYear: array of integer; + ListTextCreator: array of integer; + ListTextFixer: array of integer; ListVideoIcon: array of integer; ListMedleyIcon: array of integer; ListCalcMedleyIcon: array of integer; ListDuetIcon: array of integer; ListRapIcon: array of integer; + ListCreatorIcon: array of integer; + ListFixerIcon: array of integer; PlayMidi: boolean; MidiFadeIn: boolean; @@ -205,6 +220,7 @@ implementation uses Math, + md5, sdl2, SysUtils, StrUtils, @@ -219,8 +235,10 @@ implementation UNote, UPath, UPlaylist, - UScreenPlayerSelection, + UScreenPlayerSelector, UScreenPopup, + UScreenScore, + UScreenSingController, UScreenSongMenu, UScreenSongJumpto, USkins, @@ -582,69 +600,76 @@ function TScreenSong.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Presse Self.SetJoker(); end; end; + SDLK_F5: + begin + Self.FadeTo(@UGraphic.ScreenMain); + UGraphic.ScreenMain.ReloadSongs(); + end; end; end; end; function TScreenSong.ParseMouse(MouseButton: integer; BtnDown: boolean; X, Y: integer): boolean; var + CurrentSong: boolean; B, CoverX, CoverY: integer; begin Result := true; - if BtnDown then - if UGraphic.ScreenSongMenu.Visible then - Result := UGraphic.ScreenSongMenu.ParseMouse(MouseButton, BtnDown, X, Y) - else if UGraphic.ScreenSongJumpTo.Visible then - Result := UGraphic.ScreenSongJumpTo.ParseMouse(MouseButton, BtnDown, X, Y) - else - begin - Self.TransferMouseCords(X, Y); - case MouseButton of - SDL_BUTTON_LEFT: //sing or move to the selected song/page - begin - if Self.FreeListMode() then - if //current song - Self.InRegion(X, Y, Self.Button[Self.Interaction].GetMouseOverArea()) //button - or Self.InRegion(X, Y, Self.Statics[0].GetMouseOverArea()) //song info - or (Self.Statics[Self.MainCover].Visible and Self.InRegion(X, Y, Self.Statics[Self.MainCover].GetMouseOverArea())) //main cover - then - Self.ParseInput(SDLK_RETURN, 0, true) - else - case UIni.TSongMenuMode(UIni.Ini.SongMenu) of - smList: //current song in list mode - if - (X > UThemes.Theme.Song.ListCover.X) - and (X < UThemes.Theme.Song.ListCover.X + UThemes.Theme.Song.ListCover.W) - and (Y > UThemes.Theme.Song.ListCover.Y) - and (Y < UThemes.Theme.Song.ListCover.Y + (UThemes.Theme.Song.ListCover.H + UThemes.Theme.Song.ListCover.Padding) * UThemes.Theme.Song.Cover.Rows) - then - Self.ParseInput(SDLK_RETURN, 0, true); - smChessboard: //left arrows to move a entire page - if Self.InRegion(X, Y, Self.Statics[1].GetMouseOverArea()) then //arrow to page up - Self.ParseInput(SDLK_PAGEUP, 0, true) - else if Self.InRegion(X, Y, Self.Statics[2].GetMouseOverArea()) then //arrow to page down - Self.ParseInput(SDLK_PAGEDOWN, 0, true); - else - for B := 0 to High(Self.Button) do - if Self.Button[B].Visible and Self.InRegion(X, Y, Self.Button[B].GetMouseOverArea()) then - begin - Self.SkipTo(B); - Exit(); - end; - end; - end; - SDL_BUTTON_RIGHT: //go back - if Self.RightMbESC then - Result := Self.ParseInput(SDLK_ESCAPE, 0, true); - SDL_BUTTON_MIDDLE: //open song menu - Self.ParseInput(0, Ord('M'), true); - SDL_BUTTON_WHEELDOWN: //next song - Self.ParseInput(IfThen(UThemes.Theme.Song.Cover.Rows = 1, SDLK_RIGHT, SDLK_DOWN), 0, true); - SDL_BUTTON_WHEELUP: //previous song - Self.ParseInput(IfThen(UThemes.Theme.Song.Cover.Rows = 1, SDLK_LEFT, SDLK_UP), 0, true); - end + if UGraphic.ScreenSongMenu.Visible then + Result := UGraphic.ScreenSongMenu.ParseMouse(MouseButton, BtnDown, X, Y) + else if UGraphic.ScreenSongJumpTo.Visible then + Result := UGraphic.ScreenSongJumpTo.ParseMouse(MouseButton, BtnDown, X, Y) + else if BtnDown then + begin + Self.TransferMouseCords(X, Y); + CurrentSong := Self.InRegion(X, Y, Self.Button[Self.Interaction].GetMouseOverArea()) //button + or Self.InRegion(X, Y, Self.Statics[0].GetMouseOverArea()) //song info + or (Self.Statics[Self.MainCover].Visible and Self.InRegion(X, Y, Self.Statics[Self.MainCover].GetMouseOverArea())); //main cover + + case MouseButton of + SDL_BUTTON_LEFT: //sing or move to the selected song/page + begin + if Self.FreeListMode() then + if CurrentSong then + Self.ParseInput(SDLK_RETURN, 0, true) + else + case UIni.TSongMenuMode(UIni.Ini.SongMenu) of + smList: //current song in list mode + if + (X > UThemes.Theme.Song.ListCover.X) + and (X < UThemes.Theme.Song.ListCover.X + UThemes.Theme.Song.ListCover.W) + and (Y > UThemes.Theme.Song.ListCover.Y) + and (Y < UThemes.Theme.Song.ListCover.Y + (UThemes.Theme.Song.ListCover.H + UThemes.Theme.Song.ListCover.Padding) * UThemes.Theme.Song.Cover.Rows) + then + Self.ParseInput(SDLK_RETURN, 0, true); + smChessboard: //left arrows to move a entire page + if Self.InRegion(X, Y, Self.Statics[1].GetMouseOverArea()) then //arrow to page up + Self.ParseInput(SDLK_PAGEUP, 0, true) + else if Self.InRegion(X, Y, Self.Statics[2].GetMouseOverArea()) then //arrow to page down + Self.ParseInput(SDLK_PAGEDOWN, 0, true); + else + for B := 0 to High(Self.Button) do + if Self.Button[B].Visible and Self.InRegion(X, Y, Self.Button[B].GetMouseOverArea()) then + begin + Self.SkipTo(B); + Exit(); + end; + end; + end; + SDL_BUTTON_RIGHT: //go back + if CurrentSong then //open song menu + Self.ParseInput(0, Ord('M'), true) + else if Self.RightMbESC then + Result := Self.ParseInput(SDLK_ESCAPE, 0, true); + SDL_BUTTON_MIDDLE: //open song menu + Self.ParseInput(0, Ord('M'), true); + SDL_BUTTON_WHEELDOWN: //next song + Self.ParseInput(IfThen(UThemes.Theme.Song.Cover.Rows = 1, SDLK_RIGHT, SDLK_DOWN), 0, true); + SDL_BUTTON_WHEELUP: //previous song + Self.ParseInput(IfThen(UThemes.Theme.Song.Cover.Rows = 1, SDLK_LEFT, SDLK_UP), 0, true); end - else if Self.FreeListMode() then //hover cover + end + else if Self.FreeListMode() and (not UGraphic.ScreenSongMenu.Visible) then //hover cover begin Self.TransferMouseCords(X, Y); B := Round(Self.SongTarget); @@ -673,11 +698,9 @@ function TScreenSong.ParseMouse(MouseButton: integer; BtnDown: boolean; X, Y: in end; end; -constructor TScreenSong.Create; +constructor TScreenSong.Create(); var I, J, Num, Padding: integer; - TextArtistY, TextTitleY, TextYearY, StaticMedCY, - StaticMedMY, StaticVideoY, StaticDuetY, StaticRapY: integer; StaticY: real; begin inherited Create; @@ -692,22 +715,31 @@ constructor TScreenSong.Create; Self.TextNumber := Self.AddText(UThemes.Theme.Song.TextNumber); Self.TextTitle := Self.AddText(UThemes.Theme.Song.TextTitle); Self.TextYear := Self.AddText(UThemes.Theme.Song.TextYear); + Self.TextCreator := Self.AddText(UThemes.Theme.Song.TextCreator); + Self.TextFixer := Self.AddText(UThemes.Theme.Song.TextFixer); Self.CalcMedleyIcon := Self.AddStatic(UThemes.Theme.Song.CalculatedMedleyIcon); Self.DuetIcon := Self.AddStatic(UThemes.Theme.Song.DuetIcon); Self.MedleyIcon := Self.AddStatic(UThemes.Theme.Song.MedleyIcon); Self.RapIcon := Self.AddStatic(UThemes.Theme.Song.RapIcon); Self.VideoIcon := Self.AddStatic(UThemes.Theme.Song.VideoIcon); + Self.CreatorIcon := Self.AddStatic(UThemes.Theme.Song.CreatorIcon); + Self.FixerIcon := Self.AddStatic(UThemes.Theme.Song.FixerIcon); //Show Scores - TextScore := AddText(Theme.Song.TextScore); - TextMaxScore := AddText(Theme.Song.TextMaxScore); - TextMediaScore := AddText(Theme.Song.TextMediaScore); - TextMaxScore2 := AddText(Theme.Song.TextMaxScore2); - TextMediaScore2 := AddText(Theme.Song.TextMediaScore2); - TextScoreUser := AddText(Theme.Song.TextScoreUser); - TextMaxScoreLocal := AddText(Theme.Song.TextMaxScoreLocal); - TextMediaScoreLocal := AddText(Theme.Song.TextMediaScoreLocal); - TextScoreUserLocal := AddText(Theme.Song.TextScoreUserLocal); + Self.TextMyScores := Self.AddText(UThemes.Theme.Song.TextMyScores); + Self.TextWebsite := Self.AddText(UThemes.Theme.Song.TextWebsite); + Self.TextUserLocalScore1 := Self.AddText(UThemes.Theme.Song.TextUserLocalScore1); + Self.TextUserLocalScore2 := Self.AddText(UThemes.Theme.Song.TextUserLocalScore2); + Self.TextUserLocalScore3 := Self.AddText(UThemes.Theme.Song.TextUserLocalScore3); + Self.TextLocalScore1 := Self.AddText(UThemes.Theme.Song.TextLocalScore1); + Self.TextLocalScore2 := Self.AddText(UThemes.Theme.Song.TextLocalScore2); + Self.TextLocalScore3 := Self.AddText(UThemes.Theme.Song.TextLocalScore3); + Self.TextUserOnlineScore1 := Self.AddText(UThemes.Theme.Song.TextUserOnlineScore1); + Self.TextUserOnlineScore2 := Self.AddText(UThemes.Theme.Song.TextUserOnlineScore2); + Self.TextUserOnlineScore3 := Self.AddText(UThemes.Theme.Song.TextUserOnlineScore3); + Self.TextOnlineScore1 := Self.AddText(UThemes.Theme.Song.TextOnlineScore1); + Self.TextOnlineScore2 := Self.AddText(UThemes.Theme.Song.TextOnlineScore2); + Self.TextOnlineScore3 := Self.AddText(UThemes.Theme.Song.TextOnlineScore3); //Party Mode for I := 0 to UParty.PartyTeamsMax - 1 do @@ -809,50 +841,43 @@ constructor TScreenSong.Create; SetLength(ListTextArtist, Num); SetLength(ListTextTitle, Num); SetLength(ListTextYear, Num); + SetLength(ListTextCreator, Num); + SetLength(ListTextFixer, Num); SetLength(ListVideoIcon, Num); SetLength(ListMedleyIcon, Num); SetLength(ListCalcMedleyIcon, Num); SetLength(ListDuetIcon, Num); SetLength(ListRapIcon, Num); - - TextArtistY := Theme.Song.TextArtist.Y; - TextTitleY := Theme.Song.TextTitle.Y; - TextYearY := Theme.Song.TextYear.Y; - - StaticVideoY := Theme.Song.VideoIcon.Y; - StaticMedMY := Theme.Song.MedleyIcon.Y; - StaticMedCY := Theme.Song.CalculatedMedleyIcon.Y; - StaticDuetY := Theme.Song.DuetIcon.Y; - StaticRapY := Theme.Song.RapIcon.Y; + SetLength(ListCreatorIcon, Num); + SetLength(ListFixerIcon, Num); for I := 0 to Num - 1 do begin - Padding := I * (Theme.Song.ListCover.H + Theme.Song.ListCover.Padding); - - Theme.Song.TextArtist.Y := TextArtistY + Padding; - - ListTextArtist[I] := AddText(Theme.Song.TextArtist); - - Theme.Song.TextTitle.Y := TextTitleY + Padding; - ListTextTitle[I] := AddText(Theme.Song.TextTitle); - - Theme.Song.TextYear.Y := TextYearY + Padding; - ListTextYear[I] := AddText(Theme.Song.TextYear); - - Theme.Song.VideoIcon.Y := StaticVideoY + Padding; - ListVideoIcon[I] := AddStatic(Theme.Song.VideoIcon); - - Theme.Song.MedleyIcon.Y := StaticMedMY + Padding; - ListMedleyIcon[I] := AddStatic(Theme.Song.MedleyIcon); - - Theme.Song.CalculatedMedleyIcon.Y := StaticMedCY + Padding; - ListCalcMedleyIcon[I] := AddStatic(Theme.Song.CalculatedMedleyIcon); - - Theme.Song.DuetIcon.Y := StaticDuetY + Padding; - ListDuetIcon[I] := AddStatic(Theme.Song.DuetIcon); - - Theme.Song.RapIcon.Y := StaticRapY + Padding; - ListRapIcon[I] := AddStatic(Theme.Song.RapIcon); + Self.ListTextArtist[I] := Self.AddText(UThemes.Theme.Song.TextArtist); + Self.ListTextTitle[I] := Self.AddText(UThemes.Theme.Song.TextTitle); + Self.ListTextYear[I] := Self.AddText(UThemes.Theme.Song.TextYear); + Self.ListTextCreator[I] := Self.AddText(UThemes.Theme.Song.TextCreator); + Self.ListTextFixer[I] := Self.AddText(UThemes.Theme.Song.TextFixer); + Self.ListVideoIcon[I] := Self.AddStatic(UThemes.Theme.Song.VideoIcon); + Self.ListMedleyIcon[I] := Self.AddStatic(UThemes.Theme.Song.MedleyIcon); + Self.ListCalcMedleyIcon[I] := Self.AddStatic(UThemes.Theme.Song.CalculatedMedleyIcon); + Self.ListDuetIcon[I] := Self.AddStatic(UThemes.Theme.Song.DuetIcon); + Self.ListRapIcon[I] := Self.AddStatic(UThemes.Theme.Song.RapIcon); + Self.ListCreatorIcon[I] := Self.AddStatic(UThemes.Theme.Song.CreatorIcon); + Self.ListFixerIcon[I] := Self.AddStatic(UThemes.Theme.Song.FixerIcon); + Padding := I * (UThemes.Theme.Song.ListCover.H + UThemes.Theme.Song.ListCover.Padding); + Self.Text[Self.ListTextArtist[I]].Y := Self.Text[Self.ListTextArtist[I]].Y + Padding; + Self.Text[Self.ListTextTitle[I]].Y := Self.Text[Self.ListTextTitle[I]].Y + Padding; + Self.Text[Self.ListTextYear[I]].Y := Self.Text[Self.ListTextYear[I]].Y + Padding; + Self.Text[Self.ListTextCreator[I]].Y := Self.Text[Self.ListTextCreator[I]].Y + Padding; + Self.Text[Self.ListTextFixer[I]].Y := Self.Text[Self.ListTextFixer[I]].Y + Padding; + Self.Statics[Self.ListVideoIcon[I]].Texture.Y := Self.Statics[Self.ListVideoIcon[I]].Texture.Y + Padding; + Self.Statics[Self.ListMedleyIcon[I]].Texture.Y := Self.Statics[Self.ListMedleyIcon[I]].Texture.Y + Padding; + Self.Statics[Self.ListCalcMedleyIcon[I]].Texture.Y := Self.Statics[Self.ListCalcMedleyIcon[I]].Texture.Y + Padding; + Self.Statics[Self.ListDuetIcon[I]].Texture.Y := Self.Statics[Self.ListDuetIcon[I]].Texture.Y + Padding; + Self.Statics[Self.ListRapIcon[I]].Texture.Y := Self.Statics[Self.ListRapIcon[I]].Texture.Y + Padding; + Self.Statics[Self.ListCreatorIcon[I]].Texture.Y := Self.Statics[Self.ListCreatorIcon[I]].Texture.Y + Padding; + Self.Statics[Self.ListFixerIcon[I]].Texture.Y := Self.Statics[Self.ListFixerIcon[I]].Texture.Y + Padding; end; Self.MinLine := 0; @@ -1083,7 +1108,9 @@ procedure TScreenSong.SetChessboardScroll(); end; Inc(Index); end; - if not Self.Button[Self.Interaction].Visible then + if USongs.CatSongs.GetVisibleSongs() = 0 then + Self.SkipTo(0) + else if not Self.Button[Self.Interaction].Visible then begin Self.MinLine := Ceil((USongs.CatSongs.FindVisibleIndex(Self.Interaction) + 1 - Cols * Rows) / Cols); if (Line - Self.MinLine) > Rows then //to decrease line when push up (or pag up) key @@ -1377,12 +1404,20 @@ procedure TScreenSong.SetListScroll; Self.Statics[ListDuetIcon[I]].Visible := USongs.CatSongs.Song[B].isDuet; Self.Statics[ListRapIcon[I]].Texture.Alpha := Alpha; Self.Statics[ListRapIcon[I]].Visible := USongs.CatSongs.Song[B].hasRap; + Self.Statics[ListCreatorIcon[I]].Texture.Alpha := Alpha; + Self.Statics[ListCreatorIcon[I]].Visible := USongs.CatSongs.Song[B].Creator <> ''; + Self.Statics[ListFixerIcon[I]].Texture.Alpha := Alpha; + Self.Statics[ListFixerIcon[I]].Visible := USongs.CatSongs.Song[B].Fixer <> ''; Self.Text[ListTextArtist[I]].Alpha := Alpha; Self.Text[ListTextArtist[I]].Text := USongs.CatSongs.Song[B].Artist; Self.Text[ListTextTitle[I]].Alpha := Alpha; Self.Text[ListTextTitle[I]].Text := USongs.CatSongs.Song[B].Title; Self.Text[ListTextYear[I]].Alpha := Alpha; Self.Text[ListTextYear[I]].Text := IfThen(USongs.CatSongs.Song[B].Year <> 0, IntToStr(USongs.CatSongs.Song[B].Year), ''); + Self.Text[ListTextCreator[I]].Alpha := Alpha; + Self.Text[ListTextCreator[I]].Text := USongs.CatSongs.Song[B].Creator; + Self.Text[ListTextFixer[I]].Alpha := Alpha; + Self.Text[ListTextFixer[I]].Text := USongs.CatSongs.Song[B].Fixer; end else Self.UnloadCover(B); @@ -1395,15 +1430,51 @@ procedure TScreenSong.SetListScroll; procedure TScreenSong.OnShow(); var - I: integer; + Avatar: TAvatar; + Col: TRGB; + I, J: integer; Visible: boolean; begin inherited; if not Assigned(UGraphic.ScreenSongMenu) then //load the screens only the first time begin - UGraphic.ScreenSongMenu := TScreenSongMenu.Create(); - UGraphic.ScreenSongJumpto := TScreenSongJumpto.Create(); - UGraphic.ScreenPopupScoreDownload := TScreenPopupScoreDownload.Create(); + //TODO move avatar load to UAvatar + UIni.Ini.SingColor := UIni.Ini.PlayerColor; //FIXME remove this variable in all files + UNote.PlayersPlay:= UIni.IPlayersVals[UIni.Ini.Players]; //FIXME set this variable is needed to see avatars in scores screen! + J := 1; + for I := 1 to High(AvatarsList) do + if GetArrayIndex(UIni.Ini.PlayerAvatar, UpperCase(MD5Print(MD5File(AvatarsList[I].ToNative())))) <> -1 then + begin + Avatar := Avatars.FindAvatar(AvatarsList[I]); + if (Avatar <> nil) then + UAvatars.AvatarPlayerTextures[J] := Avatar.GetTexture() + else + begin + UAvatars.AvatarPlayerTextures[J] := UTexture.Texture.LoadTexture(Skin.GetTextureFileName('NoAvatar_P'+IntToStr(J)), TEXTURE_TYPE_TRANSPARENT, $FFFFFF); + Col := UThemes.GetPlayerColor(UIni.Ini.PlayerColor[J]); + UAvatars.AvatarPlayerTextures[J].ColR := Col.R; + UAvatars.AvatarPlayerTextures[J].ColG := Col.G; + UAvatars.AvatarPlayerTextures[J].ColB := Col.B; + end; + FreeAndNil(Avatar); + Inc(J); + end; + + for I := J to UIni.IPlayersVals[UIni.Ini.Players] do + begin + UAvatars.AvatarPlayerTextures[I] := UTexture.Texture.LoadTexture(Skin.GetTextureFileName('NoAvatar_P'+IntToStr(J)), TEXTURE_TYPE_TRANSPARENT, $FFFFFF); + Col := UThemes.GetPlayerColor(UIni.Ini.PlayerColor[I - 1]); + UAvatars.AvatarPlayerTextures[I].ColR := Col.R; + UAvatars.AvatarPlayerTextures[I].ColG := Col.G; + UAvatars.AvatarPlayerTextures[I].ColB := Col.B; + end; + UThemes.LoadPlayersColors(); + UThemes.Theme.ThemeScoreLoad(); + UGraphic.ScreenScore := UScreenScore.TScreenScore.Create(); + UGraphic.ScreenSing := UScreenSingController.TScreenSingController.Create(); + UGraphic.ScreenSongMenu := UScreenSongMenu.TScreenSongMenu.Create(); + UGraphic.ScreenSongJumpto := UScreenSongJumpto.TScreenSongJumpto.Create(); + UGraphic.ScreenPopupScoreDownload := UScreenPopup.TScreenPopupScoreDownload.Create(); end; Self.CloseMessage(); @@ -1436,8 +1507,7 @@ procedure TScreenSong.OnShow(); if Mode = smMedley then Mode := smNormal; - if Ini.Players <= 3 then PlayersPlay := Ini.Players + 1; - if Ini.Players = 4 then PlayersPlay := 6; + UNote.PlayersPlay := IfThen(UIni.Ini.Players = 4, 6, UIni.Ini.Players + 1); if Self.Mode = smPartyClassic then begin @@ -1491,6 +1561,9 @@ function TScreenSong.Draw: boolean; I, J: integer; Increment: real; begin + Result := true; + if (USongs.CatSongs.GetVisibleSongs() = 0) and (not UGraphic.ScreenSongJumpTo.Visible) then + Exit(); FadeMessage(); @@ -1672,8 +1745,6 @@ function TScreenSong.Draw: boolean; //if (Mode = smPartyTournament) then // PartyTimeLimit(); - - Result := true; end; procedure TScreenSong.StartPreview(); @@ -1806,13 +1877,13 @@ procedure TScreenSong.StartSong; procedure TScreenSong.SelectPlayers; begin - CatSongs.Selected := Interaction; + USongs.CatSongs.Selected := Self.Interaction; Self.StopPreview(); if not Assigned(UGraphic.ScreenPlayerSelector) then UGraphic.ScreenPlayerSelector := TScreenPlayerSelector.Create(); - UGraphic.ScreenPlayerSelector.Goto_SingScreen := true; - FadeTo(@UGraphic.ScreenPlayerSelector); + UGraphic.ScreenPlayerSelector.OpenedInOptions := false; + Self.FadeTo(@UGraphic.ScreenPlayerSelector); end; { Set teams jokers colors } @@ -1917,14 +1988,13 @@ procedure TScreenSong.SetScroll(Force: boolean = false); VisibilityNoList := Visibility and (UIni.TSongMenuMode(UIni.Ini.SongMenu) <> smList); Self.SetRangeVisibilityStatic(VisibilityNoList, [0, 2]); //0 arrow, 1 song info panel and 2 only for smChessboard down arrow - Self.SetRangeVisibilityStatic(VisibilityNoList, [Self.CalcMedleyIcon, Self.VideoIcon]); //icons + Self.SetRangeVisibilityStatic(VisibilityNoList, [Self.CalcMedleyIcon, Self.FixerIcon]); //icons Self.Statics[Self.MainCover].Visible := Visibility and (UIni.TSongMenuMode(UIni.Ini.SongMenu) in [smChessboard, smList, smMosaic]); Self.Text[Self.TextArtist].Visible := VisibilityNoList; Self.Text[Self.TextNoSongs].Visible := not Visibility; Self.Text[Self.TextNumber].Visible := Visibility; - Self.Text[Self.TextTitle].Visible := VisibilityNoList; - Self.Text[Self.TextYear].Visible := VisibilityNoList; - Self.SetRangeVisibility(Visibility and Self.FreeListMode(), [Self.StaticNonParty[0], Self.StaticNonParty[4]], [Self.TextNonParty[0], Self.TextNonParty[4]]); //set legend visibility + Self.SetRangeVisibilityText(VisibilityNoList, [Self.TextTitle, Self.TextFixer]); + Self.SetRangeVisibility(Visibility and Self.FreeListMode(), [Self.StaticNonParty[0], High(Self.StaticNonParty)], [Self.TextNonParty[0], High(Self.TextNonParty)]); //set legend visibility Self.SetRangeVisibility(false, [Self.Static6PlayersDuetSingerP6, Self.Static2PlayersDuetSingerP1], [Self.Text2PlayersDuetSingerP1, Self.Text3PlayersDuetSingerP3]); //hide duets for I := 0 to High(Self.StaticsList) do //hide items in smList, too after change from other mode begin @@ -1932,11 +2002,15 @@ procedure TScreenSong.SetScroll(Force: boolean = false); Self.Text[Self.ListTextArtist[I]].Text := ''; Self.Text[Self.ListTextTitle[I]].Text := ''; Self.Text[Self.ListTextYear[I]].Text := ''; + Self.Text[Self.ListTextCreator[I]].Text := ''; + Self.Text[Self.ListTextFixer[I]].Text := ''; Self.Statics[Self.ListCalcMedleyIcon[I]].Visible := false; Self.Statics[Self.ListDuetIcon[I]].Visible := false; Self.Statics[Self.ListMedleyIcon[I]].Visible := false; Self.Statics[Self.ListRapIcon[I]].Visible := false; Self.Statics[Self.ListVideoIcon[I]].Visible := false; + Self.Statics[Self.ListCreatorIcon[I]].Visible := false; + Self.Statics[Self.ListFixerIcon[I]].Visible := false; end; if Visibility then begin @@ -1948,8 +2022,12 @@ procedure TScreenSong.SetScroll(Force: boolean = false); Self.Statics[Self.MedleyIcon].Visible := (Song.Medley.Source = msTag) and not Song.isDuet; Self.Statics[Self.RapIcon].Visible := Song.hasRap; Self.Statics[Self.VideoIcon].Visible := Song.Video.IsSet; + Self.Statics[Self.CreatorIcon].Visible := Song.Creator <> ''; + Self.Statics[Self.FixerIcon].Visible := Song.Fixer <> ''; Self.Text[Self.TextArtist].Text := Song.Artist; //not visible on smList Self.Text[Self.TextYear].Text := IfThen(Song.Year <> 0, IntToStr(Song.Year), ''); + Self.Text[Self.TextCreator].Text := Song.Creator; + Self.Text[Self.TextFixer].Text := Song.Fixer; end; if (USongs.CatSongs.CatNumShow = -1) and (UIni.Ini.Tabs = 1) and Self.FreeListMode() then //list of categories begin @@ -2012,25 +2090,43 @@ procedure TScreenSong.SetScroll(Force: boolean = false); end; end; + Self.Text[Self.TextWebsite].text := UTF8Decode('UltraStar España'); //FIXME use the constant if (UIni.Ini.ShowScores > 0) and (Self.Mode = smNormal) and (not Song.isDuet) then //show scores begin - Self.Text[Self.TextMaxScoreLocal].Text := IntToStr(UDataBase.DataBase.ReadMaxScoreLocal(Song.Artist, Song.Title, UIni.Ini.PlayerLevel[0])); - Self.Text[Self.TextMediaScoreLocal].Text := IntToStr(UDataBase.DataBase.ReadAverageScoreLocal(Song.Artist, Song.Title, UIni.Ini.PlayerLevel[0])); - Self.Text[Self.TextScoreUserLocal].Text := UDataBase.DataBase.ReadUserScoreLocal(Song.Artist, Song.Title, UIni.Ini.PlayerLevel[0]); + Self.Text[Self.TextLocalScore1].Text := IntToStr(UDataBase.DataBase.ReadMaxScoreLocal(Song.Artist, Song.Title, UIni.Ini.PlayerLevel[0])); + Self.Text[Self.TextLocalScore2].Text := IntToStr(UDataBase.DataBase.ReadAverageScoreLocal(Song.Artist, Song.Title, UIni.Ini.PlayerLevel[0])); + Self.Text[Self.TextLocalScore3].Text := IntToStr(UDataBase.DataBase.ReadAverageScoreLocal(Song.Artist, Song.Title, UIni.Ini.PlayerLevel[0])); + Self.Text[Self.TextUserLocalScore1].Text := UDataBase.DataBase.ReadUserScoreLocal(Song.Artist, Song.Title, UIni.Ini.PlayerLevel[0]); + Self.Text[Self.TextUserLocalScore2].Text := UDataBase.DataBase.ReadUserScoreLocal(Song.Artist, Song.Title, UIni.Ini.PlayerLevel[0]); + Self.Text[Self.TextUserLocalScore3].Text := UDataBase.DataBase.ReadUserScoreLocal(Song.Artist, Song.Title, UIni.Ini.PlayerLevel[0]); + if (High(UDllManager.DLLMan.Websites) >= 0) then begin - Self.Text[Self.TextMaxScore2].Text := IntToStr(UDataBase.DataBase.ReadMaxScore(Song.Artist, Song.Title, DllMan.Websites[UIni.Ini.ShowWebScore].ID, UIni.Ini.PlayerLevel[0])); - Self.Text[Self.TextMediaScore2].Text := IntToStr(UDataBase.DataBase.ReadAverageScore(Song.Artist, Song.Title, DllMan.Websites[UIni.Ini.ShowWebScore].ID, UIni.Ini.PlayerLevel[0])); - Self.Text[Self.TextScore].Text := UTF8Encode(UDllManager.DLLMan.Websites[UIni.Ini.ShowWebScore].Name); - Self.Text[Self.TextScoreUser].Text := UDataBase.DataBase.ReadUser_Score(Song.Artist, Song.Title, DllMan.Websites[UIni.Ini.ShowWebScore].ID, UIni.Ini.PlayerLevel[0]); + Self.Text[Self.TextOnlineScore1].Text := IntToStr(UDataBase.DataBase.ReadMaxScore(Song.Artist, Song.Title, DllMan.Websites[UIni.Ini.ShowWebScore].ID, UIni.Ini.PlayerLevel[0])); + Self.Text[Self.TextOnlineScore2].Text := IntToStr(UDataBase.DataBase.ReadAverageScore(Song.Artist, Song.Title, DllMan.Websites[UIni.Ini.ShowWebScore].ID, UIni.Ini.PlayerLevel[0])); + Self.Text[Self.TextOnlineScore3].Text := IntToStr(UDataBase.DataBase.ReadMaxScore(Song.Artist, Song.Title, DllMan.Websites[UIni.Ini.ShowWebScore].ID, UIni.Ini.PlayerLevel[0])); + Self.Text[Self.TextUserOnlineScore1].Text := UDataBase.DataBase.ReadUser_Score(Song.Artist, Song.Title, DllMan.Websites[UIni.Ini.ShowWebScore].ID, UIni.Ini.PlayerLevel[0]); + Self.Text[Self.TextUserOnlineScore2].Text := UDataBase.DataBase.ReadUser_Score(Song.Artist, Song.Title, DllMan.Websites[UIni.Ini.ShowWebScore].ID, UIni.Ini.PlayerLevel[0]); + Self.Text[Self.TextUserOnlineScore3].Text := UDataBase.DataBase.ReadUser_Score(Song.Artist, Song.Title, DllMan.Websites[UIni.Ini.ShowWebScore].ID, UIni.Ini.PlayerLevel[0]); end; //show local score, web score and captions - Self.SetRangeVisibilityText((UIni.Ini.ShowScores = 2) or (Self.Text[Self.TextMaxScoreLocal].Text <> '0'), [Self.TextMaxScoreLocal, Self.TextScoreUserLocal]); - Self.SetRangeVisibilityText((UIni.Ini.ShowScores = 2) or (Self.Text[Self.TextMaxScore2].Text <> '0'), [Self.TextMaxScore2, Self.TextScoreUser]); - Self.SetRangeVisibilityText(Self.Text[Self.TextMaxScoreLocal].Visible or Self.Text[Self.TextMaxScore2].Visible, [Self.TextScore, Self.TextMediaScore]); + Self.SetRangeVisibilityText( + (UIni.Ini.ShowScores = 2) or (Self.Text[Self.TextLocalScore1].Text <> '0'), + [Self.TextUserLocalScore1, Self.TextLocalScore3] + ); + Self.Text[Self.TextMyScores].Visible := Self.Text[Self.TextUserLocalScore1].Visible; + Self.SetRangeVisibilityText( + (UIni.Ini.ShowScores = 2) or ((Self.Text[Self.TextOnlineScore1].Text <> '') and (Self.Text[Self.TextUserOnlineScore1].Text <> '0')), + [Self.TextUserOnlineScore1, Self.TextOnlineScore3] + ); + Self.Text[Self.TextWebsite].Visible := Self.Text[Self.TextUserOnlineScore1].Visible; + Self.SetRangeVisibilityText( + Self.Text[Self.TextOnlineScore1].Visible or Self.Text[Self.TextUserOnlineScore1].Visible, + [Self.TextOnlineScore1, Self.TextUserOnlineScore3] + ); end else - Self.SetRangeVisibilityText(false, [Self.TextMaxScore, Self.TextScoreUserLocal]); + Self.SetRangeVisibilityText(false, [Self.TextOnlineScore1, Self.TextOnlineScore2, Self.TextOnlineScore3, Self.TextUserOnlineScore1, Self.TextUserOnlineScore2, Self.TextUserOnlineScore3]); end; case UIni.TSongMenuMode(UIni.Ini.SongMenu) of smRoulette: Self.SetRouletteScroll(); diff --git a/src/screens/UScreenSongJumpto.pas b/src/screens/UScreenSongJumpto.pas index 7c409ea4..91a3607a 100644 --- a/src/screens/UScreenSongJumpto.pas +++ b/src/screens/UScreenSongJumpto.pas @@ -25,28 +25,19 @@ interface -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} +{$MODE OBJFPC} {$I switches.inc} uses sdl2, - SysUtils, - UMenu, - UDisplay, - UMusic, - UFiles, - USongs, - UThemes; + UMenu; type TScreenSongJumpto = class(TMenu) private //For ChangeMusic fVisible: boolean; - fSelectType: TSongFilter; procedure SetTextFound(); //Visible //Whether the Menu should be Drawn @@ -66,108 +57,49 @@ implementation uses UGraphic, - UMain, - UIni, - UTexture, - ULanguage, - UParty, - UScreenSong, - ULog, + UMusic, + USongs, + UThemes, UUnicodeUtils; function TScreenSongJumpto.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; begin Result := true; - if (PressedDown) then - begin // Key Down - // check normal keys - if (IsAlphaNumericChar(CharCode) or - IsPunctuationChar(CharCode)) then + if PressedDown then + begin + if UUnicodeUtils.IsPrintableChar(CharCode) and (Self.Interaction = 0) and (Length(Self.Text[1].Text) < 25) then begin - if (Interaction = 0) then - begin - Button[0].Text[0].ColR := Theme.SongJumpto.ButtonSearchText.ColR; - Button[0].Text[0].ColG := Theme.SongJumpto.ButtonSearchText.ColG; - Button[0].Text[0].ColB := Theme.SongJumpto.ButtonSearchText.ColB; - Button[0].Text[0].Text := Button[0].Text[0].Text + UCS4ToUTF8String(CharCode); - Self.SetTextFound(); - end; - end; - - // check special keys - case PressedKey of - SDLK_BACKSPACE: - begin - if (Interaction = 0) and (Length(Button[0].Text[0].Text) > 0) then + Self.Text[0].Visible := false; + Self.Text[1].Text := Self.Text[1].Text+UUnicodeUtils.UCS4ToUTF8String(CharCode); + Self.SetTextFound(); + end + else + case PressedKey of + SDLK_BACKSPACE: begin - Button[0].Text[0].DeleteLastLetter(); + Self.Text[1].DeleteLastLetter(); Self.SetTextFound(); end; - end; - - SDLK_RETURN, - SDLK_ESCAPE: - begin - Visible := false; - AudioPlayback.PlaySound(SoundLib.Back); - if (USongs.CatSongs.GetVisibleSongs() = 0) and (Length(Self.Button[0].Text[0].Text) > 0) then + SDLK_RETURN, + SDLK_ESCAPE: begin - Self.Button[0].Text[0].Text := ''; - Self.SetTextFound(); + Self.Visible := false; + UMusic.AudioPlayback.PlaySound(UMusic.SoundLib.Back); + if (USongs.CatSongs.GetVisibleSongs() = 0) and (Self.Text[1].Text <> '') then + begin + Self.Text[1].Text := ''; + Self.SetTextFound(); + end; end; - end; - - SDLK_DOWN: - begin - {SelectNext; - Button[0].Text[0].Selected := (Interaction = 0);} - end; - - SDLK_UP: - begin - {SelectPrev; - Button[0].Text[0].Selected := (Interaction = 0); } - end; - - SDLK_RIGHT: - begin - Interaction := 1; - InteractInc; - if (Length(Button[0].Text[0].Text) > 0) then - Self.SetTextFound(); - Interaction := 0; - end; - SDLK_LEFT: - begin - Interaction := 1; - InteractDec; - if (Length(Button[0].Text[0].Text) > 0) then - Self.SetTextFound(); - Interaction := 0; - end; - end; + end; end; end; constructor TScreenSongJumpto.Create; -var - ButtonID: integer; begin inherited Create; - - LoadFromTheme(Theme.SongJumpto); - - ButtonID := AddButton(Theme.SongJumpto.ButtonSearchText); - - if (Length(Button[0].Text) = 0) then - AddButtonText(14, 20, ''); - - Button[ButtonID].Text[0].Writable := true; - - fSelectType := sfAll; - AddSelectSlide(Theme.SongJumpto.SelectSlideType, PInteger(@fSelectType)^, []); - - Interaction := 0; + Self.LoadFromTheme(UThemes.Theme.SongJumpto); + Self.Text[1].Writable := true; end; procedure TScreenSongJumpto.SetVisible(Value: boolean); @@ -182,28 +114,19 @@ procedure TScreenSongJumpto.SetVisible(Value: boolean); procedure TScreenSongJumpto.OnShow; begin inherited; - - //Reset Screen if no Old Search is Displayed - if (CatSongs.CatNumShow <> -2) then - begin - SelectsS[0].SetSelectOpt(0); - - Button[0].Text[0].Text := ''; - end; - - //Select Input - Interaction := 0; - Button[0].Text[0].Selected := true; + if (USongs.CatSongs.CatNumShow <> -2) then + Self.Text[1].Text := ''; end; function TScreenSongJumpto.Draw: boolean; begin + Self.Text[0].Visible := Self.Text[1].Text = ''; Result := inherited Draw; end; procedure TScreenSongJumpto.SetTextFound(); begin - UGraphic.ScreenSong.SetSubselection(Self.Button[0].Text[0].Text, fSelectType); + UGraphic.ScreenSong.SetSubselection(Self.Text[1].Text) end; end. diff --git a/src/screens/UScreenSongMenu.pas b/src/screens/UScreenSongMenu.pas index ad6a3bc2..b596d818 100644 --- a/src/screens/UScreenSongMenu.pas +++ b/src/screens/UScreenSongMenu.pas @@ -50,6 +50,7 @@ TScreenSongMenu = class(TMenu) constructor Create; override; function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; + function ParseMouse(MouseButton: integer; BtnDown: boolean; X, Y: integer): boolean; procedure MenuShow(sMenu: byte); procedure HandleReturn; function CountMedleySongs: integer; @@ -78,6 +79,8 @@ TScreenSongMenu = class(TMenu) SM_Sorting = 64 or 32; SM_Jukebox = 64 or 128; + SM_Search_new_songs = 64 or 7; + var ISelections1: array of UTF8String; SelectValue1: integer; @@ -92,6 +95,7 @@ implementation uses Math, + UCommon, UDatabase, UGraphic, UMain, @@ -170,6 +174,36 @@ function TScreenSongMenu.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pr end; end; +function TScreenSongMenu.ParseMouse(MouseButton: integer; BtnDown: boolean; X, Y: integer): boolean; +var + I: integer; +begin + Result := true; + if BtnDown then + begin + Self.TransferMouseCords(X, Y); + case MouseButton of + SDL_BUTTON_LEFT: + Self.ParseInput(SDLK_RETURN, 0, true); + SDL_BUTTON_RIGHT, + SDL_BUTTON_MIDDLE: + if Self.RightMbESC then + Result := Self.ParseInput(SDLK_ESCAPE, 0, true); + SDL_BUTTON_WHEELDOWN: + Self.ParseInput(SDLK_LEFT, 0, true); + SDL_BUTTON_WHEELUP: + Self.ParseInput(SDLK_RIGHT, 0, true); + end; + end + else + begin + Self.TransferMouseCords(X, Y); + I := Self.InteractAt(X, Y); + if (I >= 0) and (I <> Interaction) then + Self.SetInteraction(I); + end; +end; + constructor TScreenSongMenu.Create; begin inherited Create; @@ -212,6 +246,10 @@ constructor TScreenSongMenu.Create; if (Length(Button[4].Text) = 0) then AddButtonText(14, 20, 'Button 5'); + AddButton(Theme.SongMenu.Button6); + if (Length(Button[5].Text) = 0) then + AddButtonText(14, 20, 'Button 6'); + Interaction := 0; end; @@ -261,19 +299,30 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Text[0].Text := Language.Translate('SONG_MENU_NAME_MAIN'); Button[0].Visible := true; - Button[1].Visible := ((Length(PlaylistMedley.Song) > 0) or (CatSongs.Song[ScreenSong.Interaction].Medley.Source > msNone)); + Button[1].Visible := true; Button[2].Visible := true; Button[3].Visible := true; - Button[4].Visible := false; + Button[4].Visible := true; + Button[5].Visible := ((Length(PlaylistMedley.Song) > 0) or (CatSongs.Song[ScreenSong.Interaction].Medley.Source > msNone)); SelectsS[0].Visible := false; SelectsS[1].Visible := false; SelectsS[2].Visible := false; - Button[0].Text[0].Text := Language.Translate('SONG_MENU_SONG'); - Button[1].Text[0].Text := Language.Translate('SONG_MENU_MEDLEY'); - Button[2].Text[0].Text := Language.Translate('SONG_MENU_REFRESH_SCORES'); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_NAME_SORTING'); + //Reset buttons from other sections + Button[0].Selectable := true; + Button[1].Selectable := true; + Button[2].Selectable := true; + Button[3].Selectable := true; + Button[4].Selectable := true; + Button[5].Selectable := true; + + Button[0].Text[0].Text := Language.Translate('C_SELECT_THIS_SONG'); + Button[1].Text[0].Text := Language.Translate('C_SORT_SONGS'); + Button[2].Text[0].Text := Language.Translate('C_REFRESH_SCORES'); + Button[3].Text[0].Text := Language.Translate('C_SEARCH_NEW_SONGS'); + Button[4].Text[0].Text := Language.Translate('C_OPEN_PLAYLIST'); + Button[5].Text[0].Text := Language.Translate('C_SING_MEDLEY'); end; SM_Song: @@ -286,6 +335,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[2].Visible := true; Button[3].Visible := false; Button[4].Visible := true; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; @@ -294,7 +344,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY'); Button[1].Text[0].Text := Language.Translate('SONG_MENU_CHANGEPLAYERS'); Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD'); - Button[4].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + Button[4].Text[0].Text := Language.Translate('C_BACK'); end; SM_Medley: @@ -302,7 +352,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); CurMenu := sMenu; MSongs := CountMedleySongs; - Text[0].Text := Language.Translate('SONG_MENU_NAME_MEDLEY'); + Text[0].Text := Language.Translate('C_MEDLEY'); Button[0].Visible := (CatSongs.Song[ScreenSong.Interaction].Medley.Source > msNone); Button[1].Visible := (Length(PlaylistMedley.Song)>0); @@ -310,43 +360,45 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); (CatSongs.Song[ScreenSong.Interaction].Medley.Source > msNone); Button[3].Visible := (not ScreenSong.MakeMedley) and (MSongs > 1); Button[4].Visible := true; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; SelectsS[2].Visible := false; - Button[0].Text[0].Text := Language.Translate('SONG_MENU_ADD_SONG'); + Button[0].Text[0].Text := Language.Translate('SONG_MENU_ADD_SONG_TO_LIST'); Button[1].Text[0].Text := Language.Translate('SONG_MENU_DELETE_SONG'); Button[2].Text[0].Text := Language.Translate('SONG_MENU_START_MEDLEY'); Button[3].Text[0].Text := Format(Language.Translate('SONG_MENU_START_5_MEDLEY'), [MSongs]); - Button[4].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + Button[4].Text[0].Text := Language.Translate('C_BACK'); end; SM_Sorting: begin CurMenu := sMenu; - Self.Text[0].Text := Language.Translate('SONG_MENU_NAME_SORTING'); + Self.Text[0].Text := Language.Translate('C_SORT_SONGS'); Self.Button[0].Visible := false; Self.Button[1].Visible := false; Self.Button[2].Visible := false; Self.Button[3].Visible := true; Self.Button[4].Visible := true; + Self.Button[5].Visible := false; Self.SelectsS[0].Visible := true; Self.SelectsS[1].Visible := true; Self.SelectsS[2].Visible := true; SetLength(ISelections1, 2); - ISelections1[0] := ULanguage.Language.Translate('SING_OPTIONS_GAME_TABS')+': '+ULanguage.Language.Translate('OPTION_VALUE_OFF'); - ISelections1[1] := ULanguage.Language.Translate('SING_OPTIONS_GAME_TABS')+': '+ULanguage.Language.Translate('OPTION_VALUE_ON'); + ISelections1[0] := ULanguage.Language.Translate('SING_OPTIONS_GAME_TABS')+': '+ULanguage.Language.Translate('C_NO'); + ISelections1[1] := ULanguage.Language.Translate('SING_OPTIONS_GAME_TABS')+': '+ULanguage.Language.Translate('C_YES'); SetLength(ISelections2, Length(UIni.ISorting)); For I := 0 to High(UIni.ISorting) do ISelections2[I] := ULanguage.Language.Translate('SING_OPTIONS_GAME_SORTING')+': '+ULanguage.Language.Translate('OPTION_VALUE_'+UIni.ISorting[I]); SetLength(ISelections3, 2); - ISelections3[0] := ULanguage.Language.Translate('SING_OPTIONS_GAME_DUETS')+': '+ULanguage.Language.Translate('OPTION_VALUE_ON'); - ISelections3[1] := ULanguage.Language.Translate('SING_OPTIONS_GAME_DUETS')+': '+ULanguage.Language.Translate('OPTION_VALUE_OFF'); + ISelections3[0] := ULanguage.Language.Translate('SING_OPTIONS_GAME_DUETS')+': '+ULanguage.Language.Translate('C_YES'); + ISelections3[1] := ULanguage.Language.Translate('SING_OPTIONS_GAME_DUETS')+': '+ULanguage.Language.Translate('C_NO'); SelectValue1 := UIni.Ini.Tabs; SelectValue2 := UIni.Ini.Sorting; @@ -355,8 +407,8 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Self.UpdateSelectSlideOptions(UThemes.Theme.SongMenu.SelectSlide2, 1, ISelections2, SelectValue2); Self.UpdateSelectSlideOptions(UThemes.Theme.SongMenu.SelectSlide3, 2, ISelections3, SelectValue3); - Self.Button[3].Text[0].Text := ULanguage.Language.Translate('SONG_MENU_SORTING_APPLY'); - Self.Button[4].Text[0].Text := ULanguage.Language.Translate('SONG_MENU_CANCEL'); + Self.Button[3].Text[0].Text := ULanguage.Language.Translate('C_APPLY_CHANGES'); + Self.Button[4].Text[0].Text := ULanguage.Language.Translate('C_BACK'); Self.Interaction := 3; end; @@ -371,6 +423,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[2].Visible := true; Button[3].Visible := true; Button[4].Visible := false; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; @@ -391,6 +444,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[2].Visible := false; Button[3].Visible := true; Button[4].Visible := true; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; @@ -398,7 +452,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD_NEW'); Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD_EXISTING'); - Button[4].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + Button[4].Text[0].Text := Language.Translate('C_BACK'); SetLength(ISelections3, Length(PlaylistMan.Playlists)); PlaylistMan.GetNames(ISelections3); @@ -428,6 +482,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[2].Visible := false; Button[3].Visible := true; Button[4].Visible := true; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; @@ -435,7 +490,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[1].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NEW_UNNAMED'); Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NEW_CREATE'); - Button[4].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + Button[4].Text[0].Text := Language.Translate('C_BACK'); Interaction := 1; end; @@ -450,19 +505,20 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[2].Visible := false; Button[3].Visible := true; Button[4].Visible := false; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; SelectsS[2].Visible := false; Button[0].Text[0].Text := Language.Translate('SONG_MENU_YES'); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + Button[3].Text[0].Text := Language.Translate('C_BACK'); end; SM_Playlist_Load: begin CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_NAME_PLAYLIST_LOAD'); + Text[0].Text := Language.Translate('C_PLAYLIST'); // show delete curent playlist button when playlist is opened Button[0].Visible := (CatSongs.CatNumShow = -3); @@ -470,7 +526,8 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[1].Visible := false; Button[2].Visible := false; Button[3].Visible := true; - Button[4].Visible := false; + Button[4].Visible := true; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; @@ -478,6 +535,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_DELCURRENT'); Button[3].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_LOAD'); + Button[4].Text[0].Text := Language.Translate('C_BACK'); SetLength(ISelections3, Length(PlaylistMan.Playlists)); PlaylistMan.GetNames(ISelections3); @@ -489,13 +547,17 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); end else begin - Button[3].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; + SelectsS[2].Visible := false; Button[2].Visible := true; Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_NOEXISTING'); - Interaction := 2; + Button[2].Selectable := false; + + Button[3].Visible := false; + + Interaction := 7; end; end; @@ -509,13 +571,14 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[2].Visible := false; Button[3].Visible := true; Button[4].Visible := false; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; SelectsS[2].Visible := false; Button[0].Text[0].Text := Language.Translate('SONG_MENU_YES'); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + Button[3].Text[0].Text := Language.Translate('C_BACK'); end; SM_Party_Main: @@ -528,6 +591,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[2].Visible := false; Button[3].Visible := true; Button[4].Visible := false; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; @@ -549,6 +613,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[2].Visible := (Length(Party.Teams) >= 3) AND (Party.Teams[2].JokersLeft > 0); Button[3].Visible := True; Button[4].Visible := false; + Button[5].Visible := false; SelectsS[0].Visible := False; SelectsS[1].Visible := False; @@ -560,7 +625,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[1].Text[0].Text := UTF8String(Party.Teams[1].Name); if (Button[2].Visible) then Button[2].Text[0].Text := UTF8String(Party.Teams[2].Name); - Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL'); + Button[3].Text[0].Text := Language.Translate('C_BACK'); // set right interaction if (not Button[0].Visible) then @@ -581,19 +646,21 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); SM_Refresh_Scores: begin CurMenu := sMenu; - Text[0].Text := Language.Translate('SONG_MENU_REFRESH_SCORES_TITLE'); + Text[0].Text := Language.Translate('C_REFRESH_SCORES'); Button[0].Visible := false; Button[1].Visible := false; - Button[2].Visible := false; + Button[2].Visible := true; Button[3].Visible := false; Button[4].Visible := true; + Button[5].Visible := false; SelectsS[0].Visible := true; SelectsS[1].Visible := true; SelectsS[2].Visible := true; - Button[4].Text[0].Text := Language.Translate('SONG_MENU_REFRESH_SCORES_REFRESH'); + Button[2].Text[0].Text := Language.Translate('SONG_MENU_REFRESH_SCORES_REFRESH'); + Button[4].Text[0].Text := Language.Translate('C_BACK'); if (High(DataBase.NetworkUser) > 0) then SetLength(ISelections3, Length(DataBase.NetworkUser) + 1) @@ -627,7 +694,7 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); SelectsS[1].Visible := false; SelectsS[2].Visible := false; Button[2].Visible := true; - Button[2].Text[0].Text := Language.Translate('SONG_MENU_REFRESH_SCORES_NO_WEB'); + Button[2].Text[0].Text := Language.Translate('C_NO_INTERNET_CONNECTION'); Button[2].Selectable := false; Button[3].Text[0].Text := ULanguage.Language.Translate('SING_OPTIONS_NETWORK_DESC'); Interaction := 7; @@ -643,6 +710,8 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Button[1].Visible := false; Button[2].Visible := false; Button[3].Visible := false; + Button[4].Visible := false; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; @@ -660,8 +729,11 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); UpdateJukeboxButtons(); Button[0].Visible := (UIni.Ini.Tabs = 1); + Button[1].Visible := false; + Button[2].Visible := true; Button[3].Visible := false; - Button[4].Visible := true; + Button[4].Visible := false; + Button[5].Visible := false; SelectsS[0].Visible := false; SelectsS[1].Visible := false; @@ -678,6 +750,12 @@ procedure TScreenSongMenu.MenuShow(sMenu: byte); Interaction := 1; end; + + SM_Search_new_songs: + begin + Self.FadeTo(@UGraphic.ScreenMain); + UGraphic.ScreenMain.ReloadSongs(); + end; end; end; @@ -690,22 +768,18 @@ procedure TScreenSongMenu.HandleReturn; begin case Interaction of 0: // button 1 - begin MenuShow(SM_Song); - end; - 1: // button 2 - begin - MenuShow(SM_Medley); - end; - + Self.MenuShow(SM_Sorting); 2: // button 3 - begin // show refresh scores menu MenuShow(SM_Refresh_Scores); - end; - 6: - Self.MenuShow(SM_Sorting); + 6: // button 4 + MenuShow(SM_Search_new_songs); + 7: // button 5 + MenuShow(SM_Playlist_Load); + 8: // button 6 + MenuShow(SM_Medley); end; end; @@ -862,6 +936,7 @@ procedure TScreenSongMenu.HandleReturn; begin // dummy end; + end; end; @@ -889,6 +964,7 @@ procedure TScreenSongMenu.HandleReturn; // show song menu MenuShow(SM_Song); end; + end; end; @@ -949,6 +1025,11 @@ procedure TScreenSongMenu.HandleReturn; UGraphic.ScreenSong.SetSubselection(SelectValue3, sfPlaylist); Visible := false; end; + 7: // button 5 + begin + Button[4].Selectable := true; + MenuShow(SM_Main); + end; end; end; diff --git a/src/screens/controllers/UScreenSingController.pas b/src/screens/controllers/UScreenSingController.pas index e3d7475e..22ef9397 100644 --- a/src/screens/controllers/UScreenSingController.pas +++ b/src/screens/controllers/UScreenSingController.pas @@ -82,7 +82,7 @@ TMusicSyncSource = class(TSyncSource) TScreenSingController = class(TMenu) private - StartNote, EndNote: TPos; + StartNote: TPos; procedure LoadNextSong(); @@ -216,7 +216,6 @@ implementation function TScreenSingController.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; var - SDL_ModState: word; i1: integer; Color: TRGB; begin @@ -224,10 +223,6 @@ function TScreenSingController.ParseInput(PressedKey: Cardinal; CharCode: UCS4Ch if (PressedDown) then begin // key down - SDL_ModState := SDL_GetModState and (KMOD_LSHIFT + KMOD_RSHIFT - + KMOD_LCTRL + KMOD_RCTRL + KMOD_LALT + KMOD_RALT); - - // check normal keys case UCS4UpperCase(CharCode) of Ord('Q'): @@ -463,10 +458,6 @@ procedure TScreenSingController.Pause; end; constructor TScreenSingController.Create; -var - - I: integer; - Color: cardinal; begin inherited Create; ScreenSing := self; @@ -507,8 +498,6 @@ procedure TScreenSingController.OnShow; V5DuetSixP: boolean; V6DuetSixP: boolean; BadPlayer: integer; - Col_Sty_Up, Col_Sty_Sing, Col_Sty_dn: TRGB; //stylized typo color - Col_Out_Up, Col_Out_Sing, Col_Out_dn: TRGB; //Outline typo color I: integer; begin inherited; @@ -736,7 +725,7 @@ procedure TScreenSingController.OnShow; procedure TScreenSingController.onShowFinish; var - I, Index: integer; + Index: integer; begin // hide cursor on singscreen show //Display.SetCursor; @@ -900,7 +889,10 @@ procedure TScreenSingController.LoadNextSong(); begin found := false; - + Result.part := 0; + Result.line := 0; + Result.note := 0; + Result.CP := 0; for line := 0 to length(CurrentSong.Lines[0].Line) - 1 do begin for note := 0 to length(CurrentSong.Lines[0].Line[line].Note) - 1 do @@ -1427,7 +1419,7 @@ procedure TScreenSingController.OnSentenceEnd(CP: integer; SentenceIndex: cardin LineBonus: real; MaxSongScore: integer; // max. points for the song (without line bonus) MaxLineScore: real; // max. points for the current line - Index: integer; + // Index: integer; const // TODO: move this to a better place MAX_LINE_RATING = 8; // max. rating for singing performance diff --git a/src/switches.inc b/src/switches.inc index 23c8520d..7dfb6967 100644 --- a/src/switches.inc +++ b/src/switches.inc @@ -23,67 +23,27 @@ // prevent pasdoc from parsing this file {$IFNDEF PASDOC} -// compiler/IDE dependent config -{$IFDEF FPC} - {$H+} // use AnsiString instead of ShortString as String-type (default in Delphi) +//FPC compiler config +{$H+} // use AnsiString instead of ShortString as String-type (default in Delphi) - // if -dDEBUG is specified on the command-line, FPC uses some default - // compiler-flags specified in fpc.cfg -> use -dDEBUG_MODE instead - {$IFDEF DEBUG_MODE} - {$DEFINE DEBUG} - {$ENDIF} - - {$DEFINE HasInline} -{$ELSE} - {$DEFINE Delphi} - - // Delphi version numbers (ignore Delphi < 7 and Delphi 8 (VER160)) - - {$IF Defined(VER180)} // Delphi 2006 (=10) - {$DEFINE DELPHI_10} - {$DEFINE DELPHI_7_UP} - {$DEFINE DELPHI_9_UP} - {$DEFINE DELPHI_10_UP} - {$ELSEIF Defined(VER170)} // Delphi 2005 (=9) - {$DEFINE DELPHI_9} - {$DEFINE DELPHI_7_UP} - {$DEFINE DELPHI_9_UP} - {$ELSEIF Defined(VER150)} - {$DEFINE DELPHI_7} - {$DEFINE DELPHI_7_UP} - {$ELSE} // unsupported - {$WARN ERROR 'Unsupported compiler version'} - {$IFEND} - - // inline directive introduced with Delphi 2005 - {$IFDEF DELPHI_9_UP} - {$DEFINE HasInline} - {$ENDIF} +// if -dDEBUG is specified on the command-line, FPC uses some default +// compiler-flags specified in fpc.cfg -> use -dDEBUG_MODE instead +{$IFDEF DEBUG_MODE} + {$DEFINE DEBUG} {$ENDIF} +{$DEFINE HasInline} // platform dependent config {$IF Defined(MSWINDOWS)} // include defines but no constants {$I config-win.inc} - - // enable debug-mode. For development only! - {.$DEFINE DEBUG} - {$IFDEF DEBUG} - // windows apps are either GUI- or console-apps. Console-apps will open - // an additional console-window for output. For development only! - {$DEFINE CONSOLE} - {$ENDIF} - - {$DEFINE HaveBASS} {$ELSEIF Defined(DARWIN)} // include defines but no constants {$I config-darwin.inc} // enable debug-mode. For development only! {.$DEFINE DEBUG} - {$DEFINE CONSOLE} - {.$DEFINE HaveBASS} {$DEFINE UTF8_FILENAMES} {$ELSEIF Defined(UNIX)} // include defines but no constants @@ -96,57 +56,10 @@ // use "configure --enable-debug", "make debug" or // the command-line parameter "-debug" instead of defining DEBUG directly {.$DEFINE DEBUG} - // linux apps are always console-apps so leave this defined. - {$DEFINE CONSOLE} {$IFEND} -// audio config -{$IF Defined(HaveBASS)} - {$DEFINE UseBASSPlayback} - {$DEFINE UseBASSDecoder} - {$DEFINE UseBASSInput} -{$ELSEIF Defined(HavePortaudio)} - {$DEFINE UseSDLPlayback} - {.$DEFINE UsePortaudioPlayback} - {$DEFINE UsePortaudioInput} - {$IFDEF HavePortmixer} - {$DEFINE UsePortmixer} - {$ENDIF} -{$IFEND} - -// ffmpeg config -{$IFDEF HaveFFmpeg} - {$DEFINE UseFFmpegDecoder} - {$DEFINE UseFFmpegVideo} - {$IFDEF HaveSWResample} - {$DEFINE UseSWResample} - {$ENDIF} - {$IFDEF HaveSWScale} - {$DEFINE UseSWScale} - {$ENDIF} -{$ENDIF} - -{$IFDEF HaveLibsamplerate} - {$DEFINE UseSRCResample} -{$ENDIF} - // projectM config {$IF Defined(HaveProjectM)} {$DEFINE UseProjectM} {$IFEND} - -// specify some useful defines - -{$IF Defined(UseFFmpegVideo) or Defined(UseFFmpegDecoder)} - {$DEFINE UseFFmpeg} -{$IFEND} - -{$IF Defined(UseBASSInput) or Defined(UseBASSPlayback) or Defined(UseBASSDecoder)} - {$DEFINE UseBASS} -{$IFEND} - -{$IF Defined(UsePortaudioInput) or Defined(UsePortaudioPlayback)} - {$DEFINE UsePortaudio} -{$IFEND} - {$ENDIF PASDOC} diff --git a/test/TestPortAudioDevice.pas b/test/TestPortAudioDevice.pas deleted file mode 100644 index ba394383..00000000 --- a/test/TestPortAudioDevice.pas +++ /dev/null @@ -1,528 +0,0 @@ -{* UltraStar Deluxe - Karaoke Game - * - * UltraStar Deluxe is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - *} - -program TestPortAudioDevice; - -{* TestPortAudioDevice does some basic tests of the portaudio libs. - * If all works, it lists all audio input and output devices and their - * characteristics. Compile and run with simple commands. - *} - -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} - -uses - SysUtils, - ctypes, - crt, - math, - PortAudio in '../src/lib/portaudio/portaudio.pas'; - -const - paDefaultApi = -1; - - ApiPreferenceOrder: -{$IF Defined(MSWINDOWS)} - // Note1: Portmixer has no mixer support for paASIO and paWASAPI at the moment - // Note2: Windows Default-API is MME, but DirectSound is faster - array[0..0] of TPaHostApiTypeId = ( paDirectSound ); -{$ELSEIF Defined(DARWIN)} - array[0..0] of TPaHostApiTypeId = ( paDefaultApi ); // paCoreAudio -{$ELSEIF Defined(UNIX)} - // Note: Portmixer has no mixer support for JACK at the moment - array[0..2] of TPaHostApiTypeId = ( paALSA, paJACK, paOSS ); -{$ELSE} - array[0..0] of TPaHostApiTypeId = ( paDefaultApi ); -{$IFEND} - - standardSampleRates: array[1..13] of cdouble = - ( 8000.0, 9600.0, 11025.0, 12000.0, 16000.0, - 22050.0, 24000.0, 32000.0, 44100.0, 48000.0, - 88200.0, 96000.0, 192000.0 - ); - - SampleFormat: array[1..8] of culong = - (paFloat32, paInt32, paInt24, paInt16, paInt8, paUInt8, - paCustomFormat, paNonInterleaved - ); - SampleFormatName: array[1..8] of string = - ('paFloat32', 'paInt32', 'paInt24', 'paInt16', 'paInt8', 'paUInt8', - 'paCustomFormat', 'paNonInterleaved' - ); - -var - i, j: integer; - PaError: TPaError; - paApiIndex: TPaHostApiIndex; - paApiInfo: PPaHostApiInfo; - deviceIndex: TPaDeviceIndex; - deviceInfo: PPaDeviceInfo; - inputParameters: PPaStreamParameters; - outputParameters: PPaStreamParameters; - sampleRate: cdouble; - stream: PPaStream; - framesPerBuffer: culong; - streamFlags: TPaStreamFlags; - streamCallback: PPaStreamCallback; - callbackStartTime: TDateTime; - callbackWorks: boolean; - userData: Pointer; - - -function GetPreferredApiIndex(): TPaHostApiIndex; -var - i: integer; - apiIndex: TPaHostApiIndex; - apiInfo: PPaHostApiInfo; -begin - result := -1; - - // select preferred sound-API - for i:= 0 to High(ApiPreferenceOrder) do - begin - if (ApiPreferenceOrder[i] <> paDefaultApi) then - begin - // check if API is available - apiIndex := Pa_HostApiTypeIdToHostApiIndex(ApiPreferenceOrder[i]); - if (apiIndex >= 0) then - begin - // we found an API but we must check if it works - // (on linux portaudio might detect OSS but does not provide - // any devices if ALSA is enabled) - apiInfo := Pa_GetHostApiInfo(apiIndex); - if (apiInfo^.deviceCount > 0) then - begin - Result := apiIndex; - break; - end; - end; - end; - end; - - // None of the preferred APIs is available -> use default - if (result < 0) then - begin - result := Pa_GetDefaultHostApi(); - end; -end; - -{ -type - TAudioSampleFormat = ( - asfU8, asfS8, // unsigned/signed 8 bits - asfU16LSB, asfS16LSB, // unsigned/signed 16 bits (endianness: LSB) - asfU16MSB, asfS16MSB, // unsigned/signed 16 bits (endianness: MSB) - asfU16, asfS16, // unsigned/signed 16 bits (endianness: System) - asfS32, // signed 32 bits (endianness: System) - asfFloat, // float - asfDouble // double - ); - TAudioFormatInfo = ; - TAudioInputDevice = record - AudioFormat: TAudioFormatInfo; // capture format info (e.g. 44.1kHz SInt16 stereo) - CaptureChannel: array of TCaptureBuffer; // sound-buffer references used for mono or stereo channel's capture data - end; - -procedure HandleMicrophoneData(Buffer: PByteArray; Size: integer; InputDevice: TAudioInputDevice); -var - MultiChannelBuffer: PByteArray; // buffer handled as array of bytes (offset relative to channel) - SingleChannelBuffer: PByteArray; // temporary buffer for new samples per channel - SingleChannelBufferSize: integer; - ChannelIndex: integer; - CaptureChannel: TCaptureBuffer; - AudioFormat: TAudioFormatInfo; - SampleSize: integer; - SamplesPerChannel: integer; - i: integer; -begin - AudioFormat := InputDevice.AudioFormat; - SampleSize := AudioSampleSize[AudioFormat.Format]; - SamplesPerChannel := Size div AudioFormat.FrameSize; - - SingleChannelBufferSize := SamplesPerChannel * SampleSize; - GetMem(SingleChannelBuffer, SingleChannelBufferSize); - - // process channels - for ChannelIndex := 0 to High(InputDevice.CaptureChannel) do - begin - CaptureChannel := InputDevice.CaptureChannel[ChannelIndex]; - // check if a capture buffer was assigned, otherwise there is nothing to do - if (CaptureChannel <> nil) then - begin - // set offset according to channel index - MultiChannelBuffer := @Buffer[ChannelIndex * SampleSize]; - // separate channel-data from interleaved multi-channel (e.g. stereo) data - for i := 0 to SamplesPerChannel-1 do - begin - Move(MultiChannelBuffer[i*AudioFormat.FrameSize], - SingleChannelBuffer[i*SampleSize], - SampleSize); - end; - CaptureChannel.ProcessNewBuffer(SingleChannelBuffer, SingleChannelBufferSize); - end; - end; - - FreeMem(SingleChannelBuffer); -end; -} - -procedure TestInitTerminate(); -begin - writeln ('*** Test of Pa_Initialize and Pa_Terminate ***'); - PaError := Pa_Initialize; - if PaError = paNoError then - writeln ('Pa_Initialize: No error') - else - writeln ('Pa_Initialize: Error No ', PaError); - - PaError := Pa_Terminate; - if PaError = paNoError then - writeln ('Pa_Terminate: No error') - else - writeln ('Pa_Terminate: Error No: ', PaError); - writeln; -end; - -procedure TestErrorText(); -begin - writeln ('*** Test of Pa_GetErrorText ***'); - PaError := Pa_Initialize; - writeln ('paNoError (0): ', Pa_GetErrorText(PaError)); - writeln; - writeln ('Code Text'); - writeln ('------------------------------------'); - i := paNotInitialized; - repeat - writeln (i:6, ' ', Pa_GetErrorText(i)); - i := succ(i); - until SameText(Pa_GetErrorText(i), 'Invalid error code') or (i = paNotInitialized + 100); - writeln (i:6, ' ', Pa_GetErrorText(i)); - PaError := Pa_Terminate; - writeln; -end; - -procedure TestVersion(); -begin - writeln ('*** Test of Pa_GetVersion and Pa_GetVersionText ***'); - PaError := Pa_Initialize; - writeln ('Pa_GetVersion: ', Pa_GetVersion); - writeln ('Pa_GetVersionText: ', Pa_GetVersionText); - PaError := Pa_Terminate; - writeln; -end; - -procedure TestApiInfo(); -begin - writeln ('*** Test of GetPreferredApiIndex ***'); - PaError := Pa_Initialize; - paApiIndex := GetPreferredApiIndex(); - if (paApiIndex = -1) then - writeln ('GetPreferredApiIndex: No working Audio-API found.') - else - writeln ('GetPreferredApiIndex: working Audio-API found. No: ', paApiIndex); - PaError := Pa_Terminate; - writeln; - - writeln ('*** Test of Pa_GetHostApiInfo ***'); - PaError := Pa_Initialize; - paApiIndex := GetPreferredApiIndex(); - paApiInfo := Pa_GetHostApiInfo(paApiIndex); - writeln ('Pa_GetHostApiInfo:'); - writeln ('paApiInfo.structVersion: ', paApiInfo.structVersion); - writeln ('paApiInfo._type: ', paApiInfo._type); - writeln ('paApiInfo.name: ', paApiInfo.name); - writeln ('paApiInfo.deviceCount: ', paApiInfo.deviceCount); - writeln ('paApiInfo.defaultInputDevice: ', paApiInfo.defaultInputDevice); - writeln ('paApiInfo.defaultOutputDevice: ', paApiInfo.defaultOutputDevice); - PaError := Pa_Terminate; - writeln; - - writeln ('*** Test of Pa_HostApiDeviceIndexToDeviceIndex ***'); - PaError := Pa_Initialize; - paApiIndex := GetPreferredApiIndex(); - paApiInfo := Pa_GetHostApiInfo(paApiIndex); - for i:= 0 to paApiInfo^.deviceCount-1 do - begin - deviceIndex := Pa_HostApiDeviceIndexToDeviceIndex(paApiIndex, i); - writeln ('deviceIndex[', i, ']: ', deviceIndex); - end; - PaError := Pa_Terminate; - writeln; -end; - -procedure TestDeviceInfo(); -begin - writeln ('*** Test of Pa_GetDeviceCount ***'); - PaError := Pa_Initialize; - writeln ('Pa_GetDeviceCount: ', Pa_GetDeviceCount); - PaError := Pa_Terminate; - writeln; - - writeln ('*** Test of Pa_GetDefaultInputDevice ***'); - PaError := Pa_Initialize; - writeln ('Pa_GetDefaultInputDevice: ', Pa_GetDefaultInputDevice); - PaError := Pa_Terminate; - writeln; - - writeln ('*** Test of Pa_GetDefaultOutputDevice ***'); - PaError := Pa_Initialize; - writeln ('Pa_GetDefaultOutputDevice: ', Pa_GetDefaultOutputDevice); - PaError := Pa_Terminate; - writeln; - - writeln ('*** Test of Pa_GetDeviceInfo ***'); -// Note: the fields of deviceInfo can also be used without the '^'. -// deviceInfo.name works as well as deviceInfo^.name - PaError := Pa_Initialize; - paApiIndex := GetPreferredApiIndex(); - paApiInfo := Pa_GetHostApiInfo(paApiIndex); - for i:= 0 to paApiInfo^.deviceCount - 1 do - begin - deviceIndex := Pa_HostApiDeviceIndexToDeviceIndex(paApiIndex, i); - deviceInfo := Pa_GetDeviceInfo(deviceIndex); - writeln ('deviceInfo[', i, '].name: ', deviceInfo^.name); - writeln ('deviceInfo[', i, '].structVersion: ', deviceInfo^.structVersion, ' (should be 2)'); - writeln ('deviceInfo[', i, '].hostApi: ', deviceInfo^.hostApi); - writeln ('deviceInfo[', i, '].maxInputChannels: ', deviceInfo^.maxInputChannels); - writeln ('deviceInfo[', i, '].maxOutputChannels: ', deviceInfo^.maxOutputChannels); - writeln ('deviceInfo[', i, '].defaultLowInputLatency: ', deviceInfo^.defaultLowInputLatency:6:4); - writeln ('deviceInfo[', i, '].defaultLowOutputLatency: ', deviceInfo^.defaultLowOutputLatency:6:4); - writeln ('deviceInfo[', i, '].defaultHighInputLatency: ', deviceInfo^.defaultHighInputLatency:6:4); - writeln ('deviceInfo[', i, '].defaultHighOutputLatency: ', deviceInfo^.defaultHighOutputLatency:6:4); - writeln ('deviceInfo[', i, '].defaultSampleRate: ', deviceInfo^.defaultSampleRate:5:0); - writeln; - end; - PaError := Pa_Terminate; -end; - -procedure TestFormatInfo(); -begin - writeln ('*** Test of Pa_IsFormatSupported ***'); - PaError := Pa_Initialize; - paApiIndex := GetPreferredApiIndex(); - paApiInfo := Pa_GetHostApiInfo(paApiIndex); - for i:= 0 to paApiInfo^.deviceCount - 1 do - begin - deviceIndex := Pa_HostApiDeviceIndexToDeviceIndex(paApiIndex, i); - deviceInfo := Pa_GetDeviceInfo(deviceIndex); - writeln ('Device[', i, '] ', deviceInfo^.name, ':'); - New(inputParameters); - New(outputParameters); - - if deviceInfo^.maxInputChannels > 0 then - begin - inputParameters^.device := deviceIndex; - inputParameters^.channelCount := deviceInfo^.maxInputChannels; - inputParameters^.sampleFormat := paInt16; - inputParameters^.suggestedLatency := 0; - inputParameters^.hostApiSpecificStreamInfo := nil; - outputParameters := nil; - end - else - begin - inputParameters := nil; - outputParameters^.device := deviceIndex; - outputParameters^.channelCount := deviceInfo^.maxOutputChannels; - outputParameters^.sampleFormat := paInt16; - outputParameters^.suggestedLatency := 0; - outputParameters^.hostApiSpecificStreamInfo := nil; - end; - - sampleRate := deviceInfo^.defaultSampleRate; - PaError := Pa_IsFormatSupported(inputParameters, outputParameters, sampleRate); - if PaError = paFormatIsSupported then - writeln ('Sample rate: ', sampleRate:5:0, ' : supported') - else - writeln ('Sample rate: ', sampleRate:5:0, ' : Error: ', Pa_GetErrorText(PaError)); - - for j := low(standardSampleRates) to high(standardSampleRates) do - begin - sampleRate := standardSampleRates[j]; - PaError := Pa_IsFormatSupported(inputParameters, outputParameters, sampleRate); - if PaError = paFormatIsSupported then - writeln ('Sample rate: ', sampleRate:5:0, ' : supported') - else - writeln ('Sample rate: ', sampleRate:5:0, ' : Error: ', PaError); - end; - - writeln; - for j := low(SampleFormat) to high(SampleFormat) do - begin - if inputParameters <> nil then - inputParameters^.sampleFormat := SampleFormat[j] - else - outputParameters^.sampleFormat := SampleFormat[j]; - PaError := Pa_IsFormatSupported(inputParameters, outputParameters, sampleRate); - if PaError = paFormatIsSupported then - writeln ('Sample Format ', SampleFormatName[j], ': supported') - else - writeln ('Sample Format ', SampleFormatName[j], ': ', Pa_GetErrorText(PaError)); - end; - - Dispose(inputParameters); - Dispose(outputParameters); - writeln; - end; - PaError := Pa_Terminate; -end; - -function AudioCallback(input: pointer; output: pointer; frameCount: culong; - timeInfo: PPaStreamCallbackTimeInfo; statusFlags: TPaStreamCallbackFlags; - inputDevice: pointer): cint; cdecl; -var - duration: real; -begin - duration := (Now() - callbackStartTime) * 24 * 3600; - if (duration < 2.0) then - result := paContinue - else - begin - callbackWorks := true; - result := paComplete; - end; -end; - -procedure TestStreams(); -begin - writeln ('*** Test of Pa_OpenStream and Pa_CloseStream ***'); - PaError := Pa_Initialize; - paApiIndex := GetPreferredApiIndex(); - paApiInfo := Pa_GetHostApiInfo(paApiIndex); - for i:= 0 to paApiInfo^.deviceCount - 1 do - begin - deviceIndex := Pa_HostApiDeviceIndexToDeviceIndex(paApiIndex, i); - deviceInfo := Pa_GetDeviceInfo(deviceIndex); - writeln ('Device[', i, '] ', deviceInfo^.name, ':'); - New(inputParameters); - New(outputParameters); - if deviceInfo^.maxInputChannels > 0 then - begin - inputParameters^.device := deviceIndex; - inputParameters^.channelCount := deviceInfo^.maxInputChannels; - inputParameters^.sampleFormat := paInt16; - inputParameters^.suggestedLatency := deviceInfo.defaultHighInputLatency; - inputParameters^.hostApiSpecificStreamInfo := nil; - outputParameters := nil; - end - else - begin - inputParameters := nil; - outputParameters^.device := deviceIndex; - outputParameters^.channelCount := deviceInfo^.maxOutputChannels; - outputParameters^.sampleFormat := paInt16; - outputParameters^.suggestedLatency := deviceInfo.defaultLowOutputLatency; - outputParameters^.hostApiSpecificStreamInfo := nil; - end; - - sampleRate := deviceInfo^.defaultSampleRate; - framesPerBuffer := paFramesPerBufferUnspecified; - streamFlags := paNoFlag; - streamCallback := @AudioCallback; - userData := nil; - - PaError := Pa_OpenStream( - stream, - inputParameters, - outputParameters, - sampleRate, - framesPerBuffer, - streamFlags, - streamCallback, - userData - ); - if (PaError = paNoError) and (stream <> nil) then - writeln ('Pa_OpenStream: success') - else - writeln ('Pa_OpenStream: ', Pa_GetErrorText(PaError)); - - if (PaError = paNoError) and (stream <> nil) then - begin - callbackStartTime := Now(); - - PaError := Pa_StartStream(stream); - if (PaError = paNoError) then - writeln ('Pa_StartStream: success') - else - writeln ('Pa_StartStream: ', Pa_GetErrorText(PaError)); - - callbackWorks := false; - - // wait twice the time a successful callback would need for termination - writeln('Wait for callback'); - delay(4000); - - if (callbackWorks and (Pa_IsStreamStopped(stream) = 0)) then - begin - writeln ('Success: Device works'); - PaError := Pa_StopStream(stream); - if (PaError = paNoError) then - writeln ('Pa_StopStream: success') - else - writeln ('Pa_StopStream: ', Pa_GetErrorText(PaError)); - end - else - begin - writeln ('Error: Non working device'); - PaError := Pa_AbortStream(stream); - if (PaError = paNoError) then - writeln ('Pa_AbortStream: success') - else - writeln ('Pa_AbortStream: ', Pa_GetErrorText(PaError)); - - end; - end; - - PaError := Pa_CloseStream(stream); - if PaError = paNoError then - writeln ('Pa_CloseStream: success') - else - writeln ('Pa_CloseStream: ', Pa_GetErrorText(PaError)); - - Dispose(inputParameters); - Dispose(outputParameters); - - writeln; - end; - PaError := Pa_Terminate; -end; - -begin - // floating point exceptions are raised. Therefore, set the exception mask. - SetExceptionMask([exZeroDivide, exPrecision]); - - writeln ('Start: Test of Portaudio libs'); - writeln; - - //TestInitTerminate(); - //TestErrorText(); - //TestVersion(); - //TestApiInfo(); - //TestDeviceInfo(); - //TestFormatInfo(); - TestStreams(); - - writeln ('End: Test of Portaudio libs'); -end. \ No newline at end of file diff --git a/tools/RobotClean.bat b/tools/RobotClean.bat deleted file mode 100644 index 4a8ecc11..00000000 --- a/tools/RobotClean.bat +++ /dev/null @@ -1,21 +0,0 @@ -@echo off -REM -REM It cleans temp files from project -REM - -echo Cleaning files from compiler -del /Q "..\src\WorldParty.res" -del /Q /S "..\*.lps" -RD /Q /S "..\build" -RD /Q /S "..\src\backup" - -echo Cleaning files from installer -RD /Q /S "..\installer\dist" - -echo Cleaning files from game -del /Q "..\game\error.log" "..\game\avatar.db" "..\game\ultrastar.db" "..\game\cover.db" "..\game\config.ini" "..\game\WorldParty.exe" "..\game\screenshots\*.jpg" - -echo Cleaning files from editor -del /Q /S "..\*.bak" - -echo Done diff --git a/tools/ScoreConverter/ScoreConverter.dpr b/tools/ScoreConverter/ScoreConverter.dpr deleted file mode 100644 index 2774cde4..00000000 --- a/tools/ScoreConverter/ScoreConverter.dpr +++ /dev/null @@ -1,17 +0,0 @@ -program ScoreConverter; - -uses - Forms, - Umainform in 'Umainform.pas' {mainform}, - UScores in 'UScores.pas', - UDataBase in '..\Game\Code\Classes\UDataBase.pas', - USongs in 'USongs.pas'; - -{$R *.res} - -begin - Application.Initialize; - Application.Title := 'Score Converter'; - Application.CreateForm(Tmainform, mainform); - Application.Run; -end. diff --git a/tools/ScoreConverter/ScoreConverter.ico b/tools/ScoreConverter/ScoreConverter.ico deleted file mode 100644 index 80319014..00000000 Binary files a/tools/ScoreConverter/ScoreConverter.ico and /dev/null differ diff --git a/tools/ScoreConverter/ScoreConverter.res b/tools/ScoreConverter/ScoreConverter.res deleted file mode 100644 index 2d3bea87..00000000 Binary files a/tools/ScoreConverter/ScoreConverter.res and /dev/null differ diff --git a/tools/ScoreConverter/UScores.pas b/tools/ScoreConverter/UScores.pas deleted file mode 100644 index 801d796e..00000000 --- a/tools/ScoreConverter/UScores.pas +++ /dev/null @@ -1,102 +0,0 @@ -unit UScores; - -interface - -uses USongs; - -procedure ReadScore(var Song: TSong); -procedure WriteScore(var Song: TSong); -procedure AddScore(var Song: TSong; Level: integer; Name: string; Score: integer); - -implementation - -uses IniFiles, SysUtils; - -procedure ReadScore(var Song: TSong); -var - F: TIniFile; - S: string; - P: integer; - Lev: integer; - LevS: string; -begin - F := TIniFile.Create(Song.Path + ChangeFileExt(Song.FileName, '.sco')); - - for Lev := 0 to 2 do begin - case Lev of - 0: LevS := 'Easy'; - 1: LevS := 'Normal'; - 2: LevS := 'Hard'; - end; - - P := 1; - S := F.ReadString(LevS + IntToStr(P), 'Name', ''); - while (S <> '') and (P<=5) do begin - SetLength(Song.Score[Lev], P); - Song.Score[Lev, P-1].Name := S; - Song.Score[Lev, P-1].Score := F.ReadInteger(LevS + IntToStr(P), 'Score', 0); - - Inc(P); - S := F.ReadString(LevS + IntToStr(P), 'Name', ''); - end; - end; -end; - -procedure AddScore(var Song: TSong; Level: integer; Name: string; Score: integer); -var - S: integer; - S2: integer; -begin - S := 0; - while (S <= High(Song.Score[Level])) and (Score <= Song.Score[Level, S].Score) do - Inc(S); - // S has the number for new score - - - // we create new score - SetLength(Song.Score[Level], Length(Song.Score[Level]) + 1); - - // we move down old scores - for S2 := High(Song.Score[Level])-1 downto S do - Song.Score[Level, S2+1] := Song.Score[Level, S2]; - - // we fill new score - Song.Score[Level, S].Name := Name; - Song.Score[Level, S].Score := Score; - - if Length(Song.Score[Level]) > 5 then begin - SetLength(Song.Score[Level], 5); - end; -end; - -procedure WriteScore(var Song: TSong); -var - F: TIniFile; - S: integer; - Lev: integer; - LevS: string; - FileName: string; -begin - FileName := Song.Path + ChangeFileExt(Song.FileName, '.sco'); - if (not FileExists(FileName)) or (FileExists(FileName) and DeleteFile(FileName)) then begin - // file has been deleted -> creating new file - F := TIniFile.Create(FileName); - - for Lev := 0 to 2 do begin - case Lev of - 0: LevS := 'Easy'; - 1: LevS := 'Normal'; - 2: LevS := 'Hard'; - end; - - for S := 0 to high(Song.Score[Lev]) do begin - F.WriteString(LevS + IntToStr(S+1), 'Name', Song.Score[Lev, S].Name); - F.WriteInteger(LevS + IntToStr(S+1), 'Score', Song.Score[Lev, S].Score); - - end; // for S - end; // for Lev - F.Free; - end; // if -end; - -end. diff --git a/tools/ScoreConverter/USongs.pas b/tools/ScoreConverter/USongs.pas deleted file mode 100644 index 8f20f44f..00000000 --- a/tools/ScoreConverter/USongs.pas +++ /dev/null @@ -1,160 +0,0 @@ -unit USongs; - -interface - -type - TScore = record - Name: string; - Score: integer; - Length: string; - end; - - TSong = record - Path: string; - FileName: string; - - Title: string; - Artist: string; - - Score: array[0..2] of array of TScore; - end; - - TSongs = class - LastCount: Integer; - Song: array of TSong; // array of songs - - function ReadHeader(var rSong: TSong): boolean; - procedure BrowseDir(Dir: string); // Browse a dir + subdirs for songfiles - end; - - var Songs: TSongs; - -implementation -uses Sysutils, UMainForm, Dialogs; - -function TSongs.ReadHeader(var rSong: TSong): boolean; -var - Line, Identifier, Value: String; - Temp: word; - Done: byte; - SongFile: Textfile; -begin - Result := False; - - - //Open File and set File Pointer to the beginning - AssignFile(SongFile, rSong.Path + rSong.FileName); - Reset(SongFile); - - //Read Header - Result := true; - - //Read first Line - ReadLn (SongFile, Line); - - if (Length(Line)<=0) then - begin - Result := False; - Exit; - end; - Done := 0; - //Read Lines while Line starts with # - While (Line[1] = '#') do - begin - Temp := Pos(':', Line); - - //Line has a Seperator-> Headerline - if (Temp <> 0) then - begin - //Read Identifier and Value - Identifier := Uppercase(Trim(Copy(Line, 2, Temp - 2))); //Uppercase is for Case Insensitive Checks - Value := Trim(Copy(Line, Temp + 1,Length(Line) - Temp)); - - //Check the Identifier (If Value is given) - if (Length(Value) <> 0) then - begin - - //----------- - //Required Attributes - //----------- - - //Title - if (Identifier = 'TITLE') then - begin - rSong.Title := Value; - - //Add Title Flag to Done - Done := Done or 1; - end - - //Artist - else if (Identifier = 'ARTIST') then - begin - rSong.Artist := Value; - - //Add Artist Flag to Done - Done := Done or 2; - end; - - end; - end; - - if not EOf(SongFile) then - ReadLn (SongFile, Line) - else - begin - Result := False; - break; - end; - - //End on first empty Line - if (Length(Line) = 0) then - break; - end; - - //Check if all Required Values are given - if (Done <> 3) then - begin - Result := False; - end; - - //And Close File - CloseFile(SongFile); -end; - -procedure TSongs.BrowseDir(Dir: string); -var - SR: TSearchRec; // for parsing Songs Directory - SLen: integer; -begin - if FindFirst(Dir + '*', faDirectory, SR) = 0 then begin - repeat - if (SR.Name <> '.') and (SR.Name <> '..') then - BrowseDir(Dir + Sr.Name + '\'); - until FindNext(SR) <> 0; - end; - FindClose(SR); - - if FindFirst(Dir + '*.txt', 0, SR) = 0 then begin - repeat - SLen := Length(Song); - SetLength(Song, SLen + 1); - - Song[SLen].Path := Dir; - Song[SLen].FileName := SR.Name; - - if (ReadHeader(Song[SLen]) = false) then SetLength(Song, SLen); - - //update Songs Label - if LastCount <> SLen div 30 then - begin - LastCount := SLen div 30; - MainForm.UpdateLoadedSongs(Dir, SLen); - end; - - until FindNext(SR) <> 0; - end; // if FindFirst - FindClose(SR); -end; - -end. diff --git a/tools/ScoreConverter/Umainform.dfm b/tools/ScoreConverter/Umainform.dfm deleted file mode 100644 index 05cd5308..00000000 --- a/tools/ScoreConverter/Umainform.dfm +++ /dev/null @@ -1,123 +0,0 @@ -object mainform: Tmainform - Left = 328 - Top = 228 - HorzScrollBar.Visible = False - VertScrollBar.Visible = False - BorderIcons = [biSystemMenu, biMinimize] - BorderStyle = bsSingle - Caption = 'Ultrastar Deluxe Score Converter' - ClientHeight = 159 - ClientWidth = 449 - Color = clBtnFace - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'MS Sans Serif' - Font.Style = [] - OldCreateOrder = False - Position = poDesktopCenter - OnCreate = FormCreate - PixelsPerInch = 96 - TextHeight = 13 - object Label1: TLabel - Left = 8 - Top = 8 - Width = 60 - Height = 13 - Caption = 'SongFolder: ' - end - object lFolder: TLabel - Left = 8 - Top = 24 - Width = 29 - Height = 13 - Caption = 'Folder' - end - object Label2: TLabel - Left = 8 - Top = 48 - Width = 49 - Height = 13 - Caption = 'Database:' - end - object lDatabase: TLabel - Left = 8 - Top = 64 - Width = 46 - Height = 13 - Caption = 'Database' - end - object lDatabase2: TLabel - Left = 72 - Top = 48 - Width = 54 - Height = 13 - Caption = 'lDatabase2' - end - object lFolder2: TLabel - Left = 72 - Top = 8 - Width = 37 - Height = 13 - Caption = 'lFolder2' - end - object lStatus: TLabel - Left = 0 - Top = 96 - Width = 449 - Height = 13 - Alignment = taCenter - AutoSize = False - Caption = 'lStatus' - end - object bFLoad: TButton - Left = 176 - Top = 8 - Width = 57 - Height = 17 - Caption = 'Load' - TabOrder = 0 - OnClick = bFLoadClick - end - object bDLoad: TButton - Left = 176 - Top = 48 - Width = 57 - Height = 17 - Caption = 'Load' - TabOrder = 1 - OnClick = bDLoadClick - end - object bToDB: TButton - Left = 16 - Top = 112 - Width = 153 - Height = 17 - Caption = 'Convert *.SCO to Database' - Enabled = False - TabOrder = 2 - OnClick = bToDBClick - end - object bFromDB: TButton - Left = 288 - Top = 112 - Width = 145 - Height = 17 - Caption = 'Convert Database to *.SCO' - Enabled = False - TabOrder = 3 - OnClick = bFromDBClick - end - object pProgress: TProgressBar - Left = 8 - Top = 136 - Width = 433 - Height = 17 - TabOrder = 4 - end - object oDatabase: TOpenDialog - Filter = 'Ultrastar Deluxe Database|ultrastar.db' - Left = 136 - Top = 48 - end -end diff --git a/tools/ScoreConverter/Umainform.pas b/tools/ScoreConverter/Umainform.pas deleted file mode 100644 index 647cf3a4..00000000 --- a/tools/ScoreConverter/Umainform.pas +++ /dev/null @@ -1,230 +0,0 @@ -unit Umainform; - -interface - -uses - Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, StdCtrls, ComCtrls, UDataBase, ShellAPI, ShlObj, USongs; - -type - Tmainform = class(TForm) - Label1: TLabel; - lFolder: TLabel; - bFLoad: TButton; - Label2: TLabel; - lDatabase: TLabel; - bDLoad: TButton; - lDatabase2: TLabel; - lFolder2: TLabel; - bToDB: TButton; - bFromDB: TButton; - pProgress: TProgressBar; - oDatabase: TOpenDialog; - lStatus: TLabel; - procedure FormCreate(Sender: TObject); - procedure bDLoadClick(Sender: TObject); - function BrowseDialog (const Title: string; const Flag: integer): string; - procedure bFLoadClick(Sender: TObject); - procedure UpdateLoadedSongs(Path: String; Count: integer); - procedure bToDBClick(Sender: TObject); - procedure bFromDBClick(Sender: TObject); - private - { Private-Deklarationen } - public - { Public-Deklarationen } - end; - -var - mainform: Tmainform; - DBLoaded: Boolean; - SFLoaded: Boolean; - - -implementation - -uses UScores; - -{$R *.dfm} - -function Tmainform.BrowseDialog - (const Title: string; const Flag: integer): string; -var - lpItemID : PItemIDList; - BrowseInfo : TBrowseInfo; - DisplayName : array[0..MAX_PATH] of char; - TempPath : array[0..MAX_PATH] of char; -begin - Result:=''; - FillChar(BrowseInfo, sizeof(TBrowseInfo), #0); - with BrowseInfo do begin - hwndOwner := Application.Handle; - pszDisplayName := @DisplayName; - lpszTitle := PChar(Title); - ulFlags := Flag; - end; - lpItemID := SHBrowseForFolder(BrowseInfo); - if lpItemId <> nil then begin - SHGetPathFromIDList(lpItemID, TempPath); - Result := TempPath; - GlobalFreePtr(lpItemID); - end; -end; - -procedure Tmainform.FormCreate(Sender: TObject); -begin - Database := TDataBaseSystem.Create; - Songs := TSongs.Create; - lStatus.Caption := 'Welcome to USD Score Converter'; - lFolder2.Caption := 'No Songs loaded'; - lFolder.Caption := ''; - lDataBase2.Caption := 'No Database loaded'; - lDataBase.Caption := ''; -end; - -procedure Tmainform.bDLoadClick(Sender: TObject); -begin - if oDatabase.Execute then - begin - try - Database.Init(oDataBase.FileName); - lDataBase2.Caption := 'Database loaded'; - lDataBase.Caption := oDataBase.FileName; - DBLoaded := True; - except - lDataBase2.Caption := 'No Database loaded'; - lDataBase.Caption := ''; - DBLoaded := False; - end; - end; - bToDB.Enabled := DBLoaded and SFLoaded; - bFromDB.Enabled := bToDB.Enabled; -end; - -procedure Tmainform.bFLoadClick(Sender: TObject); -var - Path: String; -begin - Path := BrowseDialog('Select UltraStar SongFolder', BIF_RETURNONLYFSDIRS); - - if Path <> '' then - begin - SetLength(Songs.Song, 0); - try - Songs.BrowseDir(Path + '\'); - lFolder2.Caption := Inttostr(Length(Songs.Song)) + ' Songs loaded'; - lFolder.Caption := Path; - SFLoaded := True; - except - lFolder2.Caption := 'No Songs loaded'; - lFolder.Caption := ''; - SFLoaded := False; - end; - end; - - bToDB.Enabled := DBLoaded and SFLoaded; - bFromDB.Enabled := bToDB.Enabled; -end; - -procedure Tmainform.UpdateLoadedSongs(Path: String; Count: integer); -begin - lFolder2.Caption := Inttostr(Count) + ' Songs loaded'; - lFolder.Caption := Path; - Application.ProcessMessages; -end; - -procedure Tmainform.bToDBClick(Sender: TObject); -var - I, J, K: Integer; - LastI: integer; -begin - if (Messagebox(0, PChar('If the same directory is added more than one time the Score-File will be useless. Contnue ?'), PChar(Mainform.Caption), MB_ICONWARNING or MB_YESNO) = IDYes) then - begin - pProgress.Max := high(Songs.Song); - pProgress.Position := 0; - // Go through all Songs - For I := 0 to high(Songs.Song) do - begin - try - //Read Scores from .SCO File - ReadScore (Songs.Song[I]); - - //Go from Easy to Difficult - For J := 0 to 2 do - begin - //Go through all Score Entrys with Difficulty J - For K := 0 to high(Songs.Song[I].Score[J]) do - begin - //Add to DataBase - DataBase.AddScore(Songs.Song[I], J, Songs.Song[I].Score[J][K].Name, Songs.Song[I].Score[J][K].Score); - end; - end; - - except - showmessage ('Error Converting Score From Song: ' + Songs.Song[I].Path + Songs.Song[I].FileName); - end; - - //Update ProgressBar - J := I div 30; - if (LastI <> J) then - begin - LastI := J; - pProgress.Position := I; - lStatus.Caption := 'Adding Songscore: ' + Songs.Song[I].Artist + ' - ' + Songs.Song[I].Title; - Application.ProcessMessages; - end; - end; - - pProgress.Position := pProgress.Max; - lStatus.Caption := 'Finished'; - end; -end; - -procedure Tmainform.bFromDBClick(Sender: TObject); -var - I, J: Integer; - LastI: integer; - anyScoreinthere: boolean; -begin - if (Messagebox(0, PChar('All Score Entrys in the Song Directory having an equivalent will be Overwritten. Contnue ?'), PChar(Mainform.Caption), MB_ICONWARNING or MB_YESNO) = IDYes) then - begin - pProgress.Max := high(Songs.Song); - pProgress.Position := 0; - // Go through all Songs - For I := 0 to high(Songs.Song) do - begin - try - //Not Write ScoreFile when there are no Scores for this File - anyScoreinthere := false; - //Read Scores from DB File - Database.ReadScore (Songs.Song[I]); - - //Go from Easy to Difficult - For J := 0 to 2 do - begin - anyScoreinthere := anyScoreinthere or (Length(Songs.Song[I].Score[J]) > 0); - end; - - if AnyScoreinThere then - WriteScore(Songs.Song[I]); - - except - showmessage ('Error Converting Score From Song: ' + Songs.Song[I].Path + Songs.Song[I].FileName); - end; - - //Update ProgressBar - J := I div 30; - if (LastI <> J) then - begin - LastI := J; - pProgress.Position := I; - lStatus.Caption := 'Writing ScoreFile: ' + Songs.Song[I].Artist + ' - ' + Songs.Song[I].Title; - Application.ProcessMessages; - end; - end; - - pProgress.Position := pProgress.Max; - lStatus.Caption := 'Finished'; - end; -end; - -end.